}
apply_image_qualifier_to_variable(qual, var, state, loc);
+
+ /* From section 4.4.1.3 of the GLSL 4.50 specification (Fragment Shader
+ * Inputs):
+ *
+ * "Fragment shaders also allow the following layout qualifier on in only
+ * (not with variable declarations)
+ * layout-qualifier-id
+ * early_fragment_tests
+ * [...]"
+ */
+ if (qual->flags.q.early_fragment_tests) {
+ _mesa_glsl_error(loc, state, "early_fragment_tests layout qualifier only "
+ "valid in fragment shader input layout declaration.");
+ }
}
/**
valid_in_mask.flags.q.invocations = 1;
break;
case MESA_SHADER_FRAGMENT:
- if (q.flags.q.early_fragment_tests) {
- state->early_fragment_tests = true;
- } else {
- _mesa_glsl_error(loc, state, "invalid input layout qualifier");
- }
+ valid_in_mask.flags.q.early_fragment_tests = 1;
break;
case MESA_SHADER_COMPUTE:
create_cs_ast |=
this->invocations = q.invocations;
}
+ if (q.flags.q.early_fragment_tests) {
+ state->early_fragment_tests = true;
+ }
+
if (create_gs_ast) {
node = new(mem_ctx) ast_gs_input_layout(*loc, q.prim_type);
} else if (create_cs_ast) {
if (!$$.flags.i &&
match_layout_qualifier($1, "early_fragment_tests", state) == 0) {
+ /* From section 4.4.1.3 of the GLSL 4.50 specification
+ * (Fragment Shader Inputs):
+ *
+ * "Fragment shaders also allow the following layout
+ * qualifier on in only (not with variable declarations)
+ * layout-qualifier-id
+ * early_fragment_tests
+ * [...]"
+ */
+ if (state->stage != MESA_SHADER_FRAGMENT) {
+ _mesa_glsl_error(& @1, state,
+ "early_fragment_tests layout qualifier only "
+ "valid in fragment shaders");
+ }
+
$$.flags.q.early_fragment_tests = 1;
}
}