mesa: enable ARB_texture_buffer_* extensions in the Compatibility profile

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 <nicolai.haehnle@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Marek Olšák 2017-10-19 22:22:15 +02:00
parent d4ebdc1a54
commit 272fe94942
11 changed files with 40 additions and 35 deletions

View File

@ -35,7 +35,7 @@ class exec_info():
Each of the attributes that is not None must have a valid value. The
valid ranges are:
compatiblity: [10, 30]
compatibility: [10, )
core: [31, )
es1: [10, 11]
es2: [20, )
@ -66,9 +66,8 @@ class exec_info():
self.es2 = es2
functions = {
# OpenGL 3.1 / GL_ARB_texture_buffer_object. Mesa only exposes this
# extension with core profile.
"TexBuffer": exec_info(core=31, es2=31),
# OpenGL 3.1 / GL_ARB_texture_buffer_object.
"TexBuffer": exec_info(compatibility=20, core=31, es2=31),
# OpenGL 3.2 / GL_OES_geometry_shader.
"FramebufferTexture": exec_info(core=32, es2=31),
@ -144,9 +143,8 @@ functions = {
# GetFloati_v also GL_ARB_shader_atomic_counters
# GetDoublei_v also GL_ARB_shader_atomic_counters
# OpenGL 4.3 / GL_ARB_texture_buffer_range. Mesa can expose the extension
# with OpenGL 3.1.
"TexBufferRange": exec_info(core=31, es2=31),
# OpenGL 4.3 / GL_ARB_texture_buffer_range.
"TexBufferRange": exec_info(compatibility=20, core=31, es2=31),
# OpenGL 4.3 / GL_ARB_framebuffer_no_attachments. Mesa can expose the
# extension with OpenGL 3.0.

View File

@ -178,9 +178,11 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.ARB_pipeline_statistics_query = true;
ctx->Extensions.ARB_sample_shading = true;
ctx->Extensions.ARB_shading_language_420pack = true;
ctx->Extensions.ARB_texture_buffer_object = true;
ctx->Extensions.ARB_texture_buffer_object_rgb32 = true;
ctx->Extensions.ARB_texture_buffer_range = true;
if (ctx->API != API_OPENGL_COMPAT) {
ctx->Extensions.ARB_texture_buffer_object = true;
ctx->Extensions.ARB_texture_buffer_object_rgb32 = true;
ctx->Extensions.ARB_texture_buffer_range = true;
}
ctx->Extensions.ARB_texture_cube_map_array = true;
ctx->Extensions.ARB_texture_gather = true;
ctx->Extensions.ARB_texture_multisample = true;

View File

@ -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)

View File

@ -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
};

View File

@ -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" ],

View File

@ -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 },

View File

@ -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);
}

View File

@ -412,7 +412,7 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
/* GL limits and extensions */
st_init_limits(pipe->screen, &ctx->Const, &ctx->Extensions);
st_init_extensions(pipe->screen, &ctx->Const,
&ctx->Extensions, &st->options);
&ctx->Extensions, &st->options, ctx->API);
if (st_have_perfmon(st)) {
ctx->Extensions.AMD_performance_monitor = GL_TRUE;

View File

@ -603,7 +603,8 @@ get_max_samples_for_formats(struct pipe_screen *screen,
void st_init_extensions(struct pipe_screen *screen,
struct gl_constants *consts,
struct gl_extensions *extensions,
struct st_config_options *options)
struct st_config_options *options,
gl_api api)
{
unsigned i;
GLboolean *extension_table = (GLboolean *) extensions;
@ -1120,6 +1121,11 @@ void st_init_extensions(struct pipe_screen *screen,
consts->MinMapBufferAlignment =
screen->get_param(screen, PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT);
/* The OpenGL Compatibility profile requires arbitrary buffer swizzling. */
if (api == API_OPENGL_COMPAT &&
screen->get_param(screen, PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY))
extensions->ARB_texture_buffer_object = GL_FALSE;
if (extensions->ARB_texture_buffer_object) {
consts->MaxTextureBufferSize =
_min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE),

View File

@ -40,7 +40,8 @@ extern void st_init_limits(struct pipe_screen *screen,
extern void st_init_extensions(struct pipe_screen *screen,
struct gl_constants *consts,
struct gl_extensions *extensions,
struct st_config_options *options);
struct st_config_options *options,
gl_api api);
#endif /* ST_EXTENSIONS_H */

View File

@ -1177,7 +1177,7 @@ get_version(struct pipe_screen *screen,
_mesa_init_extensions(&extensions);
st_init_limits(screen, &consts, &extensions);
st_init_extensions(screen, &consts, &extensions, options);
st_init_extensions(screen, &consts, &extensions, options, api);
return _mesa_get_version(&extensions, &consts, api);
}