[Piglit] [PATCH] GL_ARB_fragment_program: Add some shader_runner texturing tests.

Eric Anholt eric at anholt.net
Sat Sep 22 13:34:13 PDT 2012


---
 .../texturing/tex-2d.shader_test                   |   37 +++++++++++++++++
 .../texturing/txb-2d.shader_test                   |   42 ++++++++++++++++++++
 .../texturing/txp-2d.shader_test                   |   36 +++++++++++++++++
 .../tex-shadow1d.shader_test                       |   35 ++++++++++++++++
 .../tex-shadow2d.shader_test                       |   35 ++++++++++++++++
 .../tex-shadow2drect.shader_test                   |   36 +++++++++++++++++
 .../txp-shadow1d.shader_test                       |   35 ++++++++++++++++
 .../txp-shadow2d.shader_test                       |   34 ++++++++++++++++
 .../txp-shadow2drect.shader_test                   |   36 +++++++++++++++++
 9 files changed, 326 insertions(+)
 create mode 100644 tests/spec/arb_fragment_program/texturing/tex-2d.shader_test
 create mode 100644 tests/spec/arb_fragment_program/texturing/txb-2d.shader_test
 create mode 100644 tests/spec/arb_fragment_program/texturing/txp-2d.shader_test
 create mode 100644 tests/spec/arb_fragment_program_shadow/tex-shadow1d.shader_test
 create mode 100644 tests/spec/arb_fragment_program_shadow/tex-shadow2d.shader_test
 create mode 100644 tests/spec/arb_fragment_program_shadow/tex-shadow2drect.shader_test
 create mode 100644 tests/spec/arb_fragment_program_shadow/txp-shadow1d.shader_test
 create mode 100644 tests/spec/arb_fragment_program_shadow/txp-shadow2d.shader_test
 create mode 100644 tests/spec/arb_fragment_program_shadow/txp-shadow2drect.shader_test

