glsl: assert on incoherent point mode layout-id-qualifier validation
The point mode value in an ast_type_qualifier can only be true if the flag is already set since this layout-id-qualifier can only be or not be present in a shader. Hence, it is useless to check for its value if the flag is already set. Just replaced with an assert. V2: assert instead of checking for coherence and raising a compilation error. Suggested by Timothy. Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
This commit is contained in:
@@ -316,10 +316,8 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (q.flags.q.point_mode) {
|
if (q.flags.q.point_mode) {
|
||||||
if (this->flags.q.point_mode && this->point_mode != q.point_mode) {
|
/* Point mode can only be true if the flag is set. */
|
||||||
_mesa_glsl_error(loc, state, "conflicting point mode used");
|
assert (!this->flags.q.point_mode || (this->point_mode && q.point_mode));
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this->flags.q.point_mode = 1;
|
this->flags.q.point_mode = 1;
|
||||||
this->point_mode = q.point_mode;
|
this->point_mode = q.point_mode;
|
||||||
}
|
}
|
||||||
@@ -582,12 +580,10 @@ ast_type_qualifier::validate_in_qualifier(YYLTYPE *loc,
|
|||||||
"conflicting ordering specified");
|
"conflicting ordering specified");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state->in_qualifier->flags.q.point_mode && this->flags.q.point_mode
|
/* Point mode can only be true if the flag is set. */
|
||||||
&& state->in_qualifier->point_mode != this->point_mode) {
|
assert (!state->in_qualifier->flags.q.point_mode
|
||||||
r = false;
|
|| !this->flags.q.point_mode
|
||||||
_mesa_glsl_error(loc, state,
|
|| (state->in_qualifier->point_mode && this->point_mode));
|
||||||
"conflicting point mode specified");
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user