OSDN Git Service

glsl: Add gl_{Max,Min}ProgramTexelOffset built-in constants.
authorMatt Turner <mattst88@gmail.com>
Wed, 22 May 2013 17:56:25 +0000 (10:56 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 14 Jun 2013 18:25:49 +0000 (11:25 -0700)
Required by ARB_shading_language_420pack. Note that the 420pack spec
incorrectly specifies their values as (Min, Max) = (-7, 8) when they
should be (-8, 7) as listed in the GLSL 4.30 and ESSL 3.0 specs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/builtin_variables.cpp

index 4bb361c..f4ac205 100644 (file)
@@ -790,6 +790,13 @@ generate_130_uniforms(exec_list *instructions,
                         state->Const.MaxClipPlanes);
    add_builtin_constant(instructions, symtab, "gl_MaxVaryingComponents",
                        state->Const.MaxVaryingFloats);
+
+   if (state->ARB_shading_language_420pack_enable) {
+      add_builtin_constant(instructions, symtab, "gl_MinProgramTexelOffset",
+                           state->Const.MinProgramTexelOffset);
+      add_builtin_constant(instructions, symtab, "gl_MaxProgramTexelOffset",
+                           state->Const.MaxProgramTexelOffset);
+   }
 }