summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2013-03-04 11:03:58 -0800
committerIan Romanick <[email protected]>2013-04-05 19:01:10 -0700
commitc7720a24beb4ac8a0dde7b51de96efb3a19b7f7a (patch)
treea9a5d48c6689bf0883e6cec69291925ee701761d
parent82ac970d37d3a1ccc7287a9fe07223725ac3ddec (diff)
mesa: Implement TEXTURE_IMMUTABLE_LEVELS for ES 3.0.
NOTE: This is a candidate for the 9.1 branch. Fixes piglit's texture-immutable-levels test. Reported-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> (cherry picked from commit 12dc4be8a66c92ce04637abc54ed85ac7ff9aa13)
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/texparam.c12
-rw-r--r--src/mesa/main/texstorage.c1
3 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 3369623f707..8f906aeedf5 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1274,6 +1274,7 @@ struct gl_texture_object
GLfloat Priority; /**< in [0,1] */
GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */
GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */
+ GLint ImmutableLevels; /**< ES 3.0 / ARB_texture_view */
GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */
GLint CropRect[4]; /**< GL_OES_draw_texture */
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 6f18ec6dabd..dd67baae962 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1432,6 +1432,12 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
*params = (GLfloat) obj->Immutable;
break;
+ case GL_TEXTURE_IMMUTABLE_LEVELS:
+ if (!_mesa_is_gles3(ctx))
+ goto invalid_pname;
+ *params = (GLfloat) obj->ImmutableLevels;
+ break;
+
case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image_external)
goto invalid_pname;
@@ -1609,6 +1615,12 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
*params = (GLint) obj->Immutable;
break;
+ case GL_TEXTURE_IMMUTABLE_LEVELS:
+ if (!_mesa_is_gles3(ctx))
+ goto invalid_pname;
+ *params = obj->ImmutableLevels;
+ break;
+
case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image_external)
goto invalid_pname;
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 00f19bae51c..675fd745b71 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -397,6 +397,7 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,
}
texObj->Immutable = GL_TRUE;
+ texObj->ImmutableLevels = levels;
}
}