summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-01 12:24:30 -0600
committerBrian Paul <[email protected]>2009-09-01 17:39:30 -0600
commit92d63931e2c42ececaec33f68e1bc388764dd62e (patch)
treef9e5624c7e450fdc1747d13ec7cd36fc2a308e5b /src
parenta1e869b417745175e82377934619231363b1caba (diff)
mesa: obey stencil write mask in _mesa_meta_draw_pixels()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/common/meta.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index ec0da71fb95..965fb8697ed 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1429,6 +1429,7 @@ _mesa_meta_draw_pixels(GLcontext *ctx,
struct drawpix_state *drawpix = &ctx->Meta->DrawPix;
struct temp_texture *tex = get_temp_texture(ctx);
const struct gl_pixelstore_attrib unpackSave = ctx->Unpack;
+ const GLuint origStencilMask = ctx->Stencil.WriteMask[0];
GLfloat verts[4][5]; /* four verts of X,Y,Z,S,T */
GLenum texIntFormat;
GLboolean fallback, newTex;
@@ -1593,14 +1594,15 @@ _mesa_meta_draw_pixels(GLcontext *ctx,
for (bit = 0; bit < ctx->Visual.stencilBits; bit++) {
const GLuint mask = 1 << bit;
+ if (mask & origStencilMask) {
+ _mesa_StencilFunc(GL_ALWAYS, mask, mask);
+ _mesa_StencilMask(mask);
- _mesa_StencilFunc(GL_ALWAYS, mask, mask);
- _mesa_StencilMask(mask);
+ _mesa_ProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0,
+ 255.0 / mask, 0.5, 0.0, 0.0);
- _mesa_ProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0,
- 255.0 / mask, 0.5, 0.0, 0.0);
-
- _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ }
}
}
else if (_mesa_is_depth_format(format)) {