glsl: geom shader max_vertices layout must match.
From GLSL 4.5 spec, "4.4.2.3 Geometry Outputs". "all geometry shader output vertex count declarations in a program must declare the same count." Fixes: GL45-CTS.geometry_shader.output.conflicted_output_vertices_max Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -368,7 +368,8 @@ public:
|
|||||||
|
|
||||||
bool process_qualifier_constant(struct _mesa_glsl_parse_state *state,
|
bool process_qualifier_constant(struct _mesa_glsl_parse_state *state,
|
||||||
const char *qual_indentifier,
|
const char *qual_indentifier,
|
||||||
unsigned *value, bool can_be_zero);
|
unsigned *value, bool can_be_zero,
|
||||||
|
bool must_match = false);
|
||||||
|
|
||||||
void merge_qualifier(ast_layout_expression *l_expr)
|
void merge_qualifier(ast_layout_expression *l_expr)
|
||||||
{
|
{
|
||||||
|
@@ -678,7 +678,8 @@ bool
|
|||||||
ast_layout_expression::process_qualifier_constant(struct _mesa_glsl_parse_state *state,
|
ast_layout_expression::process_qualifier_constant(struct _mesa_glsl_parse_state *state,
|
||||||
const char *qual_indentifier,
|
const char *qual_indentifier,
|
||||||
unsigned *value,
|
unsigned *value,
|
||||||
bool can_be_zero)
|
bool can_be_zero,
|
||||||
|
bool must_match)
|
||||||
{
|
{
|
||||||
int min_value = 0;
|
int min_value = 0;
|
||||||
bool first_pass = true;
|
bool first_pass = true;
|
||||||
@@ -716,12 +717,14 @@ ast_layout_expression::process_qualifier_constant(struct _mesa_glsl_parse_state
|
|||||||
* in a single declaration, the last occurrence overrides the
|
* in a single declaration, the last occurrence overrides the
|
||||||
* former occurrence(s)."
|
* former occurrence(s)."
|
||||||
*/
|
*/
|
||||||
if (!state->has_420pack() && !first_pass && *value != const_int->value.u[0]) {
|
if (!first_pass) {
|
||||||
YYLTYPE loc = const_expression->get_location();
|
if ((must_match || !state->has_420pack()) && *value != const_int->value.u[0]) {
|
||||||
_mesa_glsl_error(&loc, state, "%s layout qualifier does not "
|
YYLTYPE loc = const_expression->get_location();
|
||||||
"match previous declaration (%d vs %d)",
|
_mesa_glsl_error(&loc, state, "%s layout qualifier does not "
|
||||||
qual_indentifier, *value, const_int->value.i[0]);
|
"match previous declaration (%d vs %d)",
|
||||||
return false;
|
qual_indentifier, *value, const_int->value.i[0]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
first_pass = false;
|
first_pass = false;
|
||||||
*value = const_int->value.u[0];
|
*value = const_int->value.u[0];
|
||||||
|
@@ -1692,7 +1692,7 @@ set_shader_inout_layout(struct gl_shader *shader,
|
|||||||
unsigned qual_max_vertices;
|
unsigned qual_max_vertices;
|
||||||
if (state->out_qualifier->max_vertices->
|
if (state->out_qualifier->max_vertices->
|
||||||
process_qualifier_constant(state, "max_vertices",
|
process_qualifier_constant(state, "max_vertices",
|
||||||
&qual_max_vertices, true)) {
|
&qual_max_vertices, true, true)) {
|
||||||
|
|
||||||
if (qual_max_vertices > state->Const.MaxGeometryOutputVertices) {
|
if (qual_max_vertices > state->Const.MaxGeometryOutputVertices) {
|
||||||
YYLTYPE loc = state->out_qualifier->max_vertices->get_location();
|
YYLTYPE loc = state->out_qualifier->max_vertices->get_location();
|
||||||
|
Reference in New Issue
Block a user