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