Mesa (master): glsl/builtins: Use ivec for texel offsets in textureProjGradOffset.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Apr 17 18:28:16 UTC 2012


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Apr 16 13:37:20 2012 -0700

glsl/builtins: Use ivec for texel offsets in textureProjGradOffset.

The GLSL 1.30 -> 4.10 specs all erroneously say "vec2" for a few
overloads of textureProjGradOffset, while most overloads and all other
texturing functions use ivec types.

The GLSL 4.20 specification corrects these to "ivec2", but doesn't
mention this as being a conscious change in behavior.  Nor does the
ARB_shading_language_420pack extension.  So presumably it was a typo.

At any rate, our builtin functions all use ivec already, so the fact
that these prototypes use plain vecs will only lead to applications
dying in a fire when trying to use them.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/glsl/builtins/profiles/130.frag |    2 +-
 src/glsl/builtins/profiles/130.vert |    2 +-
 src/glsl/builtins/profiles/140.vert |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/glsl/builtins/profiles/130.frag b/src/glsl/builtins/profiles/130.frag
index bb33032..0dca40a 100644
--- a/src/glsl/builtins/profiles/130.frag
+++ b/src/glsl/builtins/profiles/130.frag
@@ -945,7 +945,7 @@ ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off);
 uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off);
 
 float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o);
-float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o);
+float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o);
 
 /*
  * The following texture functions are deprecated:
diff --git a/src/glsl/builtins/profiles/130.vert b/src/glsl/builtins/profiles/130.vert
index 618ecf2..635062e 100644
--- a/src/glsl/builtins/profiles/130.vert
+++ b/src/glsl/builtins/profiles/130.vert
@@ -846,7 +846,7 @@ ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off);
 uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off);
 
 float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o);
-float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o);
+float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o);
 
 /*
  * The following texture functions are deprecated:
diff --git a/src/glsl/builtins/profiles/140.vert b/src/glsl/builtins/profiles/140.vert
index ce4c62d..6d9777f 100644
--- a/src/glsl/builtins/profiles/140.vert
+++ b/src/glsl/builtins/profiles/140.vert
@@ -918,14 +918,14 @@ uvec4 textureProjGradOffset(usampler2DRect s, vec3 P, vec2 dx, vec2 dy, ivec2 of
 ivec4 textureProjGradOffset(isampler2DRect s, vec4 P, vec2 dx, vec2 dy, ivec2 off);
 uvec4 textureProjGradOffset(usampler2DRect s, vec4 P, vec2 dx, vec2 dy, ivec2 off);
 
-float textureProjGradOffset(sampler2DRectShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o);
+float textureProjGradOffset(sampler2DRectShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o);
 
  vec4 textureProjGradOffset( sampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off);
 ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off);
 uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off);
 
 float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o);
-float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o);
+float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o);
 
 /*
  * The following texture functions are deprecated:




More information about the mesa-commit mailing list