glsl-array-bounds: set out-of-bounds array index inside shader
[piglit.git] / tests / shaders / glsl-fs-texturelod-01.shader_test
blobf5ea392c08ae2c0ebfd702a4d771c62c8f0d73a0
1 [require]
2 GLSL >= 1.20
3 require GL_ARB_shader_texture_lod
5 [vertex shader]
6 #version 120
8 varying vec2 texcoord;
10 void main()
12        texcoord = (vec2(gl_Vertex) + 1.0) / 2.0;
13        gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
16 [fragment shader]
17 #version 120
18 #extension GL_ARB_shader_texture_lod: enable
20 uniform sampler2D sampler;
21 uniform float lod;
23 varying vec2 texcoord;
25 void main()
27        gl_FragColor = texture2DLod(sampler, texcoord, lod);
30 [test]
31 ortho
32 clear color 0.4 0.4 0.4 0.0
33 clear
34 uniform int sampler 0
35 texture miptree 0
36 texparameter 2D min nearest_mipmap_nearest
37 texparameter 2D mag nearest
39 uniform float lod 0
40 draw rect 10 10 10 10
41 probe rgb 15 15 1.0 0.0 0.0
43 uniform float lod 1
44 draw rect 30 10 10 10
45 probe rgb 35 15 0.0 1.0 0.0
47 uniform float lod 2
48 draw rect 50 10 10 10
49 probe rgb 55 15 0.0 0.0 1.0
51 uniform float lod 3
52 draw rect 70 10 10 10
53 probe rgb 75 15 1.0 1.0 1.0