Mesa (master): glsl: Add gl_{Max, Min}ProgramTexelOffset built-in constants.

Matt Turner mattst88 at kemper.freedesktop.org
Fri Jun 14 18:26:13 UTC 2013


Module: Mesa
Branch: master
Commit: 876e16562bad6fe60c50900f22cda95baeb4bb3d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=876e16562bad6fe60c50900f22cda95baeb4bb3d

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed May 22 10:56:25 2013 -0700

glsl: Add gl_{Max,Min}ProgramTexelOffset built-in constants.

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 at whitecape.org>

---

 src/glsl/builtin_variables.cpp |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 4bb361c..f4ac205 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -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);
+   }
 }
 
 




More information about the mesa-commit mailing list