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, )
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),
# 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.
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;
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)
};
static const int extra_texture_buffer_object[] = {
- EXTRA_API_GL_CORE,
- EXTRA_VERSION_31,
EXT(ARB_texture_buffer_object),
EXTRA_END
};
# 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" ],
# 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" ],
{ "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 },
};
const struct function gl_core_functions_possible[] = {
- /* GL 3.1 */
- { "glTexBuffer", 31, -1 },
-
/* GL 3.2 */
{ "glFramebufferTexture", 32, -1 },
{ "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 },
* 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);
}
/* 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;
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;
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),
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 */
_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);
}