From eb5903a90857e767233fc818c2c07abd92d79521 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 18 Mar 2019 14:25:06 -0700 Subject: [PATCH] v3d: Always lay out shared tiled buffers with UIF_TOP set. The samplers are already ready for this, we just needed to make sure that layout chose UIF for level 0. --- src/gallium/drivers/v3d/v3d_resource.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/v3d/v3d_resource.c b/src/gallium/drivers/v3d/v3d_resource.c index 71248e9ca1e..61432a09d2f 100644 --- a/src/gallium/drivers/v3d/v3d_resource.c +++ b/src/gallium/drivers/v3d/v3d_resource.c @@ -462,7 +462,8 @@ v3d_get_ub_pad(struct v3d_resource *rsc, uint32_t height) } static void -v3d_setup_slices(struct v3d_resource *rsc, uint32_t winsys_stride) +v3d_setup_slices(struct v3d_resource *rsc, uint32_t winsys_stride, + bool uif_top) { struct pipe_resource *prsc = &rsc->base; uint32_t width = prsc->width0; @@ -484,10 +485,11 @@ v3d_setup_slices(struct v3d_resource *rsc, uint32_t winsys_stride) uint32_t block_width = util_format_get_blockwidth(prsc->format); uint32_t block_height = util_format_get_blockheight(prsc->format); bool msaa = prsc->nr_samples > 1; + /* MSAA textures/renderbuffers are always laid out as single-level * UIF. */ - bool uif_top = msaa; + uif_top |= msaa; /* Check some easy mistakes to make in a resource_create() call that * will break our setup. @@ -773,7 +775,7 @@ v3d_resource_create_with_modifiers(struct pipe_screen *pscreen, rsc->internal_format = prsc->format; - v3d_setup_slices(rsc, 0); + v3d_setup_slices(rsc, 0, tmpl->bind & PIPE_BIND_SHARED); if (!v3d_resource_bo_alloc(rsc)) goto fail; @@ -849,7 +851,7 @@ v3d_resource_from_handle(struct pipe_screen *pscreen, rsc->internal_format = prsc->format; - v3d_setup_slices(rsc, whandle->stride); + v3d_setup_slices(rsc, whandle->stride, true); v3d_debug_resource_layout(rsc, "import"); if (screen->ro) { -- 2.30.2