diff options
Diffstat (limited to 'tests/shaders/glsl-fs-sampler-numbering-3.shader_test')
-rw-r--r-- | tests/shaders/glsl-fs-sampler-numbering-3.shader_test | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/shaders/glsl-fs-sampler-numbering-3.shader_test b/tests/shaders/glsl-fs-sampler-numbering-3.shader_test new file mode 100644 index 000000000..35090ab1d --- /dev/null +++ b/tests/shaders/glsl-fs-sampler-numbering-3.shader_test @@ -0,0 +1,50 @@ +[require] +GL >= 2.0 +GLSL >= 1.10 + +[vertex shader] +varying vec2 texcoords; +uniform float yoffset; + +void main() +{ + gl_Position = gl_Vertex; + texcoords = gl_Vertex.xy + vec2(0.0, yoffset); +} + +[fragment shader] +varying vec2 texcoords; +uniform sampler2D tex[2]; + +void main() +{ + if (texcoords.x < 0.0) { + gl_FragColor = texture2D(tex[0], texcoords.xy + vec2(1.0, 0.0)); + } else { + gl_FragColor = texture2D(tex[1], texcoords.xy); + } +} + +[test] +texture checkerboard 0 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texture checkerboard 1 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) + +uniform int tex[0] 0 +uniform int tex[1] 1 +uniform float yoffset 1.0 +draw rect -1 -1 2 1 + +uniform int tex[0] 1 +uniform int tex[1] 0 +uniform float yoffset 0.0 +draw rect -1 0 2 1 + +relative probe rgb (0.375, 0.125) (0.0, 1.0, 0.0) +relative probe rgb (0.125, 0.375) (0.0, 1.0, 0.0) +relative probe rgb (0.875, 0.625) (0.0, 1.0, 0.0) +relative probe rgb (0.675, 0.875) (0.0, 1.0, 0.0) + +relative probe rgb (0.875, 0.125) (1.0, 0.0, 0.0) +relative probe rgb (0.625, 0.375) (1.0, 0.0, 0.0) +relative probe rgb (0.375, 0.625) (1.0, 0.0, 0.0) +relative probe rgb (0.125, 0.875) (1.0, 0.0, 0.0) |