[Piglit] [PATCH 3/3] ext_texture_array: add simple 1D/2D array rendering tests
Brian Paul
brianp at vmware.com
Thu Aug 7 12:10:24 PDT 2014
Yes, passes w/ llvmpipe and nvidia's driver.
-Brian
On 08/07/2014 11:43 AM, Ilia Mirkin wrote:
> Can I assume that you tested this on llvmpipe and it worked? I'm
> getting failures on render-1darray with nvc0, whereby layers 1+ are
> random data, but we pass all the regular texture lookup tests...
>
> On Fri, Aug 1, 2014 at 11:07 AM, Brian Paul <brianp at vmware.com> wrote:
>> Check that we're sampling from the expected array slices.
>> ---
>> .../render-1darray-1slice.shader_test | 35 +++++++++++++++
>> .../ext_texture_array/render-1darray.shader_test | 45 ++++++++++++++++++++
>> .../render-2darray-1slice.shader_test | 34 +++++++++++++++
>> .../ext_texture_array/render-2darray.shader_test | 44 +++++++++++++++++++
>> 4 files changed, 158 insertions(+)
>> create mode 100644 tests/spec/ext_texture_array/render-1darray-1slice.shader_test
>> create mode 100644 tests/spec/ext_texture_array/render-1darray.shader_test
>> create mode 100644 tests/spec/ext_texture_array/render-2darray-1slice.shader_test
>> create mode 100644 tests/spec/ext_texture_array/render-2darray.shader_test
>>
>> diff --git a/tests/spec/ext_texture_array/render-1darray-1slice.shader_test b/tests/spec/ext_texture_array/render-1darray-1slice.shader_test
>> new file mode 100644
>> index 0000000..f524c06
>> --- /dev/null
>> +++ b/tests/spec/ext_texture_array/render-1darray-1slice.shader_test
>> @@ -0,0 +1,35 @@
>> +# Test GL_TEXTURE_1D_ARRAY texture with just one layer
>> +[require]
>> +GLSL >= 1.10
>> +GL_EXT_texture_array
>> +
>> +[vertex shader]
>> +#version 110
>> +varying vec4 texcoords;
>> +void main() {
>> + gl_Position = gl_Vertex;
>> + texcoords = (gl_Vertex + 1.0) / 2.0;
>> +}
>> +
>> +[fragment shader]
>> +#version 110
>> +#extension GL_EXT_texture_array : enable
>> +varying vec4 texcoords;
>> +uniform sampler1DArray tex;
>> +uniform float layer;
>> +
>> +void main()
>> +{
>> + vec2 p = vec2(texcoords.x, layer);
>> + gl_FragColor = texture1DArray(tex, p);
>> +}
>> +
>> +[test]
>> +uniform int tex 0
>> +texture rgbw 1DArray 0 ( 64 , 1 )
>> +
>> +# layer=12 should get clamped to zero
>> +uniform float layer 12
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (1.0, 0.0, 0.0, 1.0)
>> +
>> diff --git a/tests/spec/ext_texture_array/render-1darray.shader_test b/tests/spec/ext_texture_array/render-1darray.shader_test
>> new file mode 100644
>> index 0000000..74b6154
>> --- /dev/null
>> +++ b/tests/spec/ext_texture_array/render-1darray.shader_test
>> @@ -0,0 +1,45 @@
>> +# Test GL_TEXTURE_1D_ARRAY texture with four layers
>> +[require]
>> +GLSL >= 1.10
>> +GL_EXT_texture_array
>> +
>> +[vertex shader]
>> +#version 110
>> +varying vec4 texcoords;
>> +void main() {
>> + gl_Position = gl_Vertex;
>> + texcoords = (gl_Vertex + 1.0) / 2.0;
>> +}
>> +
>> +[fragment shader]
>> +#version 110
>> +#extension GL_EXT_texture_array : enable
>> +varying vec4 texcoords;
>> +uniform sampler1DArray tex;
>> +uniform float layer;
>> +
>> +void main()
>> +{
>> + vec2 p = vec2(texcoords.x, layer);
>> + gl_FragColor = texture1DArray(tex, p);
>> +}
>> +
>> +[test]
>> +uniform int tex 0
>> +texture rgbw 1DArray 0 ( 64 , 4 )
>> +
>> +uniform float layer 0
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (1.0, 0.0, 0.0, 1.0)
>> +
>> +uniform float layer 1
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (0.0, 1.0, 0.0, 1.0)
>> +
>> +uniform float layer 2
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (0.0, 0.0, 1.0, 1.0)
>> +
>> +uniform float layer 3
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (1.0, 1.0, 1.0, 1.0)
>> diff --git a/tests/spec/ext_texture_array/render-2darray-1slice.shader_test b/tests/spec/ext_texture_array/render-2darray-1slice.shader_test
>> new file mode 100644
>> index 0000000..335436d
>> --- /dev/null
>> +++ b/tests/spec/ext_texture_array/render-2darray-1slice.shader_test
>> @@ -0,0 +1,34 @@
>> +# Test GL_TEXTURE_2D_ARRAY with just one slice
>> +[require]
>> +GLSL >= 1.10
>> +GL_EXT_texture_array
>> +
>> +[vertex shader]
>> +#version 110
>> +varying vec4 texcoords;
>> +void main() {
>> + gl_Position = gl_Vertex;
>> + texcoords = (gl_Vertex + 1.0) / 2.0;
>> +}
>> +
>> +[fragment shader]
>> +#version 110
>> +#extension GL_EXT_texture_array : enable
>> +varying vec4 texcoords;
>> +uniform sampler2DArray tex;
>> +uniform float layer;
>> +
>> +void main()
>> +{
>> + vec3 p = vec3(texcoords.xy, layer);
>> + gl_FragColor = texture2DArray(tex, p);
>> +}
>> +
>> +[test]
>> +uniform int tex 0
>> +texture rgbw 2DArray 0 (32, 32, 1)
>> +
>> +# layer=12 should get clamped to zero
>> +uniform float layer 12
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (1.0, 0.0, 0.0, 1.0)
>> diff --git a/tests/spec/ext_texture_array/render-2darray.shader_test b/tests/spec/ext_texture_array/render-2darray.shader_test
>> new file mode 100644
>> index 0000000..189bb13
>> --- /dev/null
>> +++ b/tests/spec/ext_texture_array/render-2darray.shader_test
>> @@ -0,0 +1,44 @@
>> +[require]
>> +GLSL >= 1.10
>> +GL_EXT_texture_array
>> +
>> +[vertex shader]
>> +#version 110
>> +varying vec4 texcoords;
>> +void main() {
>> + gl_Position = gl_Vertex;
>> + texcoords = (gl_Vertex + 1.0) / 2.0;
>> +}
>> +
>> +[fragment shader]
>> +#version 110
>> +#extension GL_EXT_texture_array : enable
>> +varying vec4 texcoords;
>> +uniform sampler2DArray tex;
>> +uniform float layer;
>> +
>> +void main()
>> +{
>> + vec3 p = vec3(texcoords.xy, layer);
>> + gl_FragColor = texture2DArray(tex, p);
>> +}
>> +
>> +[test]
>> +uniform int tex 0
>> +texture rgbw 2DArray 0 (32, 32, 4)
>> +
>> +uniform float layer 0
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (1.0, 0.0, 0.0, 1.0)
>> +
>> +uniform float layer 1
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (0.0, 1.0, 0.0, 1.0)
>> +
>> +uniform float layer 2
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (0.0, 0.0, 1.0, 1.0)
>> +
>> +uniform float layer 3
>> +draw rect -1 -1 2 2
>> +relative probe rgba (0.5, 0.5) (1.0, 1.0, 1.0, 1.0)
>> --
>> 1.7.10.4
>>
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=PZpMgwEYaKsGcz38B%2F8SmMROvtUzGe6roGVtBijDsmI%3D%0A&s=44e07c6670bb8d132b3d0d759182e6bcea8d4945ca05c056fe20af68c3602bfc
More information about the Piglit
mailing list