diff options
author | Rob Clark <[email protected]> | 2014-02-10 09:14:15 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2014-02-16 08:17:23 -0500 |
commit | 89dc2825819c0260511c6596497c8a350d9901a7 (patch) | |
tree | a6d05f52ed31bb28efbfd1bad7d56be330d646ed /src/gallium/drivers | |
parent | 1020d8937ef52725cc5adafc12465f6332815e82 (diff) |
freedreno: fix problems if no color buf bound
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_gmem.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_draw.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c index 2eb20247bb8..d3ba6e6812b 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c @@ -65,7 +65,7 @@ emit_mrt(struct fd_ringbuffer *ring, unsigned nr_bufs, uint32_t stride = 0; uint32_t base = 0; - if (i < nr_bufs) { + if ((i < nr_bufs) && bufs[i]) { struct pipe_surface *psurf = bufs[i]; rsc = fd_resource(psurf->texture); diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index 4382bf0d44e..11bb8d8333d 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -128,7 +128,12 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) ctx->gmem_reason |= FD_GMEM_LOGICOP_ENABLED; for (i = 0; i < pfb->nr_cbufs; i++) { - struct pipe_resource *surf = pfb->cbufs[i]->texture; + struct pipe_resource *surf; + + if (!pfb->cbufs[i]) + continue; + + surf = pfb->cbufs[i]->texture; fd_resource(surf)->dirty = true; buffers |= FD_BUFFER_COLOR; |