[Mesa-dev] [PATCH 12/16] driconf: start sharing disable_shader_bit_encoding

Martin Peres martin.peres at linux.intel.com
Fri Jun 5 06:04:06 PDT 2015


This has the side effect of enabling this option for all the non-gallium
drivers.

Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
---
 src/gallium/include/state_tracker/st_api.h  | 1 -
 src/gallium/state_trackers/dri/dri_screen.c | 3 ---
 src/gallium/state_trackers/osmesa/osmesa.c  | 1 -
 src/mesa/drivers/dri/common/xmlpool.h       | 3 ++-
 src/mesa/drivers/dri/i965/brw_context.c     | 2 --
 src/mesa/main/extensions.c                  | 4 ++++
 src/mesa/main/shared_options.c              | 3 +++
 src/mesa/main/shared_options.h              | 6 ++++++
 src/mesa/state_tracker/st_extensions.c      | 5 +----
 9 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index bf4d2c9..8cd0837 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -244,7 +244,6 @@ struct st_config_options
    /** The screen's effective configuration options */
    struct shared_options shared_options;
 
-   boolean disable_shader_bit_encoding;
    boolean force_s3tc_enable;
 };
 
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index a94fe08..7b5210b 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -70,7 +70,6 @@ const __DRIconfigOptionsExtension gallium_config_options = {
 
       DRI_CONF_SECTION_DEBUG
          DRI_CONF_SECTION_DEBUG_SHARED
-         DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
       DRI_CONF_SECTION_END
 
       DRI_CONF_SECTION_MISCELLANEOUS
@@ -88,8 +87,6 @@ dri_fill_st_options(struct st_config_options *options,
 {
    _mesa_shared_options_fill(optionCache, &options->shared_options);
 
-   options->disable_shader_bit_encoding =
-      driQueryOptionb(optionCache, "disable_shader_bit_encoding");
    options->force_s3tc_enable =
       driQueryOptionb(optionCache, "force_s3tc_enable");
 }
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index d1a04ed..959ade8 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -585,7 +585,6 @@ OSMesaCreateContextExt(GLenum format, GLint depthBits, GLint stencilBits,
    attribs.major = 2;
    attribs.minor = 1;
    attribs.flags = 0;  /* ST_CONTEXT_FLAG_x */
-   attribs.options.disable_shader_bit_encoding = FALSE;
    attribs.options.force_s3tc_enable = FALSE;
    _mesa_shared_options_fill_defaults(&attribs.options.shared_options);
 
diff --git a/src/mesa/drivers/dri/common/xmlpool.h b/src/mesa/drivers/dri/common/xmlpool.h
index b6ddaa6..7503060 100644
--- a/src/mesa/drivers/dri/common/xmlpool.h
+++ b/src/mesa/drivers/dri/common/xmlpool.h
@@ -114,7 +114,8 @@
    DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false") \
    DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false") \
    DRI_CONF_EXTENSION_OVERRIDE() \
-   DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
+   DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false") \
+   DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
 
 #define DRI_CONF_SECTION_MISC_SHARED \
    "<!-- No shared msic options yet -->\n"
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 8bd74e2..36a6fe2 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -645,8 +645,6 @@ brw_adjust_cs_context_constants(struct brw_context *brw)
 static void
 brw_process_driconf_options(struct brw_context *brw)
 {
-   struct gl_context *ctx = &brw->ctx;
-
    driOptionCache *options = &brw->optionCache;
    driParseConfigFiles(options, &brw->intelScreen->optionCache,
                        brw->driContext->driScreenPriv->myNum, "i965");
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index ef4bbbf..9138a73 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -629,6 +629,10 @@ _mesa_one_time_init_extension_overrides( struct gl_context *ctx )
       set_extension(&_mesa_extension_override_disables,
                     "ARB_blend_func_extended", 0);
    }
+   if (ctx->Const.options.DisableShaderBitEncoding) {
+      set_extension(&_mesa_extension_override_disables,
+                    "ARB_shader_bit_encoding", 0);
+   }
 
    /* extra_exts: List of unrecognized extensions. */
    extra_extensions = calloc(ALIGN(strlen(env_const) + 2, 4), sizeof(char));
diff --git a/src/mesa/main/shared_options.c b/src/mesa/main/shared_options.c
index 322a971..7a5fe1d 100644
--- a/src/mesa/main/shared_options.c
+++ b/src/mesa/main/shared_options.c
@@ -38,6 +38,9 @@ _mesa_shared_options_fill(struct driOptionCache *optionCache,
    sharedOptions->DisableGLSLLineContinuations =
       driQueryOptionb(optionCache, "disable_glsl_line_continuations");
 
+   sharedOptions->DisableShaderBitEncoding =
+      driQueryOptionb(optionCache, "disable_shader_bit_encoding");
+
    sharedOptions->ExtensionOverride =
       driQueryOptionstr(optionCache, "extension_override");
 
diff --git a/src/mesa/main/shared_options.h b/src/mesa/main/shared_options.h
index 1a28a68..33c4dea 100644
--- a/src/mesa/main/shared_options.h
+++ b/src/mesa/main/shared_options.h
@@ -65,6 +65,11 @@ struct shared_options
    GLboolean DisableGLSLLineContinuations;
 
    /**
+    * Force disable ARB_shader_bit_encoding (superseeded by ExtensionOverride).
+    */
+   GLboolean DisableShaderBitEncoding;
+
+   /**
     * Allow enabling/disabling a list of GL extension.
     */
    const GLchar *ExtensionOverride;
@@ -96,6 +101,7 @@ _mesa_shared_options_fill_defaults(struct shared_options *sharedOptions)
    sharedOptions->AllowGLSLExtensionDirectiveMidShader = GL_FALSE;
    sharedOptions->DisableBlendFuncExtended = GL_FALSE;
    sharedOptions->DisableGLSLLineContinuations = GL_FALSE;
+   sharedOptions->DisableShaderBitEncoding = GL_FALSE;
    sharedOptions->ExtensionOverride = NULL;
    sharedOptions->ForceGLSLExtensionsWarn = GL_FALSE;
    sharedOptions->ForceGLSLVersion = 0;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 758d6fe..170d197 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -689,10 +689,7 @@ void st_init_extensions(struct pipe_screen *screen,
       extensions->OES_depth_texture_cube_map = GL_TRUE;
       extensions->ARB_shading_language_420pack = GL_TRUE;
       extensions->ARB_texture_query_levels = GL_TRUE;
-
-      if (!options->disable_shader_bit_encoding) {
-         extensions->ARB_shader_bit_encoding = GL_TRUE;
-      }
+      extensions->ARB_shader_bit_encoding = GL_TRUE;
 
       extensions->EXT_shader_integer_mix = GL_TRUE;
    } else {
-- 
2.4.2



More information about the mesa-dev mailing list