[Mesa-stable] [PATCH 2/8] mesa: Add missing API check for GL_TEXTURE_3D

Ian Romanick idr at freedesktop.org
Tue Nov 26 15:54:17 PST 2013


From: Ian Romanick <ian.d.romanick at intel.com>

There are no 3D textures in OpenGL ES 1.x.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: "9.1 9.2 10.0" <mesa-stable at lists.freedesktop.org>
---
Since this just adds a missing error check, it's arguable that this
should not be included in stable branches.  Opinions?

 src/mesa/main/texobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index c110f50..4c3d468 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1179,7 +1179,7 @@ target_enum_to_index(struct gl_context *ctx, GLenum target)
    case GL_TEXTURE_2D:
       return TEXTURE_2D_INDEX;
    case GL_TEXTURE_3D:
-      return TEXTURE_3D_INDEX;
+      return ctx->API != API_OPENGLES ? TEXTURE_3D_INDEX : -1;
    case GL_TEXTURE_CUBE_MAP_ARB:
       return ctx->Extensions.ARB_texture_cube_map
          ? TEXTURE_CUBE_INDEX : -1;
-- 
1.8.1.4



More information about the mesa-stable mailing list