diff options
author | Ian Romanick <[email protected]> | 2016-08-17 10:20:34 +0100 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-08-26 15:03:15 -0700 |
commit | dc4f53b68308bbd79932470cf4613037f7e95fb7 (patch) | |
tree | ab86f908b5d9e32cd416c951a35a3d0ea811b984 /src/mesa/main | |
parent | 87fa462ffd6754144f89163a2692eff005beef9c (diff) |
mesa: Add support for OES_texture_cube_map_array
This has a separate enable flag because this extension also requires
OES_geometry_shader. It is possible that some drivers may support
OpenGL ES 3.1 and ARB_texture_cube_map but not support
OES_geometry_shader.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/context.h | 3 | ||||
-rw-r--r-- | src/mesa/main/extensions_table.h | 1 | ||||
-rw-r--r-- | src/mesa/main/genmipmap.c | 2 | ||||
-rw-r--r-- | src/mesa/main/get.c | 4 | ||||
-rw-r--r-- | src/mesa/main/get_hash_params.py | 6 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 1 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 2 | ||||
-rw-r--r-- | src/mesa/main/texparam.c | 5 | ||||
-rw-r--r-- | src/mesa/main/texstorage.c | 3 |
9 files changed, 16 insertions, 11 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 9100ae75cdc..4cd149de14e 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -354,7 +354,8 @@ _mesa_has_tessellation(const struct gl_context *ctx) static inline bool _mesa_has_texture_cube_map_array(const struct gl_context *ctx) { - return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_cube_map_array; + return _mesa_has_ARB_texture_cube_map_array(ctx) || + _mesa_has_OES_texture_cube_map_array(ctx); } #ifdef __cplusplus diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 9d0677af499..a3fcad52121 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -373,6 +373,7 @@ EXT(OES_texture_border_clamp , ARB_texture_border_clamp EXT(OES_texture_buffer , OES_texture_buffer , x , x , x , 31, 2014) EXT(OES_texture_compression_astc , OES_texture_compression_astc , x , x , ES1, ES2, 2015) EXT(OES_texture_cube_map , ARB_texture_cube_map , x , x , ES1, x , 2007) +EXT(OES_texture_cube_map_array , OES_texture_cube_map_array , x , x , x , 31, 2014) EXT(OES_texture_env_crossbar , ARB_texture_env_crossbar , x , x , ES1, x , 2005) EXT(OES_texture_float , OES_texture_float , x , x , x , ES2, 2005) EXT(OES_texture_float_linear , OES_texture_float_linear , x , x , x , ES2, 2005) diff --git a/src/mesa/main/genmipmap.c b/src/mesa/main/genmipmap.c index 5038d5cc053..6021c026f53 100644 --- a/src/mesa/main/genmipmap.c +++ b/src/mesa/main/genmipmap.c @@ -65,7 +65,7 @@ _mesa_is_valid_generate_texture_mipmap_target(struct gl_context *ctx, || !ctx->Extensions.EXT_texture_array; break; case GL_TEXTURE_CUBE_MAP_ARRAY: - error = !_mesa_has_ARB_texture_cube_map_array(ctx); + error = !_mesa_has_texture_cube_map_array(ctx); break; default: error = true; diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index e22bb5ff6a5..0aa9065764b 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -442,7 +442,7 @@ EXTRA_EXT(OES_EGL_image_external); EXTRA_EXT(ARB_blend_func_extended); EXTRA_EXT(ARB_uniform_buffer_object); EXTRA_EXT(ARB_timer_query); -EXTRA_EXT(ARB_texture_cube_map_array); +EXTRA_EXT2(ARB_texture_cube_map_array, OES_texture_cube_map_array); EXTRA_EXT(ARB_texture_buffer_range); EXTRA_EXT(ARB_texture_multisample); EXTRA_EXT(ARB_texture_gather); @@ -1858,7 +1858,7 @@ tex_binding_to_index(const struct gl_context *ctx, GLenum binding) _mesa_has_OES_texture_buffer(ctx)) ? TEXTURE_BUFFER_INDEX : -1; case GL_TEXTURE_BINDING_CUBE_MAP_ARRAY: - return _mesa_has_ARB_texture_cube_map_array(ctx) + return _mesa_has_texture_cube_map_array(ctx) ? TEXTURE_CUBE_ARRAY_INDEX : -1; case GL_TEXTURE_BINDING_2D_MULTISAMPLE: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_multisample diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index 3414743ddbf..35af48b96aa 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -516,6 +516,9 @@ descriptor=[ # GL_ARB_shader_image_load_store / GL_ARB_shader_storage_buffer_object / GLES 3.1 # (MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS in GL_ARB_shader_image_load_store) [ "MAX_COMBINED_SHADER_OUTPUT_RESOURCES", "CONTEXT_INT(Const.MaxCombinedShaderOutputResources), extra_ARB_shader_image_load_store_shader_storage_buffer_object_es31" ], + + # GL_ARB_texture_cube_map_array + [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array_OES_texture_cube_map_array" ], ]}, # Enums in OpenGL Core profile and ES 3.0 @@ -899,9 +902,6 @@ descriptor=[ # GL_ARB_map_buffer_alignment [ "MIN_MAP_BUFFER_ALIGNMENT", "CONTEXT_INT(Const.MinMapBufferAlignment), NO_EXTRA" ], -# GL_ARB_texture_cube_map_array - [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ], - # GL_ARB_texture_gather [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxProgramTextureGatherComponents), extra_ARB_texture_gather"], diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 76371609e6c..fceed95b17c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3944,6 +3944,7 @@ struct gl_extensions GLboolean OES_shader_io_blocks; GLboolean OES_standard_derivatives; GLboolean OES_texture_buffer; + GLboolean OES_texture_cube_map_array; /* vendor extensions */ GLboolean AMD_performance_monitor; GLboolean AMD_pinned_memory; diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 655627b92c3..9a051bc8e2b 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1579,7 +1579,7 @@ _mesa_tex_target_to_index(const struct gl_context *ctx, GLenum target) return _mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external ? TEXTURE_EXTERNAL_INDEX : -1; case GL_TEXTURE_CUBE_MAP_ARRAY: - return _mesa_has_ARB_texture_cube_map_array(ctx) + return _mesa_has_texture_cube_map_array(ctx) ? TEXTURE_CUBE_ARRAY_INDEX : -1; case GL_TEXTURE_2D_MULTISAMPLE: return ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_multisample) || diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index ba83f8fda9a..bdd3fcb72dd 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1243,6 +1243,8 @@ _mesa_legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target */ return (ctx->API == API_OPENGL_CORE && ctx->Version >= 31) || _mesa_has_OES_texture_buffer(ctx); + case GL_TEXTURE_CUBE_MAP_ARRAY: + return _mesa_has_texture_cube_map_array(ctx); } if (!_mesa_is_desktop_gl(ctx)) @@ -1257,8 +1259,7 @@ _mesa_legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target return GL_TRUE; case GL_PROXY_TEXTURE_CUBE_MAP: return ctx->Extensions.ARB_texture_cube_map; - case GL_TEXTURE_CUBE_MAP_ARRAY_ARB: - case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: return ctx->Extensions.ARB_texture_cube_map_array; case GL_TEXTURE_RECTANGLE_NV: case GL_PROXY_TEXTURE_RECTANGLE_NV: diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c index c43f2d402d6..817a7464d9f 100644 --- a/src/mesa/main/texstorage.c +++ b/src/mesa/main/texstorage.c @@ -71,6 +71,8 @@ legal_texobj_target(const struct gl_context *ctx, GLuint dims, GLenum target) return true; case GL_TEXTURE_2D_ARRAY: return ctx->Extensions.EXT_texture_array; + case GL_TEXTURE_CUBE_MAP_ARRAY: + return _mesa_has_texture_cube_map_array(ctx); } break; } @@ -108,7 +110,6 @@ legal_texobj_target(const struct gl_context *ctx, GLuint dims, GLenum target) return true; case GL_PROXY_TEXTURE_2D_ARRAY: return ctx->Extensions.EXT_texture_array; - case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: return ctx->Extensions.ARB_texture_cube_map_array; default: |