diff --git a/tests/spec/arb_fragment_program/texturing/tex-2d.shader_test b/tests/spec/arb_fragment_program/texturing/tex-2d.shader_test
new file mode 100644
index 0000000..c5ba1ba
--- /dev/null
+++ b/tests/spec/arb_fragment_program/texturing/tex-2d.shader_test
@@ -0,0 +1,37 @@
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xy, vertex.position, {1}.x;
+MUL texcoord.xy, texcoord.xyyy, {0.5}.x;
+MOV texcoord.z, {0}.x;
+MOV texcoord.w, {0}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+TEX result.color, fragment.texcoord[0], texture[0], 2D;
+END
+
+[test]
+
+texture rgbw 0 (8, 8)
+draw rect -1 -1 2 2
+
+# tests pixels at the corners, and somewhere near the center in case
+# the projection goes wrong.
+
+relative probe rgba (0.0, 0.0) (1.0, 0.0, 0.0, 1.0)
+relative probe rgba (0.4, 0.4) (1.0, 0.0, 0.0, 1.0)
+
+relative probe rgba (1.0, 0.0) (0.0, 1.0, 0.0, 1.0)
+relative probe rgba (0.6, 0.4) (0.0, 1.0, 0.0, 1.0)
+
+relative probe rgba (0.0, 1.0) (0.0, 0.0, 1.0, 1.0)
+relative probe rgba (0.4, 0.6) (0.0, 0.0, 1.0, 1.0)
+
+relative probe rgba (1.0, 1.0) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.6, 0.6) (1.0, 1.0, 1.0, 1.0)
diff --git a/tests/spec/arb_fragment_program/texturing/txb-2d.shader_test b/tests/spec/arb_fragment_program/texturing/txb-2d.shader_test
new file mode 100644
index 0000000..5e08257
--- /dev/null
+++ b/tests/spec/arb_fragment_program/texturing/txb-2d.shader_test
@@ -0,0 +1,42 @@
+[vertex program]
+!!ARBvp1.0
+OPTION ARB_position_invariant;
+TEMP texcoord;
+
+ADD texcoord.xy, vertex.position, program.env[0].xyyy;
+MUL texcoord.xy, texcoord.xyyy, program.env[0].z;
+MOV texcoord.z, {0}.x;
+MOV texcoord.w, {1}.x;
+
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+TXB result.color, fragment.texcoord[0], texture[0], 2D;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+ortho
+
+# 8x8 miptree, levels are (red, green, blue, white)
+texture miptree 0
+
+parameter env_vp 0 (-1.0,  -1.0, 0.0625, 0.0)
+draw rect 01 1 16 16
+parameter env_vp 0 (-21.0, -1.0, 0.125,  0.0)
+draw rect 21 1 8 8
+parameter env_vp 0 (-41.0, -1.0, 0.25,  0.0)
+draw rect 41 1 4 4
+parameter env_vp 0 (-61.0, -1.0, 0.5,  0.0)
+draw rect 61 1 2 2
+parameter env_vp 0 (-81.0, -1.0, 1.0,  0.0)
+draw rect 81 1 1 1
+
+probe rgba  1  1 1.0 0.0 0.0 1.0
+probe rgba 21  1 0.0 1.0 0.0 1.0
+probe rgba 41  1 0.0 0.0 1.0 1.0
+probe rgba 61  1 1.0 1.0 1.0 1.0
+probe rgba 81  1 1.0 1.0 1.0 1.0
diff --git a/tests/spec/arb_fragment_program/texturing/txp-2d.shader_test b/tests/spec/arb_fragment_program/texturing/txp-2d.shader_test
new file mode 100644
index 0000000..85c0dbb
--- /dev/null
+++ b/tests/spec/arb_fragment_program/texturing/txp-2d.shader_test
@@ -0,0 +1,36 @@
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xy, vertex.position, {1}.x;
+MOV texcoord.z, {0}.x;
+MOV texcoord.w, {2}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+TXP result.color, fragment.texcoord[0], texture[0], 2D;
+END
+
+[test]
+
+texture rgbw 0 (8, 8)
+draw rect -1 -1 2 2
+
+# tests pixels at the corners, and somewhere near the center in case
+# the projection goes wrong.
+
+relative probe rgba (0.0, 0.0) (1.0, 0.0, 0.0, 1.0)
+relative probe rgba (0.4, 0.4) (1.0, 0.0, 0.0, 1.0)
+
+relative probe rgba (1.0, 0.0) (0.0, 1.0, 0.0, 1.0)
+relative probe rgba (0.6, 0.4) (0.0, 1.0, 0.0, 1.0)
+
+relative probe rgba (0.0, 1.0) (0.0, 0.0, 1.0, 1.0)
+relative probe rgba (0.4, 0.6) (0.0, 0.0, 1.0, 1.0)
+
+relative probe rgba (1.0, 1.0) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.6, 0.6) (1.0, 1.0, 1.0, 1.0)
diff --git a/tests/spec/arb_fragment_program_shadow/tex-shadow1d.shader_test b/tests/spec/arb_fragment_program_shadow/tex-shadow1d.shader_test
new file mode 100644
index 0000000..967d23b
--- /dev/null
+++ b/tests/spec/arb_fragment_program_shadow/tex-shadow1d.shader_test
@@ -0,0 +1,35 @@
+[require]
+GL_ARB_texture_rectangle
+GL_ARB_fragment_program_shadow
+
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xz, vertex.position.xyyy, {1}.x;
+MUL texcoord.xz, texcoord, {0.5}.x;
+MOV texcoord.yw, {0}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fragment_program_shadow;
+TEX result.color, fragment.texcoord[0], texture[0], SHADOW1D;
+END
+
+[test]
+texture shadow1D 0 (32)
+texparameter 1D depth_mode luminance
+texparameter 1D compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_fragment_program_shadow/tex-shadow2d.shader_test b/tests/spec/arb_fragment_program_shadow/tex-shadow2d.shader_test
new file mode 100644
index 0000000..1dfa8ef
--- /dev/null
+++ b/tests/spec/arb_fragment_program_shadow/tex-shadow2d.shader_test
@@ -0,0 +1,35 @@
+[require]
+GL_ARB_texture_rectangle
+GL_ARB_fragment_program_shadow
+
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xyz, vertex.position.xyyy, {1}.x;
+MUL texcoord.xyz, texcoord, {0.5}.x;
+MOV texcoord.w, {0}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fragment_program_shadow;
+TEX result.color, fragment.texcoord[0], texture[0], SHADOW2D;
+END
+
+[test]
+texture shadow2D 0 (32, 32)
+texparameter 2D depth_mode luminance
+texparameter 2D compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_fragment_program_shadow/tex-shadow2drect.shader_test b/tests/spec/arb_fragment_program_shadow/tex-shadow2drect.shader_test
new file mode 100644
index 0000000..91a5be2
--- /dev/null
+++ b/tests/spec/arb_fragment_program_shadow/tex-shadow2drect.shader_test
@@ -0,0 +1,36 @@
+[require]
+GL_ARB_texture_rectangle
+GL_ARB_fragment_program_shadow
+
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xyz, vertex.position.xyyy, {1}.x;
+MUL texcoord.xy, texcoord, {16}.x;
+MUL texcoord.z, texcoord, {0.5}.x;
+MOV texcoord.w, {0}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fragment_program_shadow;
+TEX result.color, fragment.texcoord[0], texture[0], SHADOWRECT;
+END
+
+[test]
+texture shadowRect 0 (32, 32)
+texparameter Rect depth_mode luminance
+texparameter Rect compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_fragment_program_shadow/txp-shadow1d.shader_test b/tests/spec/arb_fragment_program_shadow/txp-shadow1d.shader_test
new file mode 100644
index 0000000..732cc4b
--- /dev/null
+++ b/tests/spec/arb_fragment_program_shadow/txp-shadow1d.shader_test
@@ -0,0 +1,35 @@
+[require]
+GL_ARB_texture_rectangle
+GL_ARB_fragment_program_shadow
+
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xz, vertex.position.xyyy, {1}.x;
+MOV texcoord.y, {0}.x;
+MOV texcoord.w, {2}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fragment_program_shadow;
+TXP result.color, fragment.texcoord[0], texture[0], SHADOW1D;
+END
+
+[test]
+texture shadow1D 0 (32)
+texparameter 1D depth_mode luminance
+texparameter 1D compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_fragment_program_shadow/txp-shadow2d.shader_test b/tests/spec/arb_fragment_program_shadow/txp-shadow2d.shader_test
new file mode 100644
index 0000000..174baf2
--- /dev/null
+++ b/tests/spec/arb_fragment_program_shadow/txp-shadow2d.shader_test
@@ -0,0 +1,34 @@
+[require]
+GL_ARB_texture_rectangle
+GL_ARB_fragment_program_shadow
+
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xyz, vertex.position.xyyy, {1}.x;
+MOV texcoord.w, {2}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fragment_program_shadow;
+TXP result.color, fragment.texcoord[0], texture[0], SHADOW2D;
+END
+
+[test]
+texture shadow2D 0 (32, 32)
+texparameter 2D depth_mode luminance
+texparameter 2D compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_fragment_program_shadow/txp-shadow2drect.shader_test b/tests/spec/arb_fragment_program_shadow/txp-shadow2drect.shader_test
new file mode 100644
index 0000000..30d4b77
--- /dev/null
+++ b/tests/spec/arb_fragment_program_shadow/txp-shadow2drect.shader_test
@@ -0,0 +1,36 @@
+[require]
+GL_ARB_texture_rectangle
+GL_ARB_fragment_program_shadow
+
+[vertex program]
+!!ARBvp1.0
+TEMP texcoord;
+
+ADD texcoord.xyz, vertex.position.xyyy, {1}.x;
+MUL texcoord.xy, texcoord, {32}.x;
+MUL texcoord.z, texcoord, {1.0}.x;
+MOV texcoord.w, {2}.x;
+
+MOV result.position, vertex.position;
+MOV result.texcoord[0], texcoord;
+END
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fragment_program_shadow;
+TXP result.color, fragment.texcoord[0], texture[0], SHADOWRECT;
+END
+
+[test]
+texture shadowRect 0 (32, 32)
+texparameter Rect depth_mode luminance
+texparameter Rect compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
-- 
1.7.10.4



More information about the Piglit mailing list