Mesa (master): mesa: Fix error condition for valid texture targets in glTexStorage* functions

Anuj Phogat aphogat at kemper.freedesktop.org
Tue Aug 5 01:32:10 UTC 2014


Module: Mesa
Branch: master
Commit: a94d78438d35cfde851596dff8461f1e739a0ddc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a94d78438d35cfde851596dff8461f1e739a0ddc

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Fri May 30 14:55:28 2014 -0700

mesa: Fix error condition for valid texture targets in glTexStorage* functions

Fixes gles3 Khronos CTS test: texture_storage_texture_targets

Cc: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

---

 src/mesa/main/texstorage.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 86c8f3c..44b5374 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -53,6 +53,13 @@
 static GLboolean
 legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target)
 {
+   if (_mesa_is_gles3(ctx)
+       && target != GL_TEXTURE_2D
+       && target != GL_TEXTURE_CUBE_MAP
+       && target != GL_TEXTURE_3D
+       && target != GL_TEXTURE_2D_ARRAY)
+      return GL_FALSE;
+
    switch (dims) {
    case 1:
       switch (target) {




More information about the mesa-commit mailing list