summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_state.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-10-24 18:45:57 -0700
committerEric Anholt <[email protected]>2017-10-30 13:31:27 -0700
commitb1a8b3979c6f206ee80eaeb5d27fded6c995575e (patch)
tree5f56cf9ea5ad56088d756b7e7733ea3040cab515 /src/gallium/drivers/vc5/vc5_state.c
parent1d8105a167fcaf4c5768714e60183c5a6feda4a7 (diff)
broadcom/vc5: Lay out MSAA textures/renderbuffers as UIF scaled by 4.
We just need to multiply width/height by 2 each, and always set them up as UIF tiling, since that's how the TLB will store them in raw (per-sample) mode.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_state.c')
-rw-r--r--src/gallium/drivers/vc5/vc5_state.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c
index eebf94b4b9c..817b6247d58 100644
--- a/src/gallium/drivers/vc5/vc5_state.c
+++ b/src/gallium/drivers/vc5/vc5_state.c
@@ -562,11 +562,13 @@ vc5_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
so->base.reference.count = 1;
so->base.context = pctx;
+ int msaa_scale = prsc->nr_samples > 1 ? 2 : 1;
+
struct V3D33_TEXTURE_SHADER_STATE state_unpacked = {
cl_packet_header(TEXTURE_SHADER_STATE),
- .image_width = prsc->width0,
- .image_height = prsc->height0,
+ .image_width = prsc->width0 * msaa_scale,
+ .image_height = prsc->height0 * msaa_scale,
.image_depth = prsc->depth0,
.texture_type = rsc->tex_format,