&& !state->has_explicit_attrib_location()
&& !state->has_separate_shader_objects()
&& !state->ARB_fragment_coord_conventions_enable) {
- if (this->type->qualifier.flags.q.out) {
+ /* GL_EXT_gpu_shader4 only allows "varying out" on fragment shader
+ * outputs. (the varying flag is not set by the parser)
+ */
+ if (this->type->qualifier.flags.q.out &&
+ (!state->EXT_gpu_shader4_enable ||
+ state->stage != MESA_SHADER_FRAGMENT)) {
_mesa_glsl_error(& loc, state,
"`out' qualifier in declaration of `%s' "
"only valid for function parameters in %s",
q.flags.q.bound_image)
merge_bindless_qualifier(state);
+ if (state->EXT_gpu_shader4_enable &&
+ state->stage == MESA_SHADER_FRAGMENT &&
+ this->flags.q.varying && q.flags.q.out) {
+ this->flags.q.varying = 0;
+ this->flags.q.out = 1;
+ }
+
return r;
}
/* Section 4.3 of the GLSL 1.20 specification states:
* "Variable declarations may have a storage qualifier specified..."
* 1.30 clarifies this to "may have one storage qualifier".
+ *
+ * GL_EXT_gpu_shader4 allows "varying out" in fragment shaders.
*/
- if ($2.has_storage())
+ if ($2.has_storage() &&
+ (!state->EXT_gpu_shader4_enable ||
+ state->stage != MESA_SHADER_FRAGMENT ||
+ !$1.flags.q.varying || !$2.flags.q.out))
_mesa_glsl_error(&@1, state, "duplicate storage qualifier");
if (!state->has_420pack_or_es31() &&