mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
glsl: Disallow interpolation qualifiers on non-input/output variables.
Commit 2548092ad8 switched the sense of interpolation qualifier
checks in order to permit them on geometry shader in/out variables.
In doing so, it accidentally allowed interpolation qualifiers to be
applied to ordinary variables and function parameters.
Fixes a regression in Piglit's local-smooth-01.frag.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
parent
7d2423a09e
commit
a1ddbd1d7c
1 changed files with 18 additions and 7 deletions
|
|
@ -2059,13 +2059,24 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
|||
else
|
||||
var->interpolation = INTERP_QUALIFIER_NONE;
|
||||
|
||||
if (var->interpolation != INTERP_QUALIFIER_NONE &&
|
||||
((state->target == vertex_shader && var->mode == ir_var_shader_in) ||
|
||||
(state->target == fragment_shader && var->mode == ir_var_shader_out))) {
|
||||
_mesa_glsl_error(loc, state,
|
||||
"interpolation qualifier `%s' cannot be applied to "
|
||||
"vertex shader inputs or fragment shader outputs",
|
||||
var->interpolation_string());
|
||||
if (var->interpolation != INTERP_QUALIFIER_NONE) {
|
||||
ir_variable_mode mode = (ir_variable_mode) var->mode;
|
||||
|
||||
if (mode != ir_var_shader_in && mode != ir_var_shader_out) {
|
||||
_mesa_glsl_error(loc, state,
|
||||
"interpolation qualifier `%s' can only be applied to "
|
||||
"shader inputs or outputs.",
|
||||
var->interpolation_string());
|
||||
|
||||
}
|
||||
|
||||
if ((state->target == vertex_shader && mode == ir_var_shader_in) ||
|
||||
(state->target == fragment_shader && mode == ir_var_shader_out)) {
|
||||
_mesa_glsl_error(loc, state,
|
||||
"interpolation qualifier `%s' cannot be applied to "
|
||||
"vertex shader inputs or fragment shader outputs",
|
||||
var->interpolation_string());
|
||||
}
|
||||
}
|
||||
|
||||
var->pixel_center_integer = qual->flags.q.pixel_center_integer;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue