From: Ian Romanick <ian.d.roman...@intel.com> 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.roman...@intel.com> Acked-by: Anuj Phogat <anuj.pho...@gmail.com> --- src/glsl/ir_validate.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 42142da..ef660e8 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -696,6 +696,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; } -- 1.8.1.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev