glsl: Validate that built-in uniforms have backing state

All built-in uniforms are supposed to be backed by some GL state.  The
state_slots field describes this backing state.

This helped me track down a bug in a later patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
Ian Romanick 2014-05-28 17:05:14 -07:00
parent 8786544b3e
commit 77005cfabd

View file

@ -700,6 +700,14 @@ ir_validate::visit(ir_variable *ir)
abort();
}
if (ir->data.mode == ir_var_uniform
&& strncmp(ir->name, "gl_", 3) == 0
&& ir->state_slots == NULL) {
printf("built-in uniform has no state\n");
ir->print();
abort();
}
return visit_continue;
}