[2/2] AMD_texture_texture4: new test

Submitted by Marek Olšák on Nov. 29, 2018, 1:20 a.m.

Details

Message ID 20181129012050.26060-2-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Marek Olšák Nov. 29, 2018, 1:20 a.m.
From: Marek Olšák <marek.olsak@amd.com>

based on some ARB_texture_gather5 test.
---
 .../execution/texture4.shader_test            | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 tests/spec/amd_texture_texture4/execution/texture4.shader_test

Patch hide | download patch | download mbox

diff --git a/tests/spec/amd_texture_texture4/execution/texture4.shader_test b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
new file mode 100644
index 000000000..b27974d7a
--- /dev/null
+++ b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
@@ -0,0 +1,84 @@ 
+[require]
+GLSL >= 1.10
+GL_AMD_texture_texture4
+
+[vertex shader]
+void main()
+{
+	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}
+
+[fragment shader]
+#extension GL_AMD_texture_texture4 : require
+/* Verify that gather4 always samples from the base level of a mipmapped texture */
+
+uniform sampler2D tex;
+
+void main()
+{
+   gl_FragColor = texture4(tex, vec2(0.5, 0.5));
+}
+
+[test]
+uniform int tex 0
+texture miptree 0
+texparameter 2D min linear_mipmap_linear
+texparameter 2D mag nearest
+
+texparameter 2D base_level 0
+
+texparameter 2D swizzle_r red
+draw rect -1 -1 0.5 0.5
+relative probe rgb (0.125, 0.125) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 -1 0.5 0.5
+relative probe rgb (0.375, 0.125) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r blue
+draw rect 0 -1 0.5 0.5
+relative probe rgb (0.625, 0.125) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 -1 0.5 0.5
+relative probe rgb (0.875, 0.125) (1.0, 1.0, 1.0)
+
+texparameter 2D base_level 1
+
+texparameter 2D swizzle_r red
+draw rect -1 -0.5 0.5 0.5
+relative probe rgb (0.125, 0.375) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 -0.5 0.5 0.5
+relative probe rgb (0.375, 0.375) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r blue
+draw rect 0 -0.5 0.5 0.5
+relative probe rgb (0.625, 0.375) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 -0.5 0.5 0.5
+relative probe rgb (0.875, 0.375) (1.0, 1.0, 1.0)
+
+texparameter 2D base_level 2
+texparameter 2D swizzle_r red
+draw rect -1 0 0.5 0.5
+relative probe rgb (0.125, 0.625) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 0 0.5 0.5
+relative probe rgb (0.375, 0.625) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r blue
+draw rect 0 0 0.5 0.5
+relative probe rgb (0.625, 0.625) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 0 0.5 0.5
+relative probe rgb (0.875, 0.625) (1.0, 1.0, 1.0)
+
+texparameter 2D base_level 3
+texparameter 2D swizzle_r red
+draw rect -1 0.5 0.5 0.5
+relative probe rgb (0.125, 0.875) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 0.5 0.5 0.5
+relative probe rgb (0.375, 0.875) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r blue
+draw rect 0 0.5 0.5 0.5
+relative probe rgb (0.625, 0.875) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 0.5 0.5 0.5
+relative probe rgb (0.875, 0.875) (1.0, 1.0, 1.0)

Comments

On Wed, Nov 28, 2018 at 8:21 PM Marek Olšák <maraeo@gmail.com> wrote:
>
> From: Marek Olšák <marek.olsak@amd.com>
>
> based on some ARB_texture_gather5 test.
> ---
>  .../execution/texture4.shader_test            | 84 +++++++++++++++++++
>  1 file changed, 84 insertions(+)
>  create mode 100644 tests/spec/amd_texture_texture4/execution/texture4.shader_test
>
> diff --git a/tests/spec/amd_texture_texture4/execution/texture4.shader_test b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> new file mode 100644
> index 000000000..b27974d7a
> --- /dev/null
> +++ b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> @@ -0,0 +1,84 @@
> +[require]
> +GLSL >= 1.10
> +GL_AMD_texture_texture4
> +
> +[vertex shader]

I think just doing

[vertex shader passthrough]

gets you this shader without having to specify it.

