[Mesa-dev] [PATCH 10/16] mesa: don't always enable OES_standard_derivatives
Marek Olšák
maraeo at gmail.com
Sun Oct 28 07:24:57 PDT 2012
For Intel, expose it only if gen >= 4.
For Gallium, expose it only if PIPE_CAP_SM3 is advertised.
---
src/glsl/standalone_scaffolding.cpp | 1 +
src/mesa/drivers/dri/intel/intel_extensions.c | 1 +
src/mesa/main/extensions.c | 3 +--
src/mesa/state_tracker/st_extensions.c | 2 ++
4 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
index e16390b..e1e028e 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -79,6 +79,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
ctx->Extensions.NV_texture_rectangle = true;
ctx->Extensions.OES_EGL_image_external = true;
ctx->Extensions.ARB_shader_bit_encoding = true;
+ ctx->Extensions.OES_standard_derivatives = true;
ctx->Const.GLSLVersion = 120;
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index ec99c3e..702e40f 100755
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -158,6 +158,7 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.ATI_envmap_bumpmap = true;
ctx->Extensions.MESA_texture_array = true;
ctx->Extensions.NV_conditional_render = true;
+ ctx->Extensions.OES_standard_derivatives = true;
}
if (intel->gen >= 3) {
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 199c37a..b6a39c1 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -356,8 +356,6 @@ name_to_offset(const char* name)
* XXX: Should these defaults also apply to GLES?
*/
static const size_t default_extensions[] = {
- o(OES_standard_derivatives),
-
/* Vendor Extensions */
o(APPLE_packed_pixels),
o(IBM_multimode_draw_arrays),
@@ -463,6 +461,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
/*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/
ctx->Extensions.NV_fragment_program_option = GL_TRUE;
ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
+ ctx->Extensions.OES_standard_derivatives = GL_TRUE;
_mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
if (ctx->Mesa_DXTn) {
ctx->Extensions.ANGLE_texture_compression_dxt = GL_TRUE;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index e33ac0f..9a7b811 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -377,6 +377,8 @@ void st_init_extensions(struct st_context *st)
/* GL_NV_point_sprite is not supported by gallium because we don't
* support the GL_POINT_SPRITE_R_MODE_NV option. */
{ o(MESA_texture_array), PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS },
+
+ { o(OES_standard_derivatives), PIPE_CAP_SM3 }
};
/* Required: render target and sampler support */
--
1.7.9.5
More information about the mesa-dev
mailing list