st/nine: Control shader constant inlining with drirc
Until we use async shader compilation for constant inlining, don't enable it unless user asks for it. Signed-off-by: Axel Davy <davyaxel0@gmail.com>
This commit is contained in:
@@ -43,6 +43,7 @@ struct d3dadapter9_context
|
||||
BOOL tearfree_discard;
|
||||
int csmt_force;
|
||||
BOOL dynamic_texture_workaround;
|
||||
BOOL shader_inline_constants;
|
||||
|
||||
void (*destroy)( struct d3dadapter9_context *ctx );
|
||||
};
|
||||
|
||||
@@ -491,9 +491,10 @@ NineDevice9_ctor( struct NineDevice9 *This,
|
||||
This->driver_caps.ps_integer = pScreen->get_shader_param(pScreen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_INTEGERS);
|
||||
This->driver_caps.offset_units_unscaled = GET_PCAP(POLYGON_OFFSET_UNITS_UNSCALED);
|
||||
|
||||
This->context.inline_constants = pCTX->shader_inline_constants;
|
||||
/* Code would be needed when integers are not available to correctly
|
||||
* handle the conversion of integer constants */
|
||||
This->context.inline_constants = This->driver_caps.vs_integer && This->driver_caps.ps_integer;
|
||||
This->context.inline_constants &= This->driver_caps.vs_integer && This->driver_caps.ps_integer;
|
||||
|
||||
nine_ff_init(This); /* initialize fixed function code */
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ DRI_CONF_BEGIN
|
||||
DRI_CONF_NINE_TEARFREEDISCARD("false")
|
||||
DRI_CONF_NINE_CSMT(-1)
|
||||
DRI_CONF_NINE_DYNAMICTEXTUREWORKAROUND("false")
|
||||
DRI_CONF_NINE_SHADERINLINECONSTANTS("false")
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_END;
|
||||
|
||||
@@ -304,6 +305,11 @@ drm_create_adapter( int fd,
|
||||
else
|
||||
ctx->base.dynamic_texture_workaround = FALSE;
|
||||
|
||||
if (driCheckOption(&userInitOptions, "shader_inline_constants", DRI_BOOL))
|
||||
ctx->base.shader_inline_constants = driQueryOptionb(&userInitOptions, "shader_inline_constants");
|
||||
else
|
||||
ctx->base.shader_inline_constants = FALSE;
|
||||
|
||||
driDestroyOptionCache(&userInitOptions);
|
||||
driDestroyOptionInfo(&defaultInitOptions);
|
||||
|
||||
|
||||
@@ -329,6 +329,11 @@ DRI_CONF_OPT_BEGIN_B(dynamic_texture_workaround, def) \
|
||||
DRI_CONF_DESC(en,gettext("If set to true, use a ram intermediate buffer for dynamic textures. Increases ram usage, which can cause out of memory issues, but can fix glitches for some games.")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_NINE_SHADERINLINECONSTANTS(def) \
|
||||
DRI_CONF_OPT_BEGIN_B(shader_inline_constants, def) \
|
||||
DRI_CONF_DESC(en,gettext("If set to true, recompile shaders with integer or boolean constants when the values are known. Can cause stutter, but can increase slightly performance.")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
/**
|
||||
* \brief radeonsi specific configuration options
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user