Re: [Mesa-dev] [PATCH] glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.

2011-11-09 Thread Kenneth Graunke

On 11/09/2011 08:36 AM, Paul Berry wrote:

I can't help but notice that in the above section, the comment says
"textureProjOffset", but the function declarations say "textureProj".
Is this a bug?  The GLSL spec clearly calls these functions
"textureProjOffset".  130.frag seems to have a similar problem.


Whoops.  Seriously, I proof-read this dozens of times.  But the power of 
cut and paste compels me...


Thanks for catching this.  I just proof-read all these again and found 
an issue with textureGradOffset as well.  I'll send out follow-on patches.



(Aside: if this is a bug, it makes me worry that these texture lookup
functions aren't very well tested in Piglit.  Maybe I should go write a
bunch of generated tests like I did for operators...)


Worse than that---they're not tested at all.  You would be my hero.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.

2011-11-09 Thread Eric Anholt
On Wed, 9 Nov 2011 08:36:52 -0800, Paul Berry  wrote:
Non-text part: multipart/mixed
Non-text part: multipart/alternative
> On 8 November 2011 10:40, Kenneth Graunke  wrote:
> 
> > From the GLSL 1.30 spec, section 8.7 "Texture Lookup Functions":
> > "In all functions below, the bias parameter is optional for fragment
> >  shaders.  The bias parameter is not accepted in a vertex shader."
> >
> > This was a cut and paste mistake.
> >
> > Signed-off-by: Kenneth Graunke 
> > ---
> >  src/glsl/builtins/profiles/130.vert |  122
> > +-
> >  1 files changed, 4 insertions(+), 118 deletions(-)

> > @@ -749,28 +670,6 @@ uvec4 textureProj(usampler3D sampler, vec4 P, ivec3
> > offset);
> >  float textureProj(sampler1DShadow sampler, vec4 P, int offset);
> >  float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset);
> >
> > -/* textureProjOffset - bias variants */
> > - vec4 textureProj( sampler1D sampler, vec2 P, int offset, float bias);
> > -ivec4 textureProj(isampler1D sampler, vec2 P, int offset, float bias);
> > -uvec4 textureProj(usampler1D sampler, vec2 P, int offset, float bias);
> > - vec4 textureProj( sampler1D sampler, vec4 P, int offset, float bias);
> > -ivec4 textureProj(isampler1D sampler, vec4 P, int offset, float bias);
> > -uvec4 textureProj(usampler1D sampler, vec4 P, int offset, float bias);
> > -
> > - vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset, float bias);
> > -ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset, float bias);
> > -uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset, float bias);
> > - vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset, float bias);
> > -ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset, float bias);
> > -uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset, float bias);
> > -
> > - vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset, float bias);
> > -ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset, float bias);
> > -uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset, float bias);
> > -
> > -float textureProj(sampler1DShadow sampler, vec4 P, int offset, float
> > bias);
> > -float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset, float
> > bias);
> > -
> >
> 
> I can't help but notice that in the above section, the comment says
> "textureProjOffset", but the function declarations say "textureProj".  Is
> this a bug?  The GLSL spec clearly calls these functions
> "textureProjOffset".  130.frag seems to have a similar problem.
> 
> (Aside: if this is a bug, it makes me worry that these texture lookup
> functions aren't very well tested in Piglit.  Maybe I should go write a
> bunch of generated tests like I did for operators...)

Something that iterated texture calls over texture targets would be
awesome.


pgp4YCSSmdf3n.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.

2011-11-09 Thread Paul Berry
On 8 November 2011 10:40, Kenneth Graunke  wrote:

