diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-01-06 18:07:26 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-01-06 18:07:26 -0700 |
commit | 601a6b872c33bfe3cb4ea03a5a8ba5ebe92dedaf (patch) | |
tree | 96730ec79e4a8c0dcbea3bab085ed624213f41fd /src/mesa/drivers/dri/intel | |
parent | ff73c783cc47361ff0dd819c82d067b4b85870dd (diff) |
Replace gl_framebuffer's _ColorDrawBufferMask with _ColorDrawBufferIndexes
Each array element is now a BUFFER_x token rather than a BUFFER_BIT_x bitmask.
The number of active color buffers is specified by _NumColorDrawBuffers.
This builds on the previous DrawBuffer changes and will help with drivers
implementing GL_ARB_draw_buffers.
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_blit.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_buffers.c | 13 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_fbo.c | 5 |
3 files changed, 15 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 479c30669c..72b17dd71f 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -98,10 +98,10 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, ASSERT(intel_fb); ASSERT(intel_fb->Base.Name == 0); /* Not a user-created FBO */ - ASSERT(frontRegion); - ASSERT(backRegion); - ASSERT(frontRegion->pitch == backRegion->pitch); - ASSERT(frontRegion->cpp == backRegion->cpp); + ASSERT(src); + ASSERT(dst); + ASSERT(src->pitch == dst->pitch); + ASSERT(src->cpp == dst->cpp); if (cpp == 2) { BR13 = (0xCC << 16) | (1 << 24); @@ -357,7 +357,7 @@ intelEmitCopyBlit(struct intel_context *intel, /** * Use blitting to clear the renderbuffers named by 'flags'. - * Note: we can't use the ctx->DrawBuffer->_ColorDrawBufferMask field + * Note: we can't use the ctx->DrawBuffer->_ColorDrawBufferIndexes field * since that might include software renderbuffers or renderbuffers * which we're clearing with triangles. * \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index c654474200..2ea8d683eb 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -290,15 +290,14 @@ intelWindowMoved(struct intel_context *intel) } else { /* drawing to a window */ - switch (intel_fb->Base._ColorDrawBufferMask[0]) { - case BUFFER_BIT_FRONT_LEFT: + switch (intel_fb->Base._ColorDrawBufferIndexes[0]) { + case BUFFER_FRONT_LEFT: intelSetFrontClipRects(intel); break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: intelSetBackClipRects(intel); break; default: - /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */ intelSetFrontClipRects(intel); } } @@ -623,8 +622,8 @@ intel_wait_flips(struct intel_context *intel, GLuint batch_flags) (struct intel_framebuffer *) intel->ctx.DrawBuffer; struct intel_renderbuffer *intel_rb = intel_get_renderbuffer(&intel_fb->Base, - intel_fb->Base._ColorDrawBufferMask[0] == - BUFFER_BIT_FRONT_LEFT ? BUFFER_FRONT_LEFT : + intel_fb->Base._ColorDrawBufferIndexes[0] == + BUFFER_FRONT_LEFT ? BUFFER_FRONT_LEFT : BUFFER_BACK_LEFT); if (intel_fb->Base.Name == 0 && intel_rb && @@ -944,7 +943,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) /* draw to exactly one color buffer */ /*_mesa_debug(ctx, "Hardware rendering\n");*/ FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE); - if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) { + if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) { front = 1; } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 8d75c63cef..84ac7889b2 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -71,7 +71,10 @@ intel_renderbuffer(struct gl_renderbuffer *rb) struct intel_renderbuffer * intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex) { - return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer); + if (attIndex >= 0) + return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer); + else + return NULL; } |