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
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev