st/dri: add a new driconf option disable_shader_bit_encoding for Unigine

Now Unigine Heaven 3.0 finally works with r600g.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Marek Olšák
2013-07-30 22:29:27 +02:00
parent 369c829152
commit 7568a89500
7 changed files with 21 additions and 2 deletions

View File

@@ -241,6 +241,7 @@ struct st_config_options
{ {
boolean disable_blend_func_extended; boolean disable_blend_func_extended;
boolean disable_glsl_line_continuations; boolean disable_glsl_line_continuations;
boolean disable_shader_bit_encoding;
boolean force_glsl_extensions_warn; boolean force_glsl_extensions_warn;
unsigned force_glsl_version; unsigned force_glsl_version;
boolean force_s3tc_enable; boolean force_s3tc_enable;

View File

@@ -46,6 +46,8 @@ static void dri_fill_st_options(struct st_config_options *options,
driQueryOptionb(optionCache, "disable_blend_func_extended"); driQueryOptionb(optionCache, "disable_blend_func_extended");
options->disable_glsl_line_continuations = options->disable_glsl_line_continuations =
driQueryOptionb(optionCache, "disable_glsl_line_continuations"); driQueryOptionb(optionCache, "disable_glsl_line_continuations");
options->disable_shader_bit_encoding =
driQueryOptionb(optionCache, "disable_shader_bit_encoding");
options->force_glsl_extensions_warn = options->force_glsl_extensions_warn =
driQueryOptionb(optionCache, "force_glsl_extensions_warn"); driQueryOptionb(optionCache, "force_glsl_extensions_warn");
options->force_glsl_version = options->force_glsl_version =

View File

@@ -63,6 +63,7 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false") DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false") DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false") DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
DRI_CONF_FORCE_GLSL_VERSION(0) DRI_CONF_FORCE_GLSL_VERSION(0)
DRI_CONF_SECTION_END DRI_CONF_SECTION_END
@@ -73,7 +74,7 @@ PUBLIC const char __driConfigOptions[] =
#define false 0 #define false 0
static const uint __driNConfigOptions = 12; static const uint __driNConfigOptions = 13;
static const __DRIconfig ** static const __DRIconfig **
dri_fill_in_modes(struct dri_screen *screen) dri_fill_in_modes(struct dri_screen *screen)

View File

@@ -545,6 +545,7 @@ OSMesaCreateContextExt(GLenum format, GLint depthBits, GLint stencilBits,
attribs.options.force_glsl_extensions_warn = FALSE; attribs.options.force_glsl_extensions_warn = FALSE;
attribs.options.disable_blend_func_extended = FALSE; attribs.options.disable_blend_func_extended = FALSE;
attribs.options.disable_glsl_line_continuations = FALSE; attribs.options.disable_glsl_line_continuations = FALSE;
attribs.options.disable_shader_bit_encoding = FALSE;
attribs.options.force_s3tc_enable = FALSE; attribs.options.force_s3tc_enable = FALSE;
attribs.options.force_glsl_version = 0; attribs.options.force_glsl_version = 0;

View File

@@ -18,6 +18,10 @@ Application bugs worked around in this file:
fails to compile with GLSL 1.10. fails to compile with GLSL 1.10.
Adding "#version 130" fixes this. Adding "#version 130" fixes this.
* Unigine Heaven 3.0 with ARB_shader_bit_encoding uses a "uint & int"
expression, which fails (and should fail) to compile with any GLSL version.
Disabling ARB_shader_bit_encoding fixes this.
TODO: document the other workarounds. TODO: document the other workarounds.
--> -->
@@ -40,12 +44,14 @@ TODO: document the other workarounds.
<option name="force_glsl_extensions_warn" value="true" /> <option name="force_glsl_extensions_warn" value="true" />
<option name="disable_blend_func_extended" value="true" /> <option name="disable_blend_func_extended" value="true" />
<option name="force_glsl_version" value="130" /> <option name="force_glsl_version" value="130" />
<option name="disable_shader_bit_encoding" value="true" />
</application> </application>
<application name="Unigine Heaven (64-bit)" executable="heaven_x64"> <application name="Unigine Heaven (64-bit)" executable="heaven_x64">
<option name="force_glsl_extensions_warn" value="true" /> <option name="force_glsl_extensions_warn" value="true" />
<option name="disable_blend_func_extended" value="true" /> <option name="disable_blend_func_extended" value="true" />
<option name="force_glsl_version" value="130" /> <option name="force_glsl_version" value="130" />
<option name="disable_shader_bit_encoding" value="true" />
</application> </application>
<application name="Unigine OilRush (32-bit)" executable="OilRush_x86"> <application name="Unigine OilRush (32-bit)" executable="OilRush_x86">

View File

@@ -95,6 +95,11 @@ DRI_CONF_OPT_BEGIN_B(disable_glsl_line_continuations, def) \
DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \ DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \
DRI_CONF_OPT_END DRI_CONF_OPT_END
#define DRI_CONF_DISABLE_SHADER_BIT_ENCODING(def) \
DRI_CONF_OPT_BEGIN_B(disable_shader_bit_encoding, def) \
DRI_CONF_DESC(en,gettext("Disable GL_ARB_shader_bit_encoding")) \
DRI_CONF_OPT_END
#define DRI_CONF_FORCE_GLSL_VERSION(def) \ #define DRI_CONF_FORCE_GLSL_VERSION(def) \
DRI_CONF_OPT_BEGIN_V(force_glsl_version, int, def, "0:999") \ DRI_CONF_OPT_BEGIN_V(force_glsl_version, int, def, "0:999") \
DRI_CONF_DESC(en,gettext("Force a default GLSL version for shaders that lack an explicit #version line")) \ DRI_CONF_DESC(en,gettext("Force a default GLSL version for shaders that lack an explicit #version line")) \

View File

@@ -609,10 +609,13 @@ void st_init_extensions(struct st_context *st)
/* Extensions that either depend on GLSL 1.30 or are a subset thereof. */ /* Extensions that either depend on GLSL 1.30 or are a subset thereof. */
ctx->Extensions.ARB_conservative_depth = GL_TRUE; ctx->Extensions.ARB_conservative_depth = GL_TRUE;
ctx->Extensions.ARB_shader_bit_encoding = GL_TRUE;
ctx->Extensions.ARB_shading_language_packing = GL_TRUE; ctx->Extensions.ARB_shading_language_packing = GL_TRUE;
ctx->Extensions.OES_depth_texture_cube_map = GL_TRUE; ctx->Extensions.OES_depth_texture_cube_map = GL_TRUE;
ctx->Extensions.ARB_shading_language_420pack = GL_TRUE; ctx->Extensions.ARB_shading_language_420pack = GL_TRUE;
if (!st->options.disable_shader_bit_encoding) {
ctx->Extensions.ARB_shader_bit_encoding = GL_TRUE;
}
} else { } else {
/* Optional integer support for GLSL 1.2. */ /* Optional integer support for GLSL 1.2. */
if (screen->get_shader_param(screen, PIPE_SHADER_VERTEX, if (screen->get_shader_param(screen, PIPE_SHADER_VERTEX,