mesa: changes to expose OES_texture_view extension
authorTapani Pälli <tapani.palli@intel.com>
Wed, 9 May 2018 06:12:32 +0000 (09:12 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 24 May 2018 09:53:07 +0000 (12:53 +0300)
Functionality already covered by ARB_texture_view, patch also
adds missing 'gles guard' for enums (added in f1563e6392).

Tested via arb_texture_view.*_gles3 tests and individual app
utilizing texture view with ETC2.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mapi/glapi/gen/es_EXT.xml
src/mesa/main/context.h
src/mesa/main/extensions_table.h
src/mesa/main/mtypes.h
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/texparam.c

index a53fcd1e8abdee76bd87f0a2ee1c6520c40fd0a3..459f642e47714050b511f1ddbad5816602af6528 100644 (file)
     </function>
 </category>
 
+<!-- 218. GL_OES_texture_view -->
+
+<category name="GL_OES_texture_view" number="218">
+    <function name="TextureViewOES" es2="3.1" alias="TextureView">
+        <param name="texture" type="GLuint"/>
+        <param name="target" type="GLenum"/>
+        <param name="origtexture" type="GLuint"/>
+        <param name="internalformat" type="GLenum"/>
+        <param name="minlevel" type="GLuint"/>
+        <param name="numlevels" type="GLuint"/>
+        <param name="minlayer" type="GLuint"/>
+        <param name="numlayers" type="GLuint"/>
+   </function>
+</category>
+
 </OpenGLAPI>
index ef06540e9bab26e9638a455da3a7113806d301ee..77520f678ff93b48e64eef4679fe30879f689d25 100644 (file)
@@ -362,6 +362,13 @@ _mesa_has_texture_cube_map_array(const struct gl_context *ctx)
           _mesa_has_OES_texture_cube_map_array(ctx);
 }
 
+static inline bool
+_mesa_has_texture_view(const struct gl_context *ctx)
+{
+   return _mesa_has_ARB_texture_view(ctx) ||
+          _mesa_has_OES_texture_view(ctx);
+}
+
 #ifdef __cplusplus
 }
 #endif
index 38d241db529f31d25d66b9e8d65e37aefec4e27f..9207e3f8c6e64a3d3f036d3fdd1a72328d0e55bc 100644 (file)
@@ -420,6 +420,7 @@ EXT(OES_texture_mirrored_repeat             , dummy_true
 EXT(OES_texture_npot                        , ARB_texture_non_power_of_two           ,  x ,  x , ES1, ES2, 2005)
 EXT(OES_texture_stencil8                    , ARB_texture_stencil8                   ,  x ,  x ,  x ,  30, 2014)
 EXT(OES_texture_storage_multisample_2d_array, ARB_texture_multisample                ,  x ,  x ,  x ,  31, 2014)
+EXT(OES_texture_view                        , OES_texture_view                       ,  x ,  x ,  x ,  31, 2014)
 EXT(OES_vertex_array_object                 , dummy_true                             ,  x ,  x , ES1, ES2, 2010)
 EXT(OES_vertex_half_float                   , ARB_half_float_vertex                  ,  x ,  x ,  x , ES2, 2005)
 EXT(OES_viewport_array                      , OES_viewport_array                     ,  x ,  x ,  x ,  31, 2010)
index 2ef12a444ea23a8945141fd4c9ed1461f5472b63..93136f5f8adb11cfbbaf6b7dabd2edc3aaf114c9 100644 (file)
@@ -4200,6 +4200,7 @@ struct gl_extensions
    GLboolean OES_standard_derivatives;
    GLboolean OES_texture_buffer;
    GLboolean OES_texture_cube_map_array;
+   GLboolean OES_texture_view;
    GLboolean OES_viewport_array;
    /* vendor extensions */
    GLboolean AMD_performance_monitor;
index b9de084ccfbf73ce8562868a48e3a625ba47ac1f..096d16a60925b28b8212cfd3fa9aa5ec3ca78bfd 100644 (file)
@@ -2748,6 +2748,9 @@ const struct function gles31_functions_possible[] = {
    /* GL_OES_texture_storage_multisample_2d_array */
    { "glTexStorage3DMultisampleOES", 31, -1 },
 
+   /* GL_OES_texture_view */
+   { "glTextureViewOES", 31, -1 },
+
    /* GL_EXT_buffer_storage */
    { "glBufferStorageEXT", 31, -1 },
 
index 301407e7384e4a6ab8a119faef4a5c8d74d59285..b5d86d64d5bd624c4bc2aa893bd020a0373885c5 100644 (file)
@@ -1979,33 +1979,32 @@ get_tex_parameterfv(struct gl_context *ctx,
          break;
 
       case GL_TEXTURE_IMMUTABLE_LEVELS:
-         if (_mesa_is_gles3(ctx) ||
-             (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_view))
+         if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx))
             *params = (GLfloat) obj->ImmutableLevels;
          else
             goto invalid_pname;
          break;
 
       case GL_TEXTURE_VIEW_MIN_LEVEL:
-         if (!ctx->Extensions.ARB_texture_view)
+         if (!_mesa_has_texture_view(ctx))
             goto invalid_pname;
          *params = (GLfloat) obj->MinLevel;
          break;
 
       case GL_TEXTURE_VIEW_NUM_LEVELS:
-         if (!ctx->Extensions.ARB_texture_view)
+         if (!_mesa_has_texture_view(ctx))
             goto invalid_pname;
          *params = (GLfloat) obj->NumLevels;
          break;
 
       case GL_TEXTURE_VIEW_MIN_LAYER:
-         if (!ctx->Extensions.ARB_texture_view)
+         if (!_mesa_has_texture_view(ctx))
             goto invalid_pname;
          *params = (GLfloat) obj->MinLayer;
          break;
 
       case GL_TEXTURE_VIEW_NUM_LAYERS:
-         if (!ctx->Extensions.ARB_texture_view)
+         if (!_mesa_has_texture_view(ctx))
             goto invalid_pname;
          *params = (GLfloat) obj->NumLayers;
          break;