Module: Mesa Branch: master Commit: f6d34c20585ae9b4fb07ec2f2850f04dc9a9bc29 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6d34c20585ae9b4fb07ec2f2850f04dc9a9bc29
Author: Brian Paul <bri...@vmware.com> Date: Wed Aug 26 11:53:25 2009 -0600 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. --- progs/glsl/samplers.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/progs/glsl/samplers.c b/progs/glsl/samplers.c index 113e5bb..87dad5d 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; + } } } _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit