summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-01-08 13:31:59 +0100
committerMarek Olšák <[email protected]>2014-01-13 15:48:08 +0100
commit07032d40684c3ad8e12fd6979b0b4b6582871db4 (patch)
treea1737ad29b63d9a05a580ada122e21d4d13f1d84 /src/gallium/drivers/r600/r600_blit.c
parenta86de9a72f229e1833af93f5d51023a1dec3af1e (diff)
r600g: handle NULL colorbuffers correctly on Evergreen
Diffstat (limited to 'src/gallium/drivers/r600/r600_blit.c')
-rw-r--r--src/gallium/drivers/r600/r600_blit.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index 7e29cc51f7b..2b861389110 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -439,9 +439,14 @@ static bool can_fast_clear_color(struct pipe_context *ctx)
}
for (i = 0; i < fb->nr_cbufs; i++) {
- struct r600_texture *tex = (struct r600_texture *)fb->cbufs[i]->texture;
+ struct r600_texture *tex;
+
+ if (!fb->cbufs[i])
+ continue;
+
+ tex = (struct r600_texture *)fb->cbufs[i]->texture;
- /* 128-bit formats are unuspported */
+ /* 128-bit formats are unusupported */
if (util_format_get_blocksizebits(fb->cbufs[i]->format) > 64) {
return false;
}
@@ -484,7 +489,12 @@ static void r600_clear(struct pipe_context *ctx, unsigned buffers,
int i;
for (i = 0; i < fb->nr_cbufs; i++) {
- struct r600_texture *tex = (struct r600_texture *)fb->cbufs[i]->texture;
+ struct r600_texture *tex;
+
+ if (!fb->cbufs[i])
+ continue;
+
+ tex = (struct r600_texture *)fb->cbufs[i]->texture;
evergreen_set_clear_color(fb->cbufs[i], color);
r600_clear_buffer(ctx, &tex->cmask_buffer->b.b,
@@ -502,7 +512,12 @@ static void r600_clear(struct pipe_context *ctx, unsigned buffers,
/* cannot use fast clear, make sure to disable expansion */
for (i = 0; i < fb->nr_cbufs; i++) {
- struct r600_texture *tex = (struct r600_texture *)fb->cbufs[i]->texture;
+ struct r600_texture *tex;
+
+ if (!fb->cbufs[i])
+ continue;
+
+ tex = (struct r600_texture *)fb->cbufs[i]->texture;
if (tex->fmask.size == 0)
tex->dirty_level_mask &= ~(1 << fb->cbufs[i]->u.tex.level);
}