diff options
author | Marek Olšák <maraeo@gmail.com> | 2013-01-20 18:09:58 +0100 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2013-01-21 17:00:51 +0100 |
commit | 4a1af434e6bfc80fceab2a472e7a79de59aca823 (patch) | |
tree | 421eaf9ee70fda9c0556f1ee23c92bd9bed9547f /src/gallium/drivers/r300/r300_state.c | |
parent | 7bfbf5b28791b9cb192201e6cf251da35da49080 (diff) |
r300g: add a workaround for the AA colorbuffer addressing bug on R500
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index e5d9bebb2c..fd02f82bc9 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -839,14 +839,18 @@ static unsigned r300_get_num_samples(struct r300_context *r300) { struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)r300->fb_state.state; - unsigned num_samples; + unsigned i, num_samples; - if (fb->nr_cbufs) - num_samples = fb->cbufs[0]->texture->nr_samples; - else if (fb->zsbuf) - num_samples = fb->zsbuf->texture->nr_samples; - else - num_samples = 1; + if (!fb->nr_cbufs && !fb->zsbuf) + return 1; + + num_samples = 6; + + for (i = 0; i < fb->nr_cbufs; i++) + num_samples = MIN2(num_samples, fb->cbufs[i]->texture->nr_samples); + + if (fb->zsbuf) + num_samples = MIN2(num_samples, fb->zsbuf->texture->nr_samples); if (!num_samples) num_samples = 1; |