summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-03-26 08:52:56 -0600
committerBrian Paul <[email protected]>2009-03-26 08:52:56 -0600
commit2002e03a5232c54988161cb629966bdce19d35de (patch)
tree1af7ff5126ae7be783958be80e21008d902eba80 /src/mesa/state_tracker
parent3673189326e348eb91e354017703fdfd9d6d8184 (diff)
st: init the default texture to (0,0,0,1)
The default texture is used when a sampler uses an incomplete texture. This change fixes the piglit fp-incomplete test.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 311d812ccfb..d353241a7eb 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1471,9 +1471,19 @@ st_get_default_texture(struct st_context *st)
GLubyte pixels[16][16][4];
struct gl_texture_object *texObj;
struct gl_texture_image *texImg;
+ GLuint i, j;
- /* init image to gray */
- memset(pixels, 127, sizeof(pixels));
+ /* The ARB_fragment_program spec says (0,0,0,1) should be returned
+ * when attempting to sample incomplete textures.
+ */
+ for (i = 0; i < 16; i++) {
+ for (j = 0; j < 16; j++) {
+ pixels[i][j][0] = 0;
+ pixels[i][j][1] = 0;
+ pixels[i][j][2] = 0;
+ pixels[i][j][3] = 255;
+ }
+ }
texObj = st->ctx->Driver.NewTextureObject(st->ctx, 0, target);