> From the GLSL 1.30 spec, section 8.7 "Texture Lookup Functions":
> "In all functions below, the bias parameter is optional for fragment
>  shaders.  The bias parameter is not accepted in a vertex shader."
>
> This was a cut and paste mistake.
>
> Signed-off-by: Kenneth Graunke 
> ---
>  src/glsl/builtins/profiles/130.vert |  122
> +-
>  1 files changed, 4 insertions(+), 118 deletions(-)
>
> diff --git a/src/glsl/builtins/profiles/130.vert
> b/src/glsl/builtins/profiles/130.vert
> index df17ede..bf8caec 100644
> --- a/src/glsl/builtins/profiles/130.vert
> +++ b/src/glsl/builtins/profiles/130.vert
> @@ -496,7 +496,7 @@ ivec3 textureSize(usampler2DArray sampler, int lod);
>  ivec2 textureSize(sampler1DArrayShadow sampler, int lod);
>  ivec3 textureSize(sampler2DArrayShadow sampler, int lod);
>
> -/* texture - no bias */
> +/* texture */
>  vec4 texture( sampler1D sampler, float P);
>  ivec4 texture(isampler1D sampler, float P);
>  uvec4 texture(usampler1D sampler, float P);
> @@ -528,38 +528,7 @@ uvec4 texture(usampler2DArray sampler, vec3 P);
>  float texture(sampler1DArrayShadow sampler, vec3 P);
>  float texture(sampler2DArrayShadow sampler, vec4 P);
>
> -/* texture - bias variants */
> - vec4 texture( sampler1D sampler, float P, float bias);
> -ivec4 texture(isampler1D sampler, float P, float bias);
> -uvec4 texture(usampler1D sampler, float P, float bias);
> -
> - vec4 texture( sampler2D sampler, vec2 P, float bias);
> -ivec4 texture(isampler2D sampler, vec2 P, float bias);
> -uvec4 texture(usampler2D sampler, vec2 P, float bias);
> -
> - vec4 texture( sampler3D sampler, vec3 P, float bias);
> -ivec4 texture(isampler3D sampler, vec3 P, float bias);
> -uvec4 texture(usampler3D sampler, vec3 P, float bias);
> -
> - vec4 texture( samplerCube sampler, vec3 P, float bias);
> -ivec4 texture(isamplerCube sampler, vec3 P, float bias);
> -uvec4 texture(usamplerCube sampler, vec3 P, float bias);
> -
> -float texture(sampler1DShadow   sampler, vec3 P, float bias);
> -float texture(sampler2DShadow   sampler, vec3 P, float bias);
> -float texture(samplerCubeShadow sampler, vec4 P, float bias);
> -
> - vec4 texture( sampler1DArray sampler, vec2 P, float bias);
> -ivec4 texture(isampler1DArray sampler, vec2 P, float bias);
> -uvec4 texture(usampler1DArray sampler, vec2 P, float bias);
> -
> - vec4 texture( sampler2DArray sampler, vec3 P, float bias);
> -ivec4 texture(isampler2DArray sampler, vec3 P, float bias);
> -uvec4 texture(usampler2DArray sampler, vec3 P, float bias);
> -
> -float texture(sampler1DArrayShadow sampler, vec3 P, float bias);
> -
> -/* textureProj - no bias */
> +/* textureProj */
>  vec4 textureProj( sampler1D sampler, vec2 P);
>  ivec4 textureProj(isampler1D sampler, vec2 P);
>  uvec4 textureProj(usampler1D sampler, vec2 P);
> @@ -581,28 +550,6 @@ uvec4 textureProj(usampler3D sampler, vec4 P);
>  float textureProj(sampler1DShadow sampler, vec4 P);
>  float textureProj(sampler2DShadow sampler, vec4 P);
>
> -/* textureProj - bias variants */
> - vec4 textureProj( sampler1D sampler, vec2 P, float bias);
> -ivec4 textureProj(isampler1D sampler, vec2 P, float bias);
> -uvec4 textureProj(usampler1D sampler, vec2 P, float bias);
> - vec4 textureProj( sampler1D sampler, vec4 P, float bias);
> -ivec4 textureProj(isampler1D sampler, vec4 P, float bias);
> -uvec4 textureProj(usampler1D sampler, vec4 P, float bias);
> -
> - vec4 textureProj( sampler2D sampler, vec3 P, float bias);
> -ivec4 textureProj(isampler2D sampler, vec3 P, float bias);
> -uvec4 textureProj(usampler2D sampler, vec3 P, float bias);
> - vec4 textureProj( sampler2D sampler, vec4 P, float bias);
> -ivec4 textureProj(isampler2D sampler, vec4 P, float bias);
> -uvec4 textureProj(usampler2D sampler, vec4 P, float bias);
> -
> - vec4 textureProj( sampler3D sampler, vec4 P, float bias);
> -ivec4 textureProj(isampler3D sampler, vec4 P, float bias);
> -uvec4 textureProj(usampler3D sampler, vec4 P, float bias);
> -
> -float textureProj(sampler1DShadow sampler, vec4 P, float bias);
> -float textureProj(sampler2DShadow sampler, vec4 P, float bias);
> -
>  /* textureLod */
>  vec4 textureLod( sampler1D sampler, float P, float lod);
>  ivec4 textureLod(isampler1D sampler, float P, float lod);
> @@ -633,7 +580,7 @@ uvec4 textureLod(usampler2DArray sampler, vec3 P,
> float lod);
>
>  float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod);
>
> -/* textureOffset - no bias */
> +/* textureOffset */
>  vec4 textureOffset( sampler1D sampler, float P, int offset);
>  ivec4 textureOffset(isampler1D sampler, float P, int offset);
>  uvec4 textureOffset(usampler1D sampler, float P, int offset);
> @@ -659,32 +606,6 @@ uvec4 textureOffset(usampler2DArray sampler, vec3 P,
> ivec2 offset);
>
>  float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset);
>
> -/* textureOffset - bias variants */
> - vec4 textureOffset( sampler1D sampler, float P, int offset, float b

[Mesa-dev] [PATCH] glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.

2011-11-08 Thread Kenneth Graunke
>From the GLSL 1.30 spec, section 8.7 "Texture Lookup Functions":
"In all functions below, the bias parameter is optional for fragment
 shaders.  The bias parameter is not accepted in a vertex shader."

This was a cut and paste mistake.

Signed-off-by: Kenneth Graunke 
---
 src/glsl/builtins/profiles/130.vert |  122 +-
 1 files changed, 4 insertions(+), 118 deletions(-)

diff --git a/src/glsl/builtins/profiles/130.vert 
b/src/glsl/builtins/profiles/130.vert
index df17ede..bf8caec 100644
--- a/src/glsl/builtins/profiles/130.vert
+++ b/src/glsl/builtins/profiles/130.vert
@@ -496,7 +496,7 @@ ivec3 textureSize(usampler2DArray sampler, int lod);
 ivec2 textureSize(sampler1DArrayShadow sampler, int lod);
 ivec3 textureSize(sampler2DArrayShadow sampler, int lod);
 
-/* texture - no bias */
+/* texture */
  vec4 texture( sampler1D sampler, float P);
 ivec4 texture(isampler1D sampler, float P);
 uvec4 texture(usampler1D sampler, float P);
@@ -528,38 +528,7 @@ uvec4 texture(usampler2DArray sampler, vec3 P);
 float texture(sampler1DArrayShadow sampler, vec3 P);
 float texture(sampler2DArrayShadow sampler, vec4 P);
 
-/* texture - bias variants */
- vec4 texture( sampler1D sampler, float P, float bias);
-ivec4 texture(isampler1D sampler, float P, float bias);
-uvec4 texture(usampler1D sampler, float P, float bias);
-
- vec4 texture( sampler2D sampler, vec2 P, float bias);
-ivec4 texture(isampler2D sampler, vec2 P, float bias);
-uvec4 texture(usampler2D sampler, vec2 P, float bias);
-
- vec4 texture( sampler3D sampler, vec3 P, float bias);
-ivec4 texture(isampler3D sampler, vec3 P, float bias);
-uvec4 texture(usampler3D sampler, vec3 P, float bias);
-
- vec4 texture( samplerCube sampler, vec3 P, float bias);
-ivec4 texture(isamplerCube sampler, vec3 P, float bias);
-uvec4 texture(usamplerCube sampler, vec3 P, float bias);
-
-float texture(sampler1DShadow   sampler, vec3 P, float bias);
-float texture(sampler2DShadow   sampler, vec3 P, float bias);
-float texture(samplerCubeShadow sampler, vec4 P, float bias);
-
- vec4 texture( sampler1DArray sampler, vec2 P, float bias);
-ivec4 texture(isampler1DArray sampler, vec2 P, float bias);
-uvec4 texture(usampler1DArray sampler, vec2 P, float bias);
-
- vec4 texture( sampler2DArray sampler, vec3 P, float bias);
-ivec4 texture(isampler2DArray sampler, vec3 P, float bias);
-uvec4 texture(usampler2DArray sampler, vec3 P, float bias);
-
-float texture(sampler1DArrayShadow sampler, vec3 P, float bias);
-
-/* textureProj - no bias */
+/* textureProj */
  vec4 textureProj( sampler1D sampler, vec2 P);
 ivec4 textureProj(isampler1D sampler, vec2 P);
 uvec4 textureProj(usampler1D sampler, vec2 P);
@@ -581,28 +550,6 @@ uvec4 textureProj(usampler3D sampler, vec4 P);
 float textureProj(sampler1DShadow sampler, vec4 P);
 float textureProj(sampler2DShadow sampler, vec4 P);
 
-/* textureProj - bias variants */
- vec4 textureProj( sampler1D sampler, vec2 P, float bias);
-ivec4 textureProj(isampler1D sampler, vec2 P, float bias);
-uvec4 textureProj(usampler1D sampler, vec2 P, float bias);
- vec4 textureProj( sampler1D sampler, vec4 P, float bias);
-ivec4 textureProj(isampler1D sampler, vec4 P, float bias);
-uvec4 textureProj(usampler1D sampler, vec4 P, float bias);
-
- vec4 textureProj( sampler2D sampler, vec3 P, float bias);
-ivec4 textureProj(isampler2D sampler, vec3 P, float bias);
-uvec4 textureProj(usampler2D sampler, vec3 P, float bias);
- vec4 textureProj( sampler2D sampler, vec4 P, float bias);
-ivec4 textureProj(isampler2D sampler, vec4 P, float bias);
-uvec4 textureProj(usampler2D sampler, vec4 P, float bias);
-
- vec4 textureProj( sampler3D sampler, vec4 P, float bias);
-ivec4 textureProj(isampler3D sampler, vec4 P, float bias);
-uvec4 textureProj(usampler3D sampler, vec4 P, float bias);
-
-float textureProj(sampler1DShadow sampler, vec4 P, float bias);
-float textureProj(sampler2DShadow sampler, vec4 P, float bias);
-
 /* textureLod */
  vec4 textureLod( sampler1D sampler, float P, float lod);
 ivec4 textureLod(isampler1D sampler, float P, float lod);
@@ -633,7 +580,7 @@ uvec4 textureLod(usampler2DArray sampler, vec3 P, float 
lod);
 
 float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod);
 
-/* textureOffset - no bias */
+/* textureOffset */
  vec4 textureOffset( sampler1D sampler, float P, int offset);
 ivec4 textureOffset(isampler1D sampler, float P, int offset);
 uvec4 textureOffset(usampler1D sampler, float P, int offset);
@@ -659,32 +606,6 @@ uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 
offset);
 
 float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset);
 
-/* textureOffset - bias variants */
- vec4 textureOffset( sampler1D sampler, float P, int offset, float bias);
-ivec4 textureOffset(isampler1D sampler, float P, int offset, float bias);
-uvec4 textureOffset(usampler1D sampler, float P, int offset, float bias);
-
- vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset, float bias);
-ivec4 textureOf