{
struct fd_context *ctx = fd_context(pctx);
struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
+ int i;
DBG("needs_flush: %d", ctx->needs_flush);
ctx->gmem_reason = 0;
ctx->num_draws = 0;
- if (pfb->cbufs[0])
- fd_resource(pfb->cbufs[0]->texture)->dirty = false;
+ for (i = 0; i < pfb->nr_cbufs; i++)
+ if (pfb->cbufs[i])
+ fd_resource(pfb->cbufs[i]->texture)->dirty = false;
if (pfb->zsbuf)
fd_resource(pfb->zsbuf->texture)->dirty = false;
}
*/
enum {
/* align bitmask values w/ PIPE_CLEAR_*.. since that is convenient.. */
- FD_BUFFER_COLOR = PIPE_CLEAR_COLOR0,
+ FD_BUFFER_COLOR = PIPE_CLEAR_COLOR,
FD_BUFFER_DEPTH = PIPE_CLEAR_DEPTH,
FD_BUFFER_STENCIL = PIPE_CLEAR_STENCIL,
FD_BUFFER_ALL = FD_BUFFER_COLOR | FD_BUFFER_DEPTH | FD_BUFFER_STENCIL,
surf = pfb->cbufs[i]->texture;
fd_resource(surf)->dirty = true;
- buffers |= FD_BUFFER_COLOR;
+ buffers |= PIPE_CLEAR_COLOR0 << i;
if (surf->nr_samples > 1)
ctx->gmem_reason |= FD_GMEM_MSAA_ENABLED;
struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
struct pipe_scissor_state *scissor = fd_context_get_scissor(ctx);
unsigned cleared_buffers;
+ int i;
/* for bookkeeping about which buffers have been cleared (and thus
* can fully or partially skip mem2gmem) we need to ignore buffers
ctx->needs_flush = true;
if (buffers & PIPE_CLEAR_COLOR)
- fd_resource(pfb->cbufs[0]->texture)->dirty = true;
+ for (i = 0; i < pfb->nr_cbufs; i++)
+ if (buffers & (PIPE_CLEAR_COLOR0 << i))
+ fd_resource(pfb->cbufs[i]->texture)->dirty = true;
if (buffers & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) {
fd_resource(pfb->zsbuf->texture)->dirty = true;
fd_gmem_render_tiles(struct fd_context *ctx)
{
struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
- uint32_t timestamp = 0;
+ uint32_t i, timestamp = 0;
bool sysmem = false;
if (ctx->emit_sysmem_prep) {
/* update timestamps on render targets: */
timestamp = fd_ringbuffer_timestamp(ctx->ring);
- if (pfb->cbufs[0])
- fd_resource(pfb->cbufs[0]->texture)->timestamp = timestamp;
+ for (i = 0; i < pfb->nr_cbufs; i++)
+ if (pfb->cbufs[i])
+ fd_resource(pfb->cbufs[i]->texture)->timestamp = timestamp;
if (pfb->zsbuf)
fd_resource(pfb->zsbuf->texture)->timestamp = timestamp;