summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-05-13 12:39:16 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2007-05-13 12:39:16 +0100
commit7c9dae9a53b4920901a784e6894dfdbbe029ea03 (patch)
tree2e611f1b11f5cb9ed2f84eaa2c832c925cb6ca40
parent17580cd7b840f91459ea8b5336064a215a7fee4f (diff)
Hack-fix BUFFER_BITS check for clearing FBO's
In many places we check BUFFER_BITS_FRONT_LEFT / BUFFER_BITS_BACK_LEFT, but this is incorrect for FBO rendering which sets BUFFER_BITS_COLOR0, etc. This changes enough code to get clears working on fbos, but it is not a complete fix.
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_state_fallback.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_state_static.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_clears.c6
3 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915tex/i915_state_fallback.c b/src/mesa/drivers/dri/i915tex/i915_state_fallback.c
index 99f74382d3..21e16bc8cf 100644
--- a/src/mesa/drivers/dri/i915tex/i915_state_fallback.c
+++ b/src/mesa/drivers/dri/i915tex/i915_state_fallback.c
@@ -61,7 +61,8 @@ static GLboolean do_check_fallback(struct intel_context *intel)
/* _NEW_BUFFERS
*/
if (intel->state._ColorDrawBufferMask0 != BUFFER_BIT_FRONT_LEFT &&
- intel->state._ColorDrawBufferMask0 != BUFFER_BIT_BACK_LEFT) {
+ intel->state._ColorDrawBufferMask0 != BUFFER_BIT_BACK_LEFT &&
+ intel->state._ColorDrawBufferMask0 != BUFFER_BIT_COLOR0) {
DBG("%s: _ColorDrawBufferMask0\n", __FUNCTION__);
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/i915tex/i915_state_static.c b/src/mesa/drivers/dri/i915tex/i915_state_static.c
index bfd6ad977b..f1f5a1248c 100644
--- a/src/mesa/drivers/dri/i915tex/i915_state_static.c
+++ b/src/mesa/drivers/dri/i915tex/i915_state_static.c
@@ -258,7 +258,8 @@ static void upload_static(struct intel_context *intel)
GLuint statemask = 0;
if (color_region && (clearparams & (BUFFER_BIT_BACK_LEFT |
- BUFFER_BIT_FRONT_LEFT))) {
+ BUFFER_BIT_FRONT_LEFT |
+ BUFFER_BIT_COLOR0))) {
statemask |= CLEARPARAM_WRITE_COLOR;
if (color_region->cpp == 4)
clearColor = intel->ClearColor8888;
diff --git a/src/mesa/drivers/dri/i915tex/intel_clears.c b/src/mesa/drivers/dri/i915tex/intel_clears.c
index 177da21cdf..e755379895 100644
--- a/src/mesa/drivers/dri/i915tex/intel_clears.c
+++ b/src/mesa/drivers/dri/i915tex/intel_clears.c
@@ -30,6 +30,7 @@
#include "intel_state.h"
#include "intel_metaops.h"
#include "intel_fbo.h"
+#include "intel_utils.h"
#include "clip/clip_context.h"
@@ -211,6 +212,7 @@ void intelClear(GLcontext *ctx, GLbitfield mask)
*/
if ((mask & BUFFER_BITS_COLOR) &&
(colorMask != ~0 ||
+ count_bits(mask & BUFFER_BITS_COLOR) != 1 ||
(mask & BUFFER_BITS_COLOR) != ctx->DrawBuffer->_ColorDrawBufferMask[0]))
{
tri_mask = mask & (BUFFER_BITS_COLOR|BUFFER_BIT_DEPTH|BUFFER_BIT_STENCIL);
@@ -244,8 +246,8 @@ void intelClear(GLcontext *ctx, GLbitfield mask)
}
}
-/* tri_mask |= rect_mask; */
-/* rect_mask = 0; */
+// tri_mask |= rect_mask;
+// rect_mask = 0;
/* I really don't care.
*/