}
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);
}
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:
*
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 =
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
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;
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")
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 =
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;
*/
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.
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;
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") \