diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2017-08-01 14:51:40 -0700 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2017-08-07 18:17:17 +0100 |
commit | 12181b501732b0c098b90e4128dc44032d08df00 (patch) | |
tree | f7e27b9a0abb981832ab2ac22134dc42fff8fa06 | |
parent | bbdeddd5fd0b797e1e281f058338b3da4d98029d (diff) |
egl/dri2: add image extension such it's usable by swrast driver
Otherwise, this extension is not visible to the EGL users who
use the swrast driver.
This will allow the swrast driver to use eglCreateImageKHR,
provided the target is EGL_GL_TEXTURE_2D_KHR or
EGL_GL_RENDERBUFFER_KHR. Note we still have to implement the
create from render buffer path.
v2: add it to optional_core_extensions instead of swrast_core_extensions,
so it's not a requirement (Emil)
v3: Merge egl/dri2 changes together, also add support for
platform_wayland (Emil)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 1 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 3 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 733659d547..f0d1ded408 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -435,6 +435,7 @@ static const struct dri2_extension_match optional_core_extensions[] = { { __DRI2_FENCE, 1, offsetof(struct dri2_egl_display, fence) }, { __DRI2_RENDERER_QUERY, 1, offsetof(struct dri2_egl_display, rendererQuery) }, { __DRI2_INTEROP, 1, offsetof(struct dri2_egl_display, interop) }, + { __DRI_IMAGE, 1, offsetof(struct dri2_egl_display, image) }, { NULL, 0, 0 } }; diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 73966b7c50..a11eaedefd 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -1883,7 +1883,7 @@ static const struct dri2_egl_display_vtbl dri2_wl_swrast_display_vtbl = { .create_pixmap_surface = dri2_wl_create_pixmap_surface, .create_pbuffer_surface = dri2_fallback_create_pbuffer_surface, .destroy_surface = dri2_wl_destroy_surface, - .create_image = dri2_fallback_create_image_khr, + .create_image = dri2_create_image_khr, .swap_buffers = dri2_wl_swrast_swap_buffers, .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage, .swap_buffers_region = dri2_fallback_swap_buffers_region, @@ -1906,6 +1906,7 @@ static const __DRIswrastLoaderExtension swrast_loader_extension = { static const __DRIextension *swrast_loader_extensions[] = { &swrast_loader_extension.base, + &image_lookup_extension.base, NULL, }; diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 61e700f7ec..4ce819f1c9 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -1127,7 +1127,7 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = { .create_pixmap_surface = dri2_x11_create_pixmap_surface, .create_pbuffer_surface = dri2_x11_create_pbuffer_surface, .destroy_surface = dri2_x11_destroy_surface, - .create_image = dri2_fallback_create_image_khr, + .create_image = dri2_create_image_khr, .swap_interval = dri2_fallback_swap_interval, .swap_buffers = dri2_x11_swap_buffers, .set_damage_region = dri2_fallback_set_damage_region, @@ -1172,6 +1172,7 @@ static const __DRIswrastLoaderExtension swrast_loader_extension = { static const __DRIextension *swrast_loader_extensions[] = { &swrast_loader_extension.base, + &image_lookup_extension.base, NULL, }; |