> +void main()
> +{
> +       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
> +}
> +
> +[fragment shader]
> +#extension GL_AMD_texture_texture4 : require
> +/* Verify that gather4 always samples from the base level of a mipmapped texture */
> +
> +uniform sampler2D tex;
> +
> +void main()
> +{
> +   gl_FragColor = texture4(tex, vec2(0.5, 0.5));
> +}
> +
> +[test]
> +uniform int tex 0
> +texture miptree 0

IMHO this deserves a comment to remind the reader that level 0 = red,
1 = green, 2 = blue, 3 = white.

With these, small fixes,

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>

For extra credit, adjust shaders/textureGather.c to allow to use
texture4 instead. Probably too complicated though.

> +texparameter 2D min linear_mipmap_linear
> +texparameter 2D mag nearest
> +
> +texparameter 2D base_level 0
> +
> +texparameter 2D swizzle_r red
> +draw rect -1 -1 0.5 0.5
> +relative probe rgb (0.125, 0.125) (1.0, 1.0, 1.0)
> +texparameter 2D swizzle_r green
> +draw rect -0.5 -1 0.5 0.5
> +relative probe rgb (0.375, 0.125) (0.0, 0.0, 0.0)
> +texparameter 2D swizzle_r blue
> +draw rect 0 -1 0.5 0.5
> +relative probe rgb (0.625, 0.125) (0.0, 0.0, 0.0)
> +texparameter 2D swizzle_r alpha
> +draw rect 0.5 -1 0.5 0.5
> +relative probe rgb (0.875, 0.125) (1.0, 1.0, 1.0)
> +
> +texparameter 2D base_level 1
> +
> +texparameter 2D swizzle_r red
> +draw rect -1 -0.5 0.5 0.5
> +relative probe rgb (0.125, 0.375) (0.0, 0.0, 0.0)
> +texparameter 2D swizzle_r green
> +draw rect -0.5 -0.5 0.5 0.5
> +relative probe rgb (0.375, 0.375) (1.0, 1.0, 1.0)
> +texparameter 2D swizzle_r blue
> +draw rect 0 -0.5 0.5 0.5
> +relative probe rgb (0.625, 0.375) (0.0, 0.0, 0.0)
> +texparameter 2D swizzle_r alpha
> +draw rect 0.5 -0.5 0.5 0.5
> +relative probe rgb (0.875, 0.375) (1.0, 1.0, 1.0)
> +
> +texparameter 2D base_level 2
> +texparameter 2D swizzle_r red
> +draw rect -1 0 0.5 0.5
> +relative probe rgb (0.125, 0.625) (0.0, 0.0, 0.0)
> +texparameter 2D swizzle_r green
> +draw rect -0.5 0 0.5 0.5
> +relative probe rgb (0.375, 0.625) (0.0, 0.0, 0.0)
> +texparameter 2D swizzle_r blue
> +draw rect 0 0 0.5 0.5
> +relative probe rgb (0.625, 0.625) (1.0, 1.0, 1.0)
> +texparameter 2D swizzle_r alpha
> +draw rect 0.5 0 0.5 0.5
> +relative probe rgb (0.875, 0.625) (1.0, 1.0, 1.0)
> +
> +texparameter 2D base_level 3
> +texparameter 2D swizzle_r red
> +draw rect -1 0.5 0.5 0.5
> +relative probe rgb (0.125, 0.875) (1.0, 1.0, 1.0)
> +texparameter 2D swizzle_r green
> +draw rect -0.5 0.5 0.5 0.5
> +relative probe rgb (0.375, 0.875) (1.0, 1.0, 1.0)
> +texparameter 2D swizzle_r blue
> +draw rect 0 0.5 0.5 0.5
> +relative probe rgb (0.625, 0.875) (1.0, 1.0, 1.0)
> +texparameter 2D swizzle_r alpha
> +draw rect 0.5 0.5 0.5 0.5
> +relative probe rgb (0.875, 0.875) (1.0, 1.0, 1.0)
> --
> 2.17.1
>
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
The test is the same as the textureGather shader test in shaders/. I didn't
make any changes to it besides the texture function name and #extension. I
didn't even bother figuring out how it works. :)

Marek

On Wed, Nov 28, 2018 at 8:49 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:

