When formatting the error here, we're currently casting an
ast_type_qualifier as a string.
But we don't need to use a string here at all, because we know from
context exactly what qualifier we're talking about, because the
if-statements explicitly check for the uniform-qualifier.
So let's just hard-code the format-string to reference the right
qualifier instead of the string-shenanigans. The latter cannot do the
right thing.
Fixes:
2d03f48a65a ("glsl: Add parsing for GLSL uniform blocks.")
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9911>
if ($$.flags.q.uniform && !state->has_uniform_buffer_objects()) {
_mesa_glsl_error(& @1, state,
"#version 140 / GL_ARB_uniform_buffer_object "
- "layout qualifier `%s' is used", $1);
+ "layout qualifier `uniform' is used");
} else if ($$.flags.q.uniform && state->ARB_uniform_buffer_object_warn) {
_mesa_glsl_warning(& @1, state,
"#version 140 / GL_ARB_uniform_buffer_object "
- "layout qualifier `%s' is used", $1);
+ "layout qualifier `uniform' is used");
}
}
;