summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_extensions.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-04-01 14:59:38 -0700
committerJason Ekstrand <[email protected]>2016-04-01 15:16:21 -0700
commit95106f6bfbbb87b702e4bbba98e2eaea71924cd9 (patch)
tree9650d284ec7f7417b2bcf8a906dfa43dfc547cf7 /src/mesa/state_tracker/st_extensions.c
parentcf2257069cbde19fd177a02c079206914aac5d14 (diff)
parent14c46954c910efb1db94a068a866c7259deaa9d9 (diff)
Merge remote-tracking branch 'public/master' into vulkan
Diffstat (limited to 'src/mesa/state_tracker/st_extensions.c')
-rw-r--r--src/mesa/state_tracker/st_extensions.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 2fdaba073a2..8748ab5c876 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -552,7 +552,6 @@ void st_init_extensions(struct pipe_screen *screen,
boolean has_lib_dxtc)
{
unsigned i;
- int glsl_feature_level;
GLboolean *extension_table = (GLboolean *) extensions;
static const struct st_extension_cap_mapping cap_mapping[] = {
@@ -811,6 +810,7 @@ void st_init_extensions(struct pipe_screen *screen,
extensions->EXT_texture_env_dot3 = GL_TRUE;
extensions->EXT_vertex_array_bgra = GL_TRUE;
+ extensions->ATI_fragment_shader = GL_TRUE;
extensions->ATI_texture_env_combine3 = GL_TRUE;
extensions->MESA_pack_invert = GL_TRUE;
@@ -844,12 +844,8 @@ void st_init_extensions(struct pipe_screen *screen,
ARRAY_SIZE(vertex_mapping), PIPE_BUFFER,
PIPE_BIND_VERTEX_BUFFER);
- /* Figure out GLSL support. */
- glsl_feature_level = screen->get_param(screen, PIPE_CAP_GLSL_FEATURE_LEVEL);
-
- consts->GLSLVersion = glsl_feature_level;
- if (glsl_feature_level >= 410)
- consts->GLSLVersion = 410;
+ /* Figure out GLSL support and set GLSLVersion to it. */
+ consts->GLSLVersion = screen->get_param(screen, PIPE_CAP_GLSL_FEATURE_LEVEL);
_mesa_override_glsl_version(consts);
@@ -858,9 +854,9 @@ void st_init_extensions(struct pipe_screen *screen,
consts->ForceGLSLVersion = options->force_glsl_version;
}
- if (glsl_feature_level >= 400)
+ if (consts->GLSLVersion >= 400)
extensions->ARB_gpu_shader5 = GL_TRUE;
- if (glsl_feature_level >= 410)
+ if (consts->GLSLVersion >= 410)
extensions->ARB_shader_precision = GL_TRUE;
/* This extension needs full OpenGL 3.2, but we don't know if that's
@@ -925,6 +921,23 @@ void st_init_extensions(struct pipe_screen *screen,
extensions->ARB_sync = GL_TRUE;
}
+ /* Needs PIPE_CAP_SAMPLE_SHADING + all the sample-related bits of
+ * ARB_gpu_shader5. This enables all the per-sample shading ES extensions.
+ */
+ extensions->OES_sample_variables = extensions->ARB_sample_shading &&
+ extensions->ARB_gpu_shader5;
+
+ /* If we don't have native ETC2 support, we don't keep track of the
+ * original ETC2 data. This is necessary to be able to copy images between
+ * compatible view classes.
+ */
+ if (extensions->ARB_copy_image && screen->is_format_supported(
+ screen, PIPE_FORMAT_ETC2_RGB8,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ extensions->OES_copy_image = GL_TRUE;
+ }
+
/* Maximum sample count. */
{
enum pipe_format color_formats[] = {
@@ -1020,6 +1033,12 @@ void st_init_extensions(struct pipe_screen *screen,
PIPE_BIND_SAMPLER_VIEW);
}
+ extensions->OES_texture_buffer =
+ extensions->ARB_texture_buffer_object &&
+ extensions->ARB_texture_buffer_range &&
+ extensions->ARB_texture_buffer_object_rgb32 &&
+ extensions->ARB_shader_image_load_store;
+
/* Unpacking a varying in the fragment shader costs 1 texture indirection.
* If the number of available texture indirections is very limited, then we
* prefer to disable varying packing rather than run the risk of varying
@@ -1036,7 +1055,7 @@ void st_init_extensions(struct pipe_screen *screen,
consts->MaxViewports = screen->get_param(screen, PIPE_CAP_MAX_VIEWPORTS);
if (consts->MaxViewports >= 16) {
- if (glsl_feature_level >= 400) {
+ if (consts->GLSLVersion >= 400) {
consts->ViewportBounds.Min = -32768.0;
consts->ViewportBounds.Max = 32767.0;
} else {