diff options
author | Eric Anholt <[email protected]> | 2019-03-18 14:25:06 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-03-19 08:54:46 -0700 |
commit | eb5903a90857e767233fc818c2c07abd92d79521 (patch) | |
tree | ed488a7b252764f92f0de2573e183dd213470518 /src/gallium/drivers/v3d/v3d_resource.c | |
parent | ab28dca0334746d1d6cb3f1b18550e3cbfb41d77 (diff) |
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.
Diffstat (limited to 'src/gallium/drivers/v3d/v3d_resource.c')
-rw-r--r-- | src/gallium/drivers/v3d/v3d_resource.c | 10 |
1 files 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) { |