[Piglit] [PATCH 5/5] arb_texture_query_levels: add execution tests
Chris Forbes
chrisf at ijw.co.nz
Sat Oct 5 06:08:48 CEST 2013
Ensure that the returned level count is correct in various situations.
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
.../execution/fs-baselevel.shader_test | 40 +++++++++++++++++++
.../execution/fs-maxlevel.shader_test | 40 +++++++++++++++++++
.../execution/fs-miptree.shader_test | 39 +++++++++++++++++++
.../execution/fs-nomips.shader_test | 39 +++++++++++++++++++
.../execution/vs-baselevel.shader_test | 44 +++++++++++++++++++++
.../execution/vs-maxlevel.shader_test | 45 ++++++++++++++++++++++
.../execution/vs-miptree.shader_test | 43 +++++++++++++++++++++
.../execution/vs-nomips.shader_test | 43 +++++++++++++++++++++
8 files changed, 333 insertions(+)
create mode 100644 tests/spec/arb_texture_query_levels/execution/fs-baselevel.shader_test
create mode 100644 tests/spec/arb_texture_query_levels/execution/fs-maxlevel.shader_test
create mode 100644 tests/spec/arb_texture_query_levels/execution/fs-miptree.shader_test
create mode 100644 tests/spec/arb_texture_query_levels/execution/fs-nomips.shader_test
create mode 100644 tests/spec/arb_texture_query_levels/execution/vs-baselevel.shader_test
create mode 100644 tests/spec/arb_texture_query_levels/execution/vs-maxlevel.shader_test
create mode 100644 tests/spec/arb_texture_query_levels/execution/vs-miptree.shader_test
create mode 100644 tests/spec/arb_texture_query_levels/execution/vs-nomips.shader_test
diff --git a/tests/spec/arb_texture_query_levels/execution/fs-baselevel.shader_test b/tests/spec/arb_texture_query_levels/execution/fs-baselevel.shader_test
new file mode 100644
index 0000000..0dfee0c
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/fs-baselevel.shader_test
@@ -0,0 +1,40 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_texture_query_levels: require
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ if (textureQueryLevels(s) == expected)
+ gl_FragColor = vec4(0,1,0,0);
+ else
+ gl_FragColor = vec4(1,0,0,0);
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+texparameter 2D base_level 1
+
+uniform int expected 3
+
+draw rect 0 -1 1 1
+relative probe rgba (0.75, 0.25) (0, 1, 0, 0)
diff --git a/tests/spec/arb_texture_query_levels/execution/fs-maxlevel.shader_test b/tests/spec/arb_texture_query_levels/execution/fs-maxlevel.shader_test
new file mode 100644
index 0000000..4ab9d23
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/fs-maxlevel.shader_test
@@ -0,0 +1,40 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_texture_query_levels: require
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ if (textureQueryLevels(s) == expected)
+ gl_FragColor = vec4(0,1,0,0);
+ else
+ gl_FragColor = vec4(1,0,0,0);
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+texparameter 2D max_level 2
+
+uniform int expected 3
+
+draw rect 0 -1 1 1
+relative probe rgba (0.75, 0.25) (0, 1, 0, 0)
diff --git a/tests/spec/arb_texture_query_levels/execution/fs-miptree.shader_test b/tests/spec/arb_texture_query_levels/execution/fs-miptree.shader_test
new file mode 100644
index 0000000..8f90e26
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/fs-miptree.shader_test
@@ -0,0 +1,39 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_texture_query_levels: require
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ if (textureQueryLevels(s) == expected)
+ gl_FragColor = vec4(0,1,0,0);
+ else
+ gl_FragColor = vec4(1,0,0,0);
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+
+uniform int expected 4
+
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0, 1, 0, 0)
diff --git a/tests/spec/arb_texture_query_levels/execution/fs-nomips.shader_test b/tests/spec/arb_texture_query_levels/execution/fs-nomips.shader_test
new file mode 100644
index 0000000..d4ef9c2
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/fs-nomips.shader_test
@@ -0,0 +1,39 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_texture_query_levels: require
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ if (textureQueryLevels(s) == expected)
+ gl_FragColor = vec4(0,1,0,0);
+ else
+ gl_FragColor = vec4(1,0,0,0);
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+uniform int expected 1
+
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0, 1, 0, 0)
diff --git a/tests/spec/arb_texture_query_levels/execution/vs-baselevel.shader_test b/tests/spec/arb_texture_query_levels/execution/vs-baselevel.shader_test
new file mode 100644
index 0000000..7e866b0
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/vs-baselevel.shader_test
@@ -0,0 +1,44 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+#extension GL_ARB_texture_query_levels: require
+
+in vec4 vertex;
+out vec4 color;
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ gl_Position = vertex;
+ if (textureQueryLevels(s) == expected)
+ color = vec4(0,1,0,0);
+ else
+ color = vec4(1,0,0,0);
+}
+
+[fragment shader]
+in vec4 color;
+
+void main() {
+ gl_FragColor = color;
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+texparameter 2D base_level 1
+
+uniform int expected 3
+
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0, 1, 0, 0)
diff --git a/tests/spec/arb_texture_query_levels/execution/vs-maxlevel.shader_test b/tests/spec/arb_texture_query_levels/execution/vs-maxlevel.shader_test
new file mode 100644
index 0000000..ecd56bc
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/vs-maxlevel.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+#extension GL_ARB_texture_query_levels: require
+
+in vec4 vertex;
+out vec4 color;
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ gl_Position = vertex;
+ if (textureQueryLevels(s) == expected)
+ color = vec4(0,1,0,0);
+ else
+ color = vec4(1,0,0,0);
+}
+
+[fragment shader]
+in vec4 color;
+
+void main() {
+ gl_FragColor = color;
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+texparameter 2D base_level 0
+texparameter 2D max_level 2
+
+uniform int expected 3
+
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0, 1, 0, 0)
diff --git a/tests/spec/arb_texture_query_levels/execution/vs-miptree.shader_test b/tests/spec/arb_texture_query_levels/execution/vs-miptree.shader_test
new file mode 100644
index 0000000..55b725d
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/vs-miptree.shader_test
@@ -0,0 +1,43 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+#extension GL_ARB_texture_query_levels: require
+
+in vec4 vertex;
+out vec4 color;
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ gl_Position = vertex;
+ if (textureQueryLevels(s) == expected)
+ color = vec4(0,1,0,0);
+ else
+ color = vec4(1,0,0,0);
+}
+
+[fragment shader]
+in vec4 color;
+
+void main() {
+ gl_FragColor = color;
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+
+uniform int expected 4
+
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0, 1, 0, 0)
diff --git a/tests/spec/arb_texture_query_levels/execution/vs-nomips.shader_test b/tests/spec/arb_texture_query_levels/execution/vs-nomips.shader_test
new file mode 100644
index 0000000..904d506
--- /dev/null
+++ b/tests/spec/arb_texture_query_levels/execution/vs-nomips.shader_test
@@ -0,0 +1,43 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_query_levels
+
+[vertex shader]
+#extension GL_ARB_texture_query_levels: require
+
+in vec4 vertex;
+out vec4 color;
+
+uniform sampler2D s;
+uniform int expected;
+
+void main() {
+ gl_Position = vertex;
+ if (textureQueryLevels(s) == expected)
+ color = vec4(0,1,0,0);
+ else
+ color = vec4(1,0,0,0);
+}
+
+[fragment shader]
+in vec4 color;
+
+void main() {
+ gl_FragColor = color;
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0
+clear
+
+texture miptree 0
+uniform int s 0
+
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+uniform int expected 1
+
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0, 1, 0, 0)
--
1.8.4
More information about the Piglit
mailing list