From 272fe9494232baab159d10901aecfe1786595b17 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 19 Oct 2017 22:22:15 +0200 Subject: mesa: enable ARB_texture_buffer_* extensions in the Compatibility profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already have piglit tests testing alpha, luminance, and intensity formats. They were skipped by piglit until now. Additionally, I'm enabling one ARB_texture_buffer_range piglit test to run with the compat profile. i965 behavior is unchanged except that it doesn't expose TBOs in the Compat profile. Not sure how that affects the GL version override. Reviewed-by: Nicolai Hähnle Reviewed-by: Eric Anholt --- src/mesa/main/extensions_table.h | 6 +++--- src/mesa/main/get.c | 2 -- src/mesa/main/get_hash_params.py | 20 ++++++++++---------- src/mesa/main/tests/dispatch_sanity.cpp | 8 ++++---- src/mesa/main/texparam.c | 4 ++-- 5 files changed, 19 insertions(+), 21 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 8d8b6376dc7..5b66e7d30df 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -133,9 +133,9 @@ EXT(ARB_sync , ARB_sync EXT(ARB_tessellation_shader , ARB_tessellation_shader , x , GLC, x , x , 2009) EXT(ARB_texture_barrier , NV_texture_barrier , GLL, GLC, x , x , 2014) EXT(ARB_texture_border_clamp , ARB_texture_border_clamp , GLL, x , x , x , 2000) -EXT(ARB_texture_buffer_object , ARB_texture_buffer_object , x , GLC, x , x , 2008) -EXT(ARB_texture_buffer_object_rgb32 , ARB_texture_buffer_object_rgb32 , x , GLC, x , x , 2009) -EXT(ARB_texture_buffer_range , ARB_texture_buffer_range , x , GLC, x , x , 2012) +EXT(ARB_texture_buffer_object , ARB_texture_buffer_object , GLL, GLC, x , x , 2008) +EXT(ARB_texture_buffer_object_rgb32 , ARB_texture_buffer_object_rgb32 , GLL, GLC, x , x , 2009) +EXT(ARB_texture_buffer_range , ARB_texture_buffer_range , GLL, GLC, x , x , 2012) EXT(ARB_texture_compression , dummy_true , GLL, x , x , x , 2000) EXT(ARB_texture_compression_bptc , ARB_texture_compression_bptc , GLL, GLC, x , x , 2010) EXT(ARB_texture_compression_rgtc , ARB_texture_compression_rgtc , GLL, GLC, x , x , 2004) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index e68a93b10ee..ea8d932b182 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -309,8 +309,6 @@ static const int extra_GLSL_130_es3[] = { }; static const int extra_texture_buffer_object[] = { - EXTRA_API_GL_CORE, - EXTRA_VERSION_31, EXT(ARB_texture_buffer_object), EXTRA_END }; diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index acd5cd1f011..20ef6e4977a 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -442,6 +442,16 @@ descriptor=[ # Enums in OpenGL and ES 3.1 { "apis": ["GL", "GL_CORE", "GLES31"], "params": [ +# GL_ARB_texture_buffer_object / GL_OES_texture_buffer + [ "MAX_TEXTURE_BUFFER_SIZE_ARB", "CONTEXT_INT(Const.MaxTextureBufferSize), extra_texture_buffer_object" ], + [ "TEXTURE_BINDING_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_texture_buffer_object" ], + [ "TEXTURE_BUFFER_DATA_STORE_BINDING_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_BUFFER_INDEX, extra_texture_buffer_object" ], + [ "TEXTURE_BUFFER_FORMAT_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_texture_buffer_object" ], + [ "TEXTURE_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_texture_buffer_object" ], + +# GL_ARB_texture_buffer_range + [ "TEXTURE_BUFFER_OFFSET_ALIGNMENT", "CONTEXT_INT(Const.TextureBufferOffsetAlignment), extra_ARB_texture_buffer_range" ], + # GL_ARB_shader_image_load_store / GLES 3.1 [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), extra_ARB_shader_image_load_store" ], [ "MAX_VERTEX_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), extra_ARB_shader_image_load_store" ], @@ -602,16 +612,6 @@ descriptor=[ # GL_ARB_gpu_shader5 / GL_OES_geometry_shader [ "MAX_GEOMETRY_SHADER_INVOCATIONS", "CONST(MAX_GEOMETRY_SHADER_INVOCATIONS), extra_ARB_gpu_shader5_or_oes_geometry_shader" ], -# GL_ARB_texture_buffer_object / GL_OES_texture_buffer - [ "MAX_TEXTURE_BUFFER_SIZE_ARB", "CONTEXT_INT(Const.MaxTextureBufferSize), extra_texture_buffer_object" ], - [ "TEXTURE_BINDING_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_texture_buffer_object" ], - [ "TEXTURE_BUFFER_DATA_STORE_BINDING_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_BUFFER_INDEX, extra_texture_buffer_object" ], - [ "TEXTURE_BUFFER_FORMAT_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_texture_buffer_object" ], - [ "TEXTURE_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_texture_buffer_object" ], - -# GL_ARB_texture_buffer_range - [ "TEXTURE_BUFFER_OFFSET_ALIGNMENT", "CONTEXT_INT(Const.TextureBufferOffsetAlignment), extra_ARB_texture_buffer_range" ], - # GL_OES_primitive_bounding_box [ "PRIMITIVE_BOUNDING_BOX_ARB", "CONTEXT_FLOAT8(PrimitiveBoundingBox), extra_OES_primitive_bounding_box" ], diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 8c511805b51..d7183de0f1a 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -504,6 +504,10 @@ const struct function common_desktop_functions_possible[] = { { "glDrawArraysInstanced", 31, -1 }, { "glDrawElementsInstanced", 31, -1 }, { "glPrimitiveRestartIndex", 31, -1 }, + { "glTexBuffer", 31, -1 }, + + /* GL_ARB_texture_buffer_range */ + { "glTexBufferRange", 43, -1 }, /* GL_ARB_shader_objects */ { "glDeleteObjectARB", 31, -1 }, @@ -1501,9 +1505,6 @@ const struct function gl_compatibility_functions_possible[] = { }; const struct function gl_core_functions_possible[] = { - /* GL 3.1 */ - { "glTexBuffer", 31, -1 }, - /* GL 3.2 */ { "glFramebufferTexture", 32, -1 }, @@ -1808,7 +1809,6 @@ const struct function gl_core_functions_possible[] = { { "glGetProgramResourceLocation", 43, -1 }, { "glGetProgramResourceLocationIndex", 43, -1 }, // { "glShaderStorageBlockBinding", 43, -1 }, // XXX: Add to xml - { "glTexBufferRange", 43, -1 }, // { "glTextureBufferRangeEXT", 43, -1 }, // XXX: Add to xml { "glTexStorage2DMultisample", 43, -1 }, { "glTexStorage3DMultisample", 43, -1 }, diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 039b93349e4..4a0f61eda81 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1287,8 +1287,8 @@ _mesa_legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target * From the OpenGL 3.1 spec: * "target may also be TEXTURE_BUFFER, indicating the texture buffer." */ - return (ctx->API == API_OPENGL_CORE && ctx->Version >= 31) || - _mesa_has_OES_texture_buffer(ctx); + return (_mesa_is_desktop_gl(ctx) && ctx->Version >= 31) || + _mesa_has_OES_texture_buffer(ctx); case GL_TEXTURE_CUBE_MAP_ARRAY: return _mesa_has_texture_cube_map_array(ctx); } -- cgit v1.2.3