aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-10-19 22:22:15 +0200
committerMarek Olšák <[email protected]>2017-11-09 23:55:31 +0100
commit272fe9494232baab159d10901aecfe1786595b17 (patch)
treee0c74c9a1fdda143b1ea8cc4adb952e5379b34c2 /src/mesa/state_tracker
parentd4ebdc1a544351e24b81922f617401d292bf7f58 (diff)
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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_context.c2
-rw-r--r--src/mesa/state_tracker/st_extensions.c8
-rw-r--r--src/mesa/state_tracker/st_extensions.h3
-rw-r--r--src/mesa/state_tracker/st_manager.c2
4 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index e82090b7e45..8abf879ab98 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -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;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index d4b8dc91139..de3d1ef4e9b 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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),
diff --git a/src/mesa/state_tracker/st_extensions.h b/src/mesa/state_tracker/st_extensions.h
index 951185caa3b..7bf1aa8c8cb 100644
--- a/src/mesa/state_tracker/st_extensions.h
+++ b/src/mesa/state_tracker/st_extensions.h
@@ -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 */
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 953f7156c90..aedbc13f7d7 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -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);
}