summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_draw.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-03-29 20:39:48 -0400
committerIlia Mirkin <[email protected]>2015-04-02 00:09:14 -0400
commit602bc6c88dbfa34083aa9d229fb6396b008e23eb (patch)
tree09a11efd6b449d8fa8694d95350ae72afbfaa14e /src/gallium/drivers/freedreno/freedreno_draw.c
parentd13803c76fd7429df64c1aa3631dcc451e7f1a29 (diff)
freedreno: add core infrastructure support for MRTs
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_draw.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_draw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index 213bad84e84..423ae23769c 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -92,7 +92,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
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;
@@ -147,6 +147,7 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
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
@@ -173,7 +174,9 @@ fd_clear(struct pipe_context *pctx, unsigned 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;