diff options
author | Paul Berry <[email protected]> | 2011-08-11 17:33:06 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2011-09-08 09:37:12 -0700 |
commit | 36c4b1a3da44a80624eab9da6543540b4b253f1d (patch) | |
tree | 70c08a3443e9c91ba0561b090d6d0092f2fd3dad /src/glsl | |
parent | af243b55ac346f39acda1ad20d90e7c8cc1a33c7 (diff) |
glsl: Add constant gl_MaxClipDistances.
Fixes piglit tests {vs,fs}-clip-distance-sizeable-to-max.shader_test.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/ir_variable.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp index 38094568b4f..e0b6f38f1c9 100644 --- a/src/glsl/ir_variable.cpp +++ b/src/glsl/ir_variable.cpp @@ -585,6 +585,17 @@ generate_120_vs_variables(exec_list *instructions, static void +generate_130_uniforms(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + glsl_symbol_table *const symtab = state->symbols; + + add_builtin_constant(instructions, symtab, "gl_MaxClipDistances", + state->Const.MaxClipPlanes); +} + + +static void generate_130_vs_variables(exec_list *instructions, struct _mesa_glsl_parse_state *state) { @@ -595,6 +606,8 @@ generate_130_vs_variables(exec_list *instructions, & builtin_130_vs_variables[i]); } + generate_130_uniforms(instructions, state); + /* From the GLSL 1.30 spec, section 7.1 (Vertex Shader Special * Variables): * @@ -811,6 +824,8 @@ generate_130_fs_variables(exec_list *instructions, { generate_120_fs_variables(instructions, state); + generate_130_uniforms(instructions, state); + /* From the GLSL 1.30 spec, section 7.2 (Fragment Shader Special * Variables): * |