mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
compiler/glsl: do not cast struct to string
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:2d03f48a65("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> (cherry picked from commit437ed05708)
This commit is contained in:
parent
4d4e4a3e60
commit
127f04f288
2 changed files with 3 additions and 3 deletions
|
|
@ -499,7 +499,7 @@
|
|||
"description": "compiler/glsl: do not cast struct to string",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "2d03f48a65a666ecdcfaffa3d39ad1b77f2b25b6"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1894,11 +1894,11 @@ layout_qualifier_id:
|
|||
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");
|
||||
}
|
||||
}
|
||||
;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue