glsl,driconf: add allow_glsl_120_subset_in_110 for SPECviewperf13
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5459>
This commit is contained in:
@@ -2110,8 +2110,8 @@ ast_function_expression::hir(exec_list *instructions,
|
||||
}
|
||||
|
||||
if (constructor_type->is_array()) {
|
||||
if (!state->check_version(120, 300, &loc,
|
||||
"array constructors forbidden")) {
|
||||
if (!state->check_version(state->allow_glsl_120_subset_in_110 ? 110 : 120,
|
||||
300, &loc, "array constructors forbidden")) {
|
||||
return ir_rvalue::error_value(ctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -962,7 +962,8 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
|
||||
lhs_var->name);
|
||||
error_emitted = true;
|
||||
} else if (lhs->type->is_array() &&
|
||||
!state->check_version(120, 300, &lhs_loc,
|
||||
!state->check_version(state->allow_glsl_120_subset_in_110 ? 110 : 120,
|
||||
300, &lhs_loc,
|
||||
"whole array assignment forbidden")) {
|
||||
/* From page 32 (page 38 of the PDF) of the GLSL 1.10 spec:
|
||||
*
|
||||
|
||||
@@ -317,6 +317,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
|
||||
sizeof(this->atomic_counter_offsets));
|
||||
this->allow_extension_directive_midshader =
|
||||
ctx->Const.AllowGLSLExtensionDirectiveMidShader;
|
||||
this->allow_glsl_120_subset_in_110 =
|
||||
ctx->Const.AllowGLSL120SubsetIn110;
|
||||
this->allow_builtin_variable_redeclaration =
|
||||
ctx->Const.AllowGLSLBuiltinVariableRedeclaration;
|
||||
this->allow_layout_qualifier_on_function_parameter =
|
||||
|
||||
@@ -356,7 +356,8 @@ struct _mesa_glsl_parse_state {
|
||||
|
||||
bool has_implicit_conversions() const
|
||||
{
|
||||
return EXT_shader_implicit_conversions_enable || is_version(120, 0);
|
||||
return EXT_shader_implicit_conversions_enable ||
|
||||
is_version(allow_glsl_120_subset_in_110 ? 110 : 120, 0);
|
||||
}
|
||||
|
||||
bool has_implicit_int_to_uint_conversion() const
|
||||
@@ -938,6 +939,7 @@ struct _mesa_glsl_parse_state {
|
||||
bool layer_viewport_relative;
|
||||
|
||||
bool allow_extension_directive_midshader;
|
||||
bool allow_glsl_120_subset_in_110;
|
||||
bool allow_builtin_variable_redeclaration;
|
||||
bool allow_layout_qualifier_on_function_parameter;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_DISABLE_ARB_GPU_SHADER5("false")
|
||||
DRI_CONF_FORCE_GLSL_VERSION(0)
|
||||
DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
|
||||
DRI_CONF_ALLOW_GLSL_120_SUBSET_IN_110("false")
|
||||
DRI_CONF_ALLOW_GLSL_BUILTIN_CONST_EXPRESSION("false")
|
||||
DRI_CONF_ALLOW_GLSL_RELAXED_ES("false")
|
||||
DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")
|
||||
|
||||
@@ -75,6 +75,8 @@ dri_fill_st_options(struct dri_screen *screen)
|
||||
driQueryOptioni(optionCache, "force_glsl_version");
|
||||
options->allow_glsl_extension_directive_midshader =
|
||||
driQueryOptionb(optionCache, "allow_glsl_extension_directive_midshader");
|
||||
options->allow_glsl_120_subset_in_110 =
|
||||
driQueryOptionb(optionCache, "allow_glsl_120_subset_in_110");
|
||||
options->allow_glsl_builtin_const_expression =
|
||||
driQueryOptionb(optionCache, "allow_glsl_builtin_const_expression");
|
||||
options->allow_glsl_relaxed_es =
|
||||
|
||||
@@ -221,6 +221,7 @@ struct st_config_options
|
||||
bool force_glsl_extensions_warn;
|
||||
unsigned force_glsl_version;
|
||||
bool allow_glsl_extension_directive_midshader;
|
||||
bool allow_glsl_120_subset_in_110;
|
||||
bool allow_glsl_builtin_const_expression;
|
||||
bool allow_glsl_relaxed_es;
|
||||
bool allow_glsl_builtin_variable_redeclaration;
|
||||
|
||||
@@ -3829,6 +3829,11 @@ struct gl_constants
|
||||
*/
|
||||
GLboolean AllowGLSLExtensionDirectiveMidShader;
|
||||
|
||||
/**
|
||||
* Allow a subset of GLSL 1.20 in GLSL 1.10 as needed by SPECviewperf13.
|
||||
*/
|
||||
GLboolean AllowGLSL120SubsetIn110;
|
||||
|
||||
/**
|
||||
* Allow builtins as part of constant expressions. This was not allowed
|
||||
* until GLSL 1.20 this allows it everywhere.
|
||||
|
||||
@@ -1402,6 +1402,9 @@ void st_init_extensions(struct pipe_screen *screen,
|
||||
if (options->allow_glsl_extension_directive_midshader)
|
||||
consts->AllowGLSLExtensionDirectiveMidShader = GL_TRUE;
|
||||
|
||||
if (options->allow_glsl_120_subset_in_110)
|
||||
consts->AllowGLSL120SubsetIn110 = GL_TRUE;
|
||||
|
||||
if (options->allow_glsl_builtin_const_expression)
|
||||
consts->AllowGLSLBuiltinConstantExpression = GL_TRUE;
|
||||
|
||||
|
||||
@@ -162,6 +162,11 @@ DRI_CONF_OPT_BEGIN_B(allow_glsl_extension_directive_midshader, def) \
|
||||
DRI_CONF_DESC("Allow GLSL #extension directives in the middle of shaders") \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_ALLOW_GLSL_120_SUBSET_IN_110(def) \
|
||||
DRI_CONF_OPT_BEGIN_B(allow_glsl_120_subset_in_110, def) \
|
||||
DRI_CONF_DESC("Allow a subset of GLSL 1.20 in GLSL 1.10 as needed by SPECviewperf13") \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_ALLOW_GLSL_BUILTIN_CONST_EXPRESSION(def) \
|
||||
DRI_CONF_OPT_BEGIN_B(allow_glsl_builtin_const_expression, def) \
|
||||
DRI_CONF_DESC("Allow builtins as part of constant expressions") \
|
||||
|
||||
Reference in New Issue
Block a user