From: Michel D. <da...@vm...> - 2009-04-07 10:00:25
|
Fixes colour buffer of some 3D applications running in VMware workstation guests not getting cleared. --- src/mesa/drivers/dri/intel/intel_clear.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 28281b3..232c757 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -185,7 +185,7 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) color_bit = _mesa_ffs(mask & TRI_CLEAR_COLOR_BITS); if (color_bit != 0) - this_mask |= (1 << (color_bit - 1)); + this_mask |= 1 << color_bit; /* Clear depth/stencil in the same pass as color. */ this_mask |= (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)); @@ -323,11 +323,12 @@ intelClear(GLcontext *ctx, GLbitfield mask) /* If we're doing a tri pass for depth/stencil, include a likely color * buffer with it. */ - if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) { + if (tri_mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL) && + !(tri_mask & TRI_CLEAR_COLOR_BITS)) { int color_bit = _mesa_ffs(mask & TRI_CLEAR_COLOR_BITS); if (color_bit != 0) { - tri_mask |= blit_mask & (1 << (color_bit - 1)); - blit_mask &= ~(1 << (color_bit - 1)); + tri_mask |= blit_mask & (1 << color_bit); + blit_mask &= ~(1 << color_bit); } } -- 1.6.2.1 |