diff options
author | Dave Airlie <airlied@redhat.com> | 2009-04-09 10:14:35 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-04-09 10:31:08 +1000 |
commit | d1a9b1f513109c975a5a7ed5a2d0c329b280afe4 (patch) | |
tree | 5c85af47b4f5af0661acf129e3ce3f59e43cbfd9 /src/mesa/state_tracker/st_cb_texture.c | |
parent | 90ffce497395d8c02fee2ea4ee4c025eede3d876 (diff) | |
parent | 8648c2685870174cf620ef15de70ef030a8d5a20 (diff) |
Merge remote branch 'origin/master' into radeon-rewrite
Conflicts:
src/mesa/drivers/dri/r200/r200_tex.c
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_swtcl.c
src/mesa/drivers/dri/r300/r300_tex.c
src/mesa/drivers/dri/r300/r300_texmem.c
src/mesa/drivers/dri/r300/r300_texstate.c
src/mesa/drivers/dri/radeon/radeon_tex.c
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 311d812ccf..8013e69e8e 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -37,6 +37,7 @@ #include "main/pixel.h" #include "main/texcompress.h" #include "main/texformat.h" +#include "main/texgetimage.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/texstore.h" @@ -946,7 +947,8 @@ fallback_copy_texsubimage(GLcontext *ctx, texDest = st_texture_image_map(ctx->st, stImage, 0, PIPE_TRANSFER_WRITE, destX, destY, width, height); - if (baseFormat == GL_DEPTH_COMPONENT) { + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH24_STENCIL8) { const GLboolean scaleOrBias = (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F); GLint row, yStep; @@ -1056,7 +1058,8 @@ st_copy_texsubimage(GLcontext *ctx, st_finish(ctx->st); /* determine if copying depth or color data */ - if (texBaseFormat == GL_DEPTH_COMPONENT) { + if (texBaseFormat == GL_DEPTH_COMPONENT || + texBaseFormat == GL_DEPTH24_STENCIL8) { strb = st_renderbuffer(fb->_DepthBuffer); } else if (texBaseFormat == GL_DEPTH_STENCIL_EXT) { @@ -1471,9 +1474,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); |