[Piglit] [PATCH 13/23] Port texture glsl tests from Glean to Piglit.
Fabian Bieler
fabianbieler at fastmail.fm
Thu Nov 23 20:46:05 UTC 2017
The following tests weren't ported because the functionality is already
tested in existing piglit tests:
"texture2D()"
shaders/glsl-fs-texture2d.shader_test
"texture2D(), with bias"
shaders/glsl-fs-texture2d-bias.shader_test
"2D Texture lookup with explicit lod (Vertex shader)"
shaders/glsl-fs-texturelod-01.shader_test
"texture2DProj()"
shaders/glsl-fs-texture2dproj.shader_test
"shadow2D(): [1234]"
spec/glsl-1.10/execution/samplers/glsl-fs-shadow2D-*.shader_test
---
.../spec/glsl-1.10/execution/texture1D.shader_test | 19 +++++++++++++++++++
.../texture2D-computed-coordinate.shader_test | 17 +++++++++++++++++
.../execution/texture3D-computed-coord.shader_test | 22 ++++++++++++++++++++++
.../spec/glsl-1.10/execution/texture3D.shader_test | 19 +++++++++++++++++++
4 files changed, 77 insertions(+)
create mode 100644 tests/spec/glsl-1.10/execution/texture1D.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/texture2D-computed-coordinate.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/texture3D-computed-coord.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/texture3D.shader_test
diff --git a/tests/spec/glsl-1.10/execution/texture1D.shader_test b/tests/spec/glsl-1.10/execution/texture1D.shader_test
new file mode 100644
index 0000000..0e17dfc
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/texture1D.shader_test
@@ -0,0 +1,19 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform sampler1D tex1d;
+void main()
+{
+ gl_FragColor = texture1D(tex1d, gl_TexCoord[0].x);
+}
+
+
+[test]
+uniform int tex1d 0
+texture rgbw 1D 0
+draw rect tex -1 -1 2 2 0 0 1 1
+relative probe rgba (0.125, 0.5) (1.0, 0.0, 0.0, 1.0)
+relative probe rgba (0.375, 0.5) (0.0, 1.0, 0.0, 1.0)
+relative probe rgba (0.625, 0.5) (0.0, 0.0, 1.0, 1.0)
+relative probe rgba (0.875, 0.5) (1.0, 1.0, 1.0, 1.0)
diff --git a/tests/spec/glsl-1.10/execution/texture2D-computed-coordinate.shader_test b/tests/spec/glsl-1.10/execution/texture2D-computed-coordinate.shader_test
new file mode 100644
index 0000000..0074434
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/texture2D-computed-coordinate.shader_test
@@ -0,0 +1,17 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform sampler2D tex2d;
+void main()
+{
+ vec2 coord = gl_TexCoord[0].xy + vec2(0.5);
+ gl_FragColor = texture2D(tex2d, coord, 0.0);
+}
+
+
+[test]
+texture rgbw 0 (8, 8)
+uniform int tex2d 0
+draw rect tex -1 -1 2 2 0 0 1 1
+relative probe rgba (0.5, 0.5) (1.0, 1.0, 1.0, 1.0)
diff --git a/tests/spec/glsl-1.10/execution/texture3D-computed-coord.shader_test b/tests/spec/glsl-1.10/execution/texture3D-computed-coord.shader_test
new file mode 100644
index 0000000..34b2e58
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/texture3D-computed-coord.shader_test
@@ -0,0 +1,22 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform sampler3D tex3d;
+void main()
+{
+ vec3 coord = gl_TexCoord[0].xyz;
+ coord.y = 0.25;
+ coord.z = 0.75;
+ gl_FragColor = texture3D(tex3d, coord);
+}
+
+
+[test]
+uniform int tex3d 0
+texture rgbw 3D 0
+draw rect tex -1 -1 2 2 0 0 1 1
+relative probe rgba (0.25, 0.25) (1.0, 1.0, 0.0, 1.0)
+relative probe rgba (0.75, 0.25) (1.0, 0.0, 1.0, 1.0)
+relative probe rgba (0.25, 0.75) (1.0, 1.0, 0.0, 1.0)
+relative probe rgba (0.75, 0.75) (1.0, 0.0, 1.0, 1.0)
diff --git a/tests/spec/glsl-1.10/execution/texture3D.shader_test b/tests/spec/glsl-1.10/execution/texture3D.shader_test
new file mode 100644
index 0000000..b873a2c
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/texture3D.shader_test
@@ -0,0 +1,19 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform sampler3D tex3d;
+void main()
+{
+ gl_FragColor = texture3D(tex3d, gl_TexCoord[0].xyz);
+}
+
+
+[test]
+uniform int tex3d 0
+texture rgbw 3D 0
+draw rect tex -1 -1 2 2 0 0 1 1
+relative probe rgba (0.25, 0.25) (1.0, 0.0, 0.0, 1.0)
+relative probe rgba (0.75, 0.25) (0.0, 1.0, 0.0, 1.0)
+relative probe rgba (0.25, 0.75) (0.0, 0.0, 1.0, 1.0)
+relative probe rgba (0.75, 0.75) (1.0, 1.0, 1.0, 1.0)
--
2.7.4
More information about the Piglit
mailing list