[Piglit] [PATCH 03/10] ARB_texture_gather: add new test for miplevel behavior

Chris Forbes chrisf at ijw.co.nz
Tue Oct 15 10:47:05 CEST 2013


textureGather always samples the base level, regardless of what
filtering modes are set.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 .../arb_texture_gather-miplevels.shader_test       | 81 ++++++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 tests/shaders/arb_texture_gather-miplevels.shader_test

diff --git a/tests/shaders/arb_texture_gather-miplevels.shader_test b/tests/shaders/arb_texture_gather-miplevels.shader_test
new file mode 100644
index 0000000..88d5f8d
--- /dev/null
+++ b/tests/shaders/arb_texture_gather-miplevels.shader_test
@@ -0,0 +1,81 @@
+[require]
+GLSL >= 1.30
+GL_ARB_texture_gather
+
+[vertex shader file]
+glsl-mvp.vert
+
+[fragment shader]
+#extension GL_ARB_texture_gather: require
+/* Verify that gather4 always samples from the base level of a mipmapped texture */
+
+uniform sampler2D tex;
+
+void main()
+{
+   gl_FragColor = textureGather(tex, vec2(0.5, 0.5));
+}
+
+[test]
+uniform int tex 0
+texture miptree 0
+texparameter 2D min linear_mipmap_linear
+texparameter 2D mag nearest
+
+texparameter 2D base_level 0
+
+texparameter 2D swizzle_r red
+draw rect -1 -1 0.5 0.5
+relative probe rgb (0.125, 0.125) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 -1 0.5 0.5
+relative probe rgb (0.375, 0.125) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r blue
+draw rect 0 -1 0.5 0.5
+relative probe rgb (0.625, 0.125) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 -1 0.5 0.5
+relative probe rgb (0.875, 0.125) (1.0, 1.0, 1.0)
+
+texparameter 2D base_level 1
+
+texparameter 2D swizzle_r red
+draw rect -1 -0.5 0.5 0.5
+relative probe rgb (0.125, 0.375) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 -0.5 0.5 0.5
+relative probe rgb (0.375, 0.375) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r blue
+draw rect 0 -0.5 0.5 0.5
+relative probe rgb (0.625, 0.375) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 -0.5 0.5 0.5
+relative probe rgb (0.875, 0.375) (1.0, 1.0, 1.0)
+
+texparameter 2D base_level 2
+texparameter 2D swizzle_r red
+draw rect -1 0 0.5 0.5
+relative probe rgb (0.125, 0.625) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 0 0.5 0.5
+relative probe rgb (0.375, 0.625) (0.0, 0.0, 0.0)
+texparameter 2D swizzle_r blue
+draw rect 0 0 0.5 0.5
+relative probe rgb (0.625, 0.625) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 0 0.5 0.5
+relative probe rgb (0.875, 0.625) (1.0, 1.0, 1.0)
+
+texparameter 2D base_level 3
+texparameter 2D swizzle_r red
+draw rect -1 0.5 0.5 0.5
+relative probe rgb (0.125, 0.875) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r green
+draw rect -0.5 0.5 0.5 0.5
+relative probe rgb (0.375, 0.875) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r blue
+draw rect 0 0.5 0.5 0.5
+relative probe rgb (0.625, 0.875) (1.0, 1.0, 1.0)
+texparameter 2D swizzle_r alpha
+draw rect 0.5 0.5 0.5 0.5
+relative probe rgb (0.875, 0.875) (1.0, 1.0, 1.0)
-- 
1.8.4



More information about the Piglit mailing list