diff options
author | Eric Anholt <[email protected]> | 2015-06-22 13:12:27 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-12-08 09:49:53 -0800 |
commit | edfd4d853a0d26bc0cde811de7b20116db7e66fc (patch) | |
tree | e154c0ed3b29e39e2cedf1545fdedb7624d27caf /src/gallium/drivers/vc4/vc4_state.c | |
parent | e7c8ad0a6c8ba263f29b7c3c5120bc6beabeba7b (diff) |
vc4: Add support for drawing in MSAA.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_state.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_state.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c index 2a88188a959..d9c0f55b23d 100644 --- a/src/gallium/drivers/vc4/vc4_state.c +++ b/src/gallium/drivers/vc4/vc4_state.c @@ -121,6 +121,9 @@ vc4_create_rasterizer_state(struct pipe_context *pctx, so->offset_factor = float_to_187_half(cso->offset_scale); } + if (cso->multisample) + so->config_bits[0] |= VC4_CONFIG_BITS_RASTERIZER_OVERSAMPLE_4X; + return so; } @@ -457,6 +460,22 @@ vc4_set_framebuffer_state(struct pipe_context *pctx, rsc->cpp); } + vc4->msaa = false; + if (cso->cbufs[0]) + vc4->msaa = cso->cbufs[0]->texture->nr_samples != 0; + else if (cso->zsbuf) + vc4->msaa = cso->zsbuf->texture->nr_samples != 0; + + if (vc4->msaa) { + vc4->tile_width = 32; + vc4->tile_height = 32; + } else { + vc4->tile_width = 64; + vc4->tile_height = 64; + } + vc4->draw_tiles_x = DIV_ROUND_UP(cso->width, vc4->tile_width); + vc4->draw_tiles_y = DIV_ROUND_UP(cso->height, vc4->tile_height); + vc4->dirty |= VC4_DIRTY_FRAMEBUFFER; } |