summaryrefslogtreecommitdiff
path: root/tests/shaders/glsl-fs-texturelod-01.shader_test
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-04-03 22:46:40 -0700
committerKenneth Graunke <kenneth@whitecape.org>2012-04-17 12:21:38 -0700
commiteb6469f63dca0b9c61d214c257c7804882a265be (patch)
treeb9dcaf48fb8f5f243ce445777263b6127ee38922 /tests/shaders/glsl-fs-texturelod-01.shader_test
parent6f9dfdc08e7b1f75c2fea1e140684f00d562dad4 (diff)
Rewrite glsl-fs-texturelod-01 as a shader_runner test.
This is quite a bit simpler. Technically, I don't need to set the min/mag filters here since "texture miptree" does it already, but it's self-documenting to include that in the test itself. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'tests/shaders/glsl-fs-texturelod-01.shader_test')
-rw-r--r--tests/shaders/glsl-fs-texturelod-01.shader_test53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/shaders/glsl-fs-texturelod-01.shader_test b/tests/shaders/glsl-fs-texturelod-01.shader_test
new file mode 100644
index 000000000..f5ea392c0
--- /dev/null
+++ b/tests/shaders/glsl-fs-texturelod-01.shader_test
@@ -0,0 +1,53 @@
+[require]
+GLSL >= 1.20
+require GL_ARB_shader_texture_lod
+
+[vertex shader]
+#version 120
+
+varying vec2 texcoord;
+
+void main()
+{
+ texcoord = (vec2(gl_Vertex) + 1.0) / 2.0;
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_shader_texture_lod: enable
+
+uniform sampler2D sampler;
+uniform float lod;
+
+varying vec2 texcoord;
+
+void main()
+{
+ gl_FragColor = texture2DLod(sampler, texcoord, lod);
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0.0
+clear
+uniform int sampler 0
+texture miptree 0
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+
+uniform float lod 0
+draw rect 10 10 10 10
+probe rgb 15 15 1.0 0.0 0.0
+
+uniform float lod 1
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform float lod 2
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 0.0 1.0
+
+uniform float lod 3
+draw rect 70 10 10 10
+probe rgb 75 15 1.0 1.0 1.0