> On Wed, Nov 28, 2018 at 8:21 PM Marek Olšák <maraeo@gmail.com> wrote:
> >
> > From: Marek Olšák <marek.olsak@amd.com>
> >
> > based on some ARB_texture_gather5 test.
> > ---
> >  .../execution/texture4.shader_test            | 84 +++++++++++++++++++
> >  1 file changed, 84 insertions(+)
> >  create mode 100644
> tests/spec/amd_texture_texture4/execution/texture4.shader_test
> >
> > diff --git
> a/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> > new file mode 100644
> > index 000000000..b27974d7a
> > --- /dev/null
> > +++ b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> > @@ -0,0 +1,84 @@
> > +[require]
> > +GLSL >= 1.10
> > +GL_AMD_texture_texture4
> > +
> > +[vertex shader]
>
> I think just doing
>
> [vertex shader passthrough]
>
> gets you this shader without having to specify it.
>
> > +void main()
> > +{
> > +       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
> > +}
> > +
> > +[fragment shader]
> > +#extension GL_AMD_texture_texture4 : require
> > +/* Verify that gather4 always samples from the base level of a
> mipmapped texture */
> > +
> > +uniform sampler2D tex;
> > +
> > +void main()
> > +{
> > +   gl_FragColor = texture4(tex, vec2(0.5, 0.5));
> > +}
> > +
> > +[test]
> > +uniform int tex 0
> > +texture miptree 0
>
> IMHO this deserves a comment to remind the reader that level 0 = red,
> 1 = green, 2 = blue, 3 = white.
>
> With these, small fixes,
>
> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
>
> For extra credit, adjust shaders/textureGather.c to allow to use
> texture4 instead. Probably too complicated though.
>
> > +texparameter 2D min linear_mipmap_linear
> > +texparameter 2D mag nearest
> > +
> > +texparameter 2D base_level 0
> > +
> > +texparameter 2D swizzle_r red
> > +draw rect -1 -1 0.5 0.5
> > +relative probe rgb (0.125, 0.125) (1.0, 1.0, 1.0)
> > +texparameter 2D swizzle_r green
> > +draw rect -0.5 -1 0.5 0.5
> > +relative probe rgb (0.375, 0.125) (0.0, 0.0, 0.0)
> > +texparameter 2D swizzle_r blue
> > +draw rect 0 -1 0.5 0.5
> > +relative probe rgb (0.625, 0.125) (0.0, 0.0, 0.0)
> > +texparameter 2D swizzle_r alpha
> > +draw rect 0.5 -1 0.5 0.5
> > +relative probe rgb (0.875, 0.125) (1.0, 1.0, 1.0)
> > +
> > +texparameter 2D base_level 1
> > +
> > +texparameter 2D swizzle_r red
> > +draw rect -1 -0.5 0.5 0.5
> > +relative probe rgb (0.125, 0.375) (0.0, 0.0, 0.0)
> > +texparameter 2D swizzle_r green
> > +draw rect -0.5 -0.5 0.5 0.5
> > +relative probe rgb (0.375, 0.375) (1.0, 1.0, 1.0)
> > +texparameter 2D swizzle_r blue
> > +draw rect 0 -0.5 0.5 0.5
> > +relative probe rgb (0.625, 0.375) (0.0, 0.0, 0.0)
> > +texparameter 2D swizzle_r alpha
> > +draw rect 0.5 -0.5 0.5 0.5
> > +relative probe rgb (0.875, 0.375) (1.0, 1.0, 1.0)
> > +
> > +texparameter 2D base_level 2
> > +texparameter 2D swizzle_r red
> > +draw rect -1 0 0.5 0.5
> > +relative probe rgb (0.125, 0.625) (0.0, 0.0, 0.0)
> > +texparameter 2D swizzle_r green
> > +draw rect -0.5 0 0.5 0.5
> > +relative probe rgb (0.375, 0.625) (0.0, 0.0, 0.0)
> > +texparameter 2D swizzle_r blue
> > +draw rect 0 0 0.5 0.5
> > +relative probe rgb (0.625, 0.625) (1.0, 1.0, 1.0)
> > +texparameter 2D swizzle_r alpha
> > +draw rect 0.5 0 0.5 0.5
> > +relative probe rgb (0.875, 0.625) (1.0, 1.0, 1.0)
> > +
> > +texparameter 2D base_level 3
> > +texparameter 2D swizzle_r red
> > +draw rect -1 0.5 0.5 0.5
> > +relative probe rgb (0.125, 0.875) (1.0, 1.0, 1.0)
> > +texparameter 2D swizzle_r green
> > +draw rect -0.5 0.5 0.5 0.5
> > +relative probe rgb (0.375, 0.875) (1.0, 1.0, 1.0)
> > +texparameter 2D swizzle_r blue
> > +draw rect 0 0.5 0.5 0.5
> > +relative probe rgb (0.625, 0.875) (1.0, 1.0, 1.0)
> > +texparameter 2D swizzle_r alpha
> > +draw rect 0.5 0.5 0.5 0.5
> > +relative probe rgb (0.875, 0.875) (1.0, 1.0, 1.0)
> > --
> > 2.17.1
> >
> > _______________________________________________
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit
>
I meant the one in texturing/shaders/textureGather.c. That one uses
variable coordinates, but a single layer texture.
On Wed, Nov 28, 2018 at 10:05 PM Marek Olšák <maraeo@gmail.com> wrote:
>
> The test is the same as the textureGather shader test in shaders/. I didn't make any changes to it besides the texture function name and #extension. I didn't even bother figuring out how it works. :)
>
> Marek
>
> On Wed, Nov 28, 2018 at 8:49 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>>
>> On Wed, Nov 28, 2018 at 8:21 PM Marek Olšák <maraeo@gmail.com> wrote:
>> >
>> > From: Marek Olšák <marek.olsak@amd.com>
>> >
>> > based on some ARB_texture_gather5 test.
>> > ---
>> >  .../execution/texture4.shader_test            | 84 +++++++++++++++++++
>> >  1 file changed, 84 insertions(+)
>> >  create mode 100644 tests/spec/amd_texture_texture4/execution/texture4.shader_test
>> >
>> > diff --git a/tests/spec/amd_texture_texture4/execution/texture4.shader_test b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
>> > new file mode 100644
>> > index 000000000..b27974d7a
>> > --- /dev/null
>> > +++ b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
>> > @@ -0,0 +1,84 @@
>> > +[require]
>> > +GLSL >= 1.10
>> > +GL_AMD_texture_texture4
>> > +
>> > +[vertex shader]
>>
>> I think just doing
>>
>> [vertex shader passthrough]
>>
>> gets you this shader without having to specify it.
>>
>> > +void main()
>> > +{
>> > +       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
>> > +}
>> > +
>> > +[fragment shader]
>> > +#extension GL_AMD_texture_texture4 : require
>> > +/* Verify that gather4 always samples from the base level of a mipmapped texture */
>> > +
>> > +uniform sampler2D tex;
>> > +
>> > +void main()
>> > +{
>> > +   gl_FragColor = texture4(tex, vec2(0.5, 0.5));
>> > +}
>> > +
>> > +[test]
>> > +uniform int tex 0
>> > +texture miptree 0
>>
>> IMHO this deserves a comment to remind the reader that level 0 = red,
>> 1 = green, 2 = blue, 3 = white.
>>
>> With these, small fixes,
>>
>> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
>>
>> For extra credit, adjust shaders/textureGather.c to allow to use
>> texture4 instead. Probably too complicated though.
>>
>> > +texparameter 2D min linear_mipmap_linear
>> > +texparameter 2D mag nearest
>> > +
>> > +texparameter 2D base_level 0
>> > +
>> > +texparameter 2D swizzle_r red
>> > +draw rect -1 -1 0.5 0.5
>> > +relative probe rgb (0.125, 0.125) (1.0, 1.0, 1.0)
>> > +texparameter 2D swizzle_r green
>> > +draw rect -0.5 -1 0.5 0.5
>> > +relative probe rgb (0.375, 0.125) (0.0, 0.0, 0.0)
>> > +texparameter 2D swizzle_r blue
>> > +draw rect 0 -1 0.5 0.5
>> > +relative probe rgb (0.625, 0.125) (0.0, 0.0, 0.0)
>> > +texparameter 2D swizzle_r alpha
>> > +draw rect 0.5 -1 0.5 0.5
>> > +relative probe rgb (0.875, 0.125) (1.0, 1.0, 1.0)
>> > +
>> > +texparameter 2D base_level 1
>> > +
>> > +texparameter 2D swizzle_r red
>> > +draw rect -1 -0.5 0.5 0.5
>> > +relative probe rgb (0.125, 0.375) (0.0, 0.0, 0.0)
>> > +texparameter 2D swizzle_r green
>> > +draw rect -0.5 -0.5 0.5 0.5
>> > +relative probe rgb (0.375, 0.375) (1.0, 1.0, 1.0)
>> > +texparameter 2D swizzle_r blue
>> > +draw rect 0 -0.5 0.5 0.5
>> > +relative probe rgb (0.625, 0.375) (0.0, 0.0, 0.0)
>> > +texparameter 2D swizzle_r alpha
>> > +draw rect 0.5 -0.5 0.5 0.5
>> > +relative probe rgb (0.875, 0.375) (1.0, 1.0, 1.0)
>> > +
>> > +texparameter 2D base_level 2
>> > +texparameter 2D swizzle_r red
>> > +draw rect -1 0 0.5 0.5
>> > +relative probe rgb (0.125, 0.625) (0.0, 0.0, 0.0)
>> > +texparameter 2D swizzle_r green
>> > +draw rect -0.5 0 0.5 0.5
>> > +relative probe rgb (0.375, 0.625) (0.0, 0.0, 0.0)
>> > +texparameter 2D swizzle_r blue
>> > +draw rect 0 0 0.5 0.5
>> > +relative probe rgb (0.625, 0.625) (1.0, 1.0, 1.0)
>> > +texparameter 2D swizzle_r alpha
>> > +draw rect 0.5 0 0.5 0.5
>> > +relative probe rgb (0.875, 0.625) (1.0, 1.0, 1.0)
>> > +
>> > +texparameter 2D base_level 3
>> > +texparameter 2D swizzle_r red
>> > +draw rect -1 0.5 0.5 0.5
>> > +relative probe rgb (0.125, 0.875) (1.0, 1.0, 1.0)
>> > +texparameter 2D swizzle_r green
>> > +draw rect -0.5 0.5 0.5 0.5
>> > +relative probe rgb (0.375, 0.875) (1.0, 1.0, 1.0)
>> > +texparameter 2D swizzle_r blue
>> > +draw rect 0 0.5 0.5 0.5
>> > +relative probe rgb (0.625, 0.875) (1.0, 1.0, 1.0)
>> > +texparameter 2D swizzle_r alpha
>> > +draw rect 0.5 0.5 0.5 0.5
>> > +relative probe rgb (0.875, 0.875) (1.0, 1.0, 1.0)
>> > --
>> > 2.17.1
>> >
>> > _______________________________________________
>> > Piglit mailing list
>> > Piglit@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/piglit
Yeah, I know you meant a different one. I'm not really so into writing
tests for AMD_texture_texture4 though.

