[Mesa-dev] [PATCH] mesa: Allow glGet* queries on EXT_texture_lod_bias data in ES 3

Matt Turner mattst88 at gmail.com
Tue Nov 20 11:47:52 PST 2012


Fixes the remaining 4 texture_lod_bias failures in es3conform.
---
 src/mesa/main/get.c              |   17 +++++++++++++++++
 src/mesa/main/get_hash_params.py |    8 +++++---
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 43bf3b9..838b73c 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -129,6 +129,7 @@ enum value_extra {
    EXTRA_VERSION_31,
    EXTRA_VERSION_32,
    EXTRA_API_GL,
+   EXTRA_API_ES1,
    EXTRA_API_ES2,
    EXTRA_API_ES3,
    EXTRA_NEW_BUFFERS, 
@@ -285,6 +286,16 @@ static const int extra_EXT_pixel_buffer_object_api_es3[] = {
    EXTRA_END
 };
 
+static const int extra_EXT_texture_lod_bias_api_es3[] = {
+   /* There is no EXT_texture_lod_bias field in ctx->Extensions
+    * so check for presence by looking at the API.
+    */
+   EXTRA_API_GL,
+   EXTRA_API_ES1,
+   EXTRA_API_ES3,
+   EXTRA_END
+};
+
 static const int extra_EXT_texture_integer[] = {
    EXT(EXT_texture_integer),
    EXTRA_END
@@ -916,6 +927,12 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d
          if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
             _mesa_update_state(ctx);
          break;
+      case EXTRA_API_ES1:
+	 if (ctx->API == API_OPENGLES) {
+	    total++;
+	    enabled++;
+	 }
+	 break;
       case EXTRA_API_ES2:
 	 if (ctx->API == API_OPENGLES2) {
 	    total++;
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 1772ed2..1d80528 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -231,9 +231,6 @@ descriptor=[
 
 # GL_OES_point_sprite
   [ "POINT_SPRITE_NV", "CONTEXT_BOOL(Point.PointSprite), extra_NV_point_sprite_ARB_point_sprite" ],
-
-# GL_EXT_texture_lod_bias
-  [ "MAX_TEXTURE_LOD_BIAS_EXT", "CONTEXT_FLOAT(Const.MaxTextureLodBias), NO_EXTRA" ],
 ]},
 
 
@@ -647,6 +644,11 @@ descriptor=[
   [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ],
 ]},
 
+{ "apis": ["GL", "GL_CORE", "GLES", "GLES2"], "params": [
+# GL_EXT_texture_lod_bias
+  [ "MAX_TEXTURE_LOD_BIAS_EXT", "CONTEXT_FLOAT(Const.MaxTextureLodBias), extra_EXT_texture_lod_bias_api_es3" ],
+]},
+
 { "apis": ["GL", "GL_CORE", "GLES2"], "params": [
 # GL_EXT_pixel_buffer_object
   [ "PIXEL_PACK_BUFFER_BINDING_EXT", "LOC_CUSTOM, TYPE_INT, 0, extra_EXT_pixel_buffer_object_api_es3" ],
-- 
1.7.8.6



More information about the mesa-dev mailing list