From f6d34c20585ae9b4fb07ec2f2850f04dc9a9bc29 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 26 Aug 2009 11:53:25 -0600 Subject: 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 file changed, 12 insertions(+), 4 deletions(-) (limited to 'progs') diff --git a/progs/glsl/samplers.c b/progs/glsl/samplers.c index 113e5bbeff..87dad5d857 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; + } } } -- cgit v1.2.3 From 488b3c4d1bc3d830477180759a42dbaf8f5801b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 26 Aug 2009 11:55:15 -0600 Subject: progs/glsl: add special Makefile rule for samplers_array --- progs/glsl/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'progs') diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index eedd866c95..6af7a665cf 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -32,6 +32,7 @@ DEMO_SOURCES = \ pointcoord.c \ points.c \ samplers.c \ + samplers_array.c \ shadow_sampler.c \ skinning.c \ texaaline.c \ @@ -188,7 +189,8 @@ samplers.o: $(UTIL_HEADERS) samplers: samplers.o $(UTIL_OBJS) -samplers_array.o: $(UTIL_HEADERS) +samplers_array.o: samplers.c $(UTIL_HEADERS) + $(APP_CC) $(CFLAGS) -DSAMPLERS_ARRAY $< -c -o $@ samplers_array: samplers_array.o $(UTIL_OBJS) -- cgit v1.2.3