summaryrefslogtreecommitdiffstats
path: root/progs/glsl/samplers.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-08-26 11:53:25 -0600
committerBrian Paul <[email protected]>2009-08-26 11:53:25 -0600
commitf6d34c20585ae9b4fb07ec2f2850f04dc9a9bc29 (patch)
treefdc6d0952fe2d47be0e7dce5feb3e53e2831ad2d /progs/glsl/samplers.c
parent04d170794a22d93d58afeb5d0930e06f85964f9a (diff)
progs/glsl: change samplers.c to better test sampler/texture indexing
Now the left half is yellow and the right half is red, with the gradients going in opposite directions.
Diffstat (limited to 'progs/glsl/samplers.c')
-rw-r--r--progs/glsl/samplers.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/progs/glsl/samplers.c b/progs/glsl/samplers.c
index 113e5bbeff1..87dad5d8575 100644
--- a/progs/glsl/samplers.c
+++ b/progs/glsl/samplers.c
@@ -211,10 +211,18 @@ InitTextures(void)
for (y = 0; y < stripeSize; y++) {
for (x = 0; x < size; x++) {
GLint k = 4 * ((ypos + y) * size + x);
- texImage[k + 0] = intensity;
- texImage[k + 1] = intensity;
- texImage[k + 2] = 0;
- texImage[k + 3] = 255;
+ if (x < size / 2) {
+ texImage[k + 0] = intensity;
+ texImage[k + 1] = intensity;
+ texImage[k + 2] = 0;
+ texImage[k + 3] = 255;
+ }
+ else {
+ texImage[k + 0] = 255 - intensity;
+ texImage[k + 1] = 0;
+ texImage[k + 2] = 0;
+ texImage[k + 3] = 255;
+ }
}
}