Mesa (master): i965: Reject unsupported formats in glEGLImageTargetTexture2D()
Chad Versace
chadversary at kemper.freedesktop.org
Thu Jun 1 19:06:52 UTC 2017
Module: Mesa
Branch: master
Commit: 7a4964ec5c1a0dd065436ff7d25aecb45d306979
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a4964ec5c1a0dd065436ff7d25aecb45d306979
Author: Chad Versace <chadversary at chromium.org>
Date: Tue May 30 09:53:28 2017 -0700
i965: Reject unsupported formats in glEGLImageTargetTexture2D()
If the EGLImage's format is not a supported texture format according to
brw_surface_formats.c, then refuse to create the miptree. This follows
the precedent in glEGLImageRenderbufferStorage (implemented by
intel_image_target_renderbuffer_storage), which rejects the EGLImage's
format if is not renderable.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/intel_tex_image.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 7208d8eb4a..649b3907d1 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -251,9 +251,13 @@ static struct intel_mipmap_tree *
create_mt_for_dri_image(struct brw_context *brw,
GLenum target, __DRIimage *image)
{
+ struct gl_context *ctx = &brw->ctx;
struct intel_mipmap_tree *mt;
uint32_t draw_x, draw_y;
+ if (!ctx->TextureFormatSupported[image->format])
+ return NULL;
+
/* Disable creation of the texture's aux buffers because the driver exposes
* no EGL API to manage them. That is, there is no API for resolving the aux
* buffer's content to the main buffer nor for invalidating the aux buffer's
More information about the mesa-commit
mailing list