Marek

On Thu, Nov 29, 2018 at 6:02 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:

> I meant the one in texturing/shaders/textureGather.c. That one uses
> variable coordinates, but a single layer texture.
> On Wed, Nov 28, 2018 at 10:05 PM Marek Olšák <maraeo@gmail.com> wrote:
> >
> > The test is the same as the textureGather shader test in shaders/. I
> didn't make any changes to it besides the texture function name and
> #extension. I didn't even bother figuring out how it works. :)
> >
> > Marek
> >
> > On Wed, Nov 28, 2018 at 8:49 PM Ilia Mirkin <imirkin@alum.mit.edu>
> wrote:
> >>
> >> On Wed, Nov 28, 2018 at 8:21 PM Marek Olšák <maraeo@gmail.com> wrote:
> >> >
> >> > From: Marek Olšák <marek.olsak@amd.com>
> >> >
> >> > based on some ARB_texture_gather5 test.
> >> > ---
> >> >  .../execution/texture4.shader_test            | 84
> +++++++++++++++++++
> >> >  1 file changed, 84 insertions(+)
> >> >  create mode 100644
> tests/spec/amd_texture_texture4/execution/texture4.shader_test
> >> >
> >> > diff --git
> a/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> >> > new file mode 100644
> >> > index 000000000..b27974d7a
> >> > --- /dev/null
> >> > +++ b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
> >> > @@ -0,0 +1,84 @@
> >> > +[require]
> >> > +GLSL >= 1.10
> >> > +GL_AMD_texture_texture4
> >> > +
> >> > +[vertex shader]
> >>
> >> I think just doing
> >>
> >> [vertex shader passthrough]
> >>
> >> gets you this shader without having to specify it.
> >>
> >> > +void main()
> >> > +{
> >> > +       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
> >> > +}
> >> > +
> >> > +[fragment shader]
> >> > +#extension GL_AMD_texture_texture4 : require
> >> > +/* Verify that gather4 always samples from the base level of a
> mipmapped texture */
> >> > +
> >> > +uniform sampler2D tex;
> >> > +
> >> > +void main()
> >> > +{
> >> > +   gl_FragColor = texture4(tex, vec2(0.5, 0.5));
> >> > +}
> >> > +
> >> > +[test]
> >> > +uniform int tex 0
> >> > +texture miptree 0
> >>
> >> IMHO this deserves a comment to remind the reader that level 0 = red,
> >> 1 = green, 2 = blue, 3 = white.
> >>
> >> With these, small fixes,
> >>
> >> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
> >>
> >> For extra credit, adjust shaders/textureGather.c to allow to use
> >> texture4 instead. Probably too complicated though.
> >>
> >> > +texparameter 2D min linear_mipmap_linear
> >> > +texparameter 2D mag nearest
> >> > +
> >> > +texparameter 2D base_level 0
> >> > +
> >> > +texparameter 2D swizzle_r red
> >> > +draw rect -1 -1 0.5 0.5
> >> > +relative probe rgb (0.125, 0.125) (1.0, 1.0, 1.0)
> >> > +texparameter 2D swizzle_r green
> >> > +draw rect -0.5 -1 0.5 0.5
> >> > +relative probe rgb (0.375, 0.125) (0.0, 0.0, 0.0)
> >> > +texparameter 2D swizzle_r blue
> >> > +draw rect 0 -1 0.5 0.5
> >> > +relative probe rgb (0.625, 0.125) (0.0, 0.0, 0.0)
> >> > +texparameter 2D swizzle_r alpha
> >> > +draw rect 0.5 -1 0.5 0.5
> >> > +relative probe rgb (0.875, 0.125) (1.0, 1.0, 1.0)
> >> > +
> >> > +texparameter 2D base_level 1
> >> > +
> >> > +texparameter 2D swizzle_r red
> >> > +draw rect -1 -0.5 0.5 0.5
> >> > +relative probe rgb (0.125, 0.375) (0.0, 0.0, 0.0)
> >> > +texparameter 2D swizzle_r green
> >> > +draw rect -0.5 -0.5 0.5 0.5
> >> > +relative probe rgb (0.375, 0.375) (1.0, 1.0, 1.0)
> >> > +texparameter 2D swizzle_r blue
> >> > +draw rect 0 -0.5 0.5 0.5
> >> > +relative probe rgb (0.625, 0.375) (0.0, 0.0, 0.0)
> >> > +texparameter 2D swizzle_r alpha
> >> > +draw rect 0.5 -0.5 0.5 0.5
> >> > +relative probe rgb (0.875, 0.375) (1.0, 1.0, 1.0)
> >> > +
> >> > +texparameter 2D base_level 2
> >> > +texparameter 2D swizzle_r red
> >> > +draw rect -1 0 0.5 0.5
> >> > +relative probe rgb (0.125, 0.625) (0.0, 0.0, 0.0)
> >> > +texparameter 2D swizzle_r green
> >> > +draw rect -0.5 0 0.5 0.5
> >> > +relative probe rgb (0.375, 0.625) (0.0, 0.0, 0.0)
> >> > +texparameter 2D swizzle_r blue
> >> > +draw rect 0 0 0.5 0.5
> >> > +relative probe rgb (0.625, 0.625) (1.0, 1.0, 1.0)
> >> > +texparameter 2D swizzle_r alpha
> >> > +draw rect 0.5 0 0.5 0.5
> >> > +relative probe rgb (0.875, 0.625) (1.0, 1.0, 1.0)
> >> > +
> >> > +texparameter 2D base_level 3
> >> > +texparameter 2D swizzle_r red
> >> > +draw rect -1 0.5 0.5 0.5
> >> > +relative probe rgb (0.125, 0.875) (1.0, 1.0, 1.0)
> >> > +texparameter 2D swizzle_r green
> >> > +draw rect -0.5 0.5 0.5 0.5
> >> > +relative probe rgb (0.375, 0.875) (1.0, 1.0, 1.0)
> >> > +texparameter 2D swizzle_r blue
> >> > +draw rect 0 0.5 0.5 0.5
> >> > +relative probe rgb (0.625, 0.875) (1.0, 1.0, 1.0)
> >> > +texparameter 2D swizzle_r alpha
> >> > +draw rect 0.5 0.5 0.5 0.5
> >> > +relative probe rgb (0.875, 0.875) (1.0, 1.0, 1.0)
> >> > --
> >> > 2.17.1
> >> >
> >> > _______________________________________________
> >> > Piglit mailing list
> >> > Piglit@lists.freedesktop.org
> >> > https://lists.freedesktop.org/mailman/listinfo/piglit
>
Figured as much, hence marked as "extra credit" :)
On Fri, Nov 30, 2018 at 12:02 AM Marek Olšák <maraeo@gmail.com> wrote:
>
> Yeah, I know you meant a different one. I'm not really so into writing tests for AMD_texture_texture4 though.
>
> Marek
>
> On Thu, Nov 29, 2018 at 6:02 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>>
>> I meant the one in texturing/shaders/textureGather.c. That one uses
>> variable coordinates, but a single layer texture.
>> On Wed, Nov 28, 2018 at 10:05 PM Marek Olšák <maraeo@gmail.com> wrote:
>> >
>> > The test is the same as the textureGather shader test in shaders/. I didn't make any changes to it besides the texture function name and #extension. I didn't even bother figuring out how it works. :)
>> >
>> > Marek
>> >
>> > On Wed, Nov 28, 2018 at 8:49 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>> >>
>> >> On Wed, Nov 28, 2018 at 8:21 PM Marek Olšák <maraeo@gmail.com> wrote:
>> >> >
>> >> > From: Marek Olšák <marek.olsak@amd.com>
>> >> >
>> >> > based on some ARB_texture_gather5 test.
>> >> > ---
>> >> >  .../execution/texture4.shader_test            | 84 +++++++++++++++++++
>> >> >  1 file changed, 84 insertions(+)
>> >> >  create mode 100644 tests/spec/amd_texture_texture4/execution/texture4.shader_test
>> >> >
>> >> > diff --git a/tests/spec/amd_texture_texture4/execution/texture4.shader_test b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
>> >> > new file mode 100644
>> >> > index 000000000..b27974d7a
>> >> > --- /dev/null
>> >> > +++ b/tests/spec/amd_texture_texture4/execution/texture4.shader_test
>> >> > @@ -0,0 +1,84 @@
>> >> > +[require]
>> >> > +GLSL >= 1.10
>> >> > +GL_AMD_texture_texture4
>> >> > +
>> >> > +[vertex shader]
>> >>
>> >> I think just doing
>> >>
>> >> [vertex shader passthrough]
>> >>
>> >> gets you this shader without having to specify it.
>> >>
>> >> > +void main()
>> >> > +{
>> >> > +       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
>> >> > +}
>> >> > +
>> >> > +[fragment shader]
>> >> > +#extension GL_AMD_texture_texture4 : require
>> >> > +/* Verify that gather4 always samples from the base level of a mipmapped texture */
>> >> > +
>> >> > +uniform sampler2D tex;
>> >> > +
>> >> > +void main()
>> >> > +{
>> >> > +   gl_FragColor = texture4(tex, vec2(0.5, 0.5));
>> >> > +}
>> >> > +
>> >> > +[test]
>> >> > +uniform int tex 0
>> >> > +texture miptree 0
>> >>
>> >> IMHO this deserves a comment to remind the reader that level 0 = red,
>> >> 1 = green, 2 = blue, 3 = white.
>> >>
>> >> With these, small fixes,
>> >>
>> >> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
>> >>
>> >> For extra credit, adjust shaders/textureGather.c to allow to use
>> >> texture4 instead. Probably too complicated though.
>> >>
>> >> > +texparameter 2D min linear_mipmap_linear
>> >> > +texparameter 2D mag nearest
>> >> > +
>> >> > +texparameter 2D base_level 0
>> >> > +
>> >> > +texparameter 2D swizzle_r red
>> >> > +draw rect -1 -1 0.5 0.5
>> >> > +relative probe rgb (0.125, 0.125) (1.0, 1.0, 1.0)
>> >> > +texparameter 2D swizzle_r green
>> >> > +draw rect -0.5 -1 0.5 0.5
>> >> > +relative probe rgb (0.375, 0.125) (0.0, 0.0, 0.0)
>> >> > +texparameter 2D swizzle_r blue
>> >> > +draw rect 0 -1 0.5 0.5
>> >> > +relative probe rgb (0.625, 0.125) (0.0, 0.0, 0.0)
>> >> > +texparameter 2D swizzle_r alpha
>> >> > +draw rect 0.5 -1 0.5 0.5
>> >> > +relative probe rgb (0.875, 0.125) (1.0, 1.0, 1.0)
>> >> > +
>> >> > +texparameter 2D base_level 1
>> >> > +
>> >> > +texparameter 2D swizzle_r red
>> >> > +draw rect -1 -0.5 0.5 0.5
>> >> > +relative probe rgb (0.125, 0.375) (0.0, 0.0, 0.0)
>> >> > +texparameter 2D swizzle_r green
>> >> > +draw rect -0.5 -0.5 0.5 0.5
>> >> > +relative probe rgb (0.375, 0.375) (1.0, 1.0, 1.0)
>> >> > +texparameter 2D swizzle_r blue
>> >> > +draw rect 0 -0.5 0.5 0.5
>> >> > +relative probe rgb (0.625, 0.375) (0.0, 0.0, 0.0)
>> >> > +texparameter 2D swizzle_r alpha
>> >> > +draw rect 0.5 -0.5 0.5 0.5
>> >> > +relative probe rgb (0.875, 0.375) (1.0, 1.0, 1.0)
>> >> > +
>> >> > +texparameter 2D base_level 2
>> >> > +texparameter 2D swizzle_r red
>> >> > +draw rect -1 0 0.5 0.5
>> >> > +relative probe rgb (0.125, 0.625) (0.0, 0.0, 0.0)
>> >> > +texparameter 2D swizzle_r green
>> >> > +draw rect -0.5 0 0.5 0.5
>> >> > +relative probe rgb (0.375, 0.625) (0.0, 0.0, 0.0)
>> >> > +texparameter 2D swizzle_r blue
>> >> > +draw rect 0 0 0.5 0.5
>> >> > +relative probe rgb (0.625, 0.625) (1.0, 1.0, 1.0)
>> >> > +texparameter 2D swizzle_r alpha
>> >> > +draw rect 0.5 0 0.5 0.5
>> >> > +relative probe rgb (0.875, 0.625) (1.0, 1.0, 1.0)
>> >> > +
>> >> > +texparameter 2D base_level 3
>> >> > +texparameter 2D swizzle_r red
>> >> > +draw rect -1 0.5 0.5 0.5
>> >> > +relative probe rgb (0.125, 0.875) (1.0, 1.0, 1.0)
>> >> > +texparameter 2D swizzle_r green
>> >> > +draw rect -0.5 0.5 0.5 0.5
>> >> > +relative probe rgb (0.375, 0.875) (1.0, 1.0, 1.0)
>> >> > +texparameter 2D swizzle_r blue
>> >> > +draw rect 0 0.5 0.5 0.5
>> >> > +relative probe rgb (0.625, 0.875) (1.0, 1.0, 1.0)
>> >> > +texparameter 2D swizzle_r alpha
>> >> > +draw rect 0.5 0.5 0.5 0.5
>> >> > +relative probe rgb (0.875, 0.875) (1.0, 1.0, 1.0)
>> >> > --
>> >> > 2.17.1
>> >> >
>> >> > _______________________________________________
>> >> > Piglit mailing list
>> >> > Piglit@lists.freedesktop.org
>> >> > https://lists.freedesktop.org/mailman/listinfo/piglit