*/
unsigned local_size:3;
+ /** \name Layout qualifiers for ARB_compute_variable_group_size. */
+ /** \{ */
+ unsigned local_size_variable:1;
+ /** \} */
+
/** \name Layout and memory qualifiers for ARB_shader_image_load_store. */
/** \{ */
unsigned early_fragment_tests:1;
state->in_qualifier->flags.q.local_size == 0;
valid_in_mask.flags.q.local_size = 7;
+ valid_in_mask.flags.q.local_size_variable = 1;
break;
default:
_mesa_glsl_error(loc, state,
this->point_mode = q.point_mode;
}
+ if (q.flags.q.local_size_variable) {
+ state->cs_input_local_size_variable_specified = true;
+ }
+
if (create_node) {
if (create_gs_ast) {
node = new(mem_ctx) ast_gs_input_layout(*loc, q.prim_type);
"%s '%s':"
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
- "%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
message, name,
bad.flags.q.invariant ? " invariant" : "",
bad.flags.q.precise ? " precise" : "",
bad.flags.q.prim_type ? " prim_type" : "",
bad.flags.q.max_vertices ? " max_vertices" : "",
bad.flags.q.local_size ? " local_size" : "",
+ bad.flags.q.local_size_variable ? " local_size_variable" : "",
bad.flags.q.early_fragment_tests ? " early_fragment_tests" : "",
bad.flags.q.explicit_image_format ? " image_format" : "",
bad.flags.q.coherent ? " coherent" : "",
}
}
+ /* Layout qualifiers for ARB_compute_variable_group_size. */
+ if (!$$.flags.i) {
+ if (match_layout_qualifier($1, "local_size_variable", state) == 0) {
+ $$.flags.q.local_size_variable = 1;
+ }
+
+ if ($$.flags.i && !state->ARB_compute_variable_group_size_enable) {
+ _mesa_glsl_error(& @1, state,
+ "qualifier `local_size_variable` requires "
+ "ARB_compute_variable_group_size");
+ }
+ }
+
if (!$$.flags.i) {
_mesa_glsl_error(& @1, state, "unrecognized layout identifier "
"`%s'", $1);
sizeof(this->atomic_counter_offsets));
this->allow_extension_directive_midshader =
ctx->Const.AllowGLSLExtensionDirectiveMidShader;
+
+ this->cs_input_local_size_variable_specified = false;
}
/**
if (shader->Stage != MESA_SHADER_COMPUTE) {
/* Should have been prevented by the parser. */
assert(!state->cs_input_local_size_specified);
+ assert(!state->cs_input_local_size_variable_specified);
}
if (shader->Stage != MESA_SHADER_FRAGMENT) {
for (int i = 0; i < 3; i++)
shader->info.Comp.LocalSize[i] = 0;
}
+
+ shader->info.Comp.LocalSizeVariable =
+ state->cs_input_local_size_variable_specified;
break;
case MESA_SHADER_FRAGMENT:
*/
unsigned cs_input_local_size[3];
+ /**
+ * True if a compute shader input local variable size was specified using
+ * a layout directive as specified by ARB_compute_variable_group_size.
+ */
+ bool cs_input_local_size_variable_specified;
+
/**
* Output layout qualifiers from GLSL 1.50 (geometry shader controls),
* and GLSL 4.00 (tessellation control shader).