[Piglit] [PATCH 2/2] AMD_texture_texture4: new test

Marek Olšák maraeo at gmail.com
Fri Nov 30 05:01:19 UTC 2018


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 at 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 at 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 at alum.mit.edu>
> wrote:
> >>
> >> On Wed, Nov 28, 2018 at 8:21 PM Marek Olšák <maraeo at gmail.com> wrote:
> >> >
> >> > From: Marek Olšák <marek.olsak at 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 at 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 at lists.freedesktop.org
> >> > https://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20181130/d06cefd3/attachment.html>


More information about the Piglit mailing list