From: Tapani Pälli Date: Wed, 9 May 2018 06:12:32 +0000 (+0300) Subject: mesa: changes to expose OES_texture_view extension X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ddcdcf94d79a01728b45ccf4f1131e208375544;p=mesa.git mesa: changes to expose OES_texture_view extension 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 Reviewed-by: Kenneth Graunke --- diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index a53fcd1e8ab..459f642e477 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -1445,4 +1445,19 @@ + + + + + + + + + + + + + + + diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index ef06540e9ba..77520f678ff 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -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 diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 38d241db529..9207e3f8c6e 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -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) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 2ef12a444ea..93136f5f8ad 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -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; diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index b9de084ccfb..096d16a6092 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -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 }, diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 301407e7384..b5d86d64d5b 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -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;