diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2014-05-28 17:05:14 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2014-09-30 13:34:41 -0700 |
commit | 77005cfabd263e593cec37cd5933443785d6b9aa (patch) | |
tree | 09e4e1e714237580d33741d4d89542cb084205d9 /src/glsl/ir_validate.cpp | |
parent | 8786544b3e3a024ccb04bb0c85f2afc07bb57f63 (diff) | |
download | external_mesa3d-77005cfabd263e593cec37cd5933443785d6b9aa.zip external_mesa3d-77005cfabd263e593cec37cd5933443785d6b9aa.tar.gz external_mesa3d-77005cfabd263e593cec37cd5933443785d6b9aa.tar.bz2 |
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>
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r-- | src/glsl/ir_validate.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 97a581d..5ed8abb 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -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; } |