[Mesa-dev] [PATCH] radv: use proper maximum slice for layered view

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Fri Jan 27 10:20:23 UTC 2017


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Thu, Jan 26, 2017, at 19:47, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> this fixes deferred shadows with geom shaders enabled.
> 
> but I think this fix is fine by itself.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/vulkan/radv_device.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index b1819a5..110a51b 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -1666,8 +1666,9 @@ radv_initialise_color_surface(struct radv_device
> *device,
>  	va += iview->image->dcc_offset;
>  	cb->cb_dcc_base = va >> 8;
>  
> +       uint32_t max_slice = iview->type == VK_IMAGE_VIEW_TYPE_3D ?
> iview->extent.depth : iview->layer_count;
>  	cb->cb_color_view = S_028C6C_SLICE_START(iview->base_layer) |
> -               S_028C6C_SLICE_MAX(iview->base_layer +
> iview->extent.depth - 1);
> +               S_028C6C_SLICE_MAX(iview->base_layer + max_slice - 1);
>  
>  	cb->micro_tile_mode = iview->image->surface.micro_tile_mode;
>  	pitch_tile_max = level_info->nblk_x / 8 - 1;
> @@ -1819,8 +1820,9 @@ radv_initialise_ds_surface(struct radv_device
> *device,
>  	z_offs += iview->image->surface.level[level].offset;
>  	s_offs += iview->image->surface.stencil_level[level].offset;
>  
> +       uint32_t max_slice = iview->type == VK_IMAGE_VIEW_TYPE_3D ?
> iview->extent.depth : iview->layer_count;
>  	ds->db_depth_view = S_028008_SLICE_START(iview->base_layer) |
> -               S_028008_SLICE_MAX(iview->base_layer +
> iview->extent.depth - 1);
> +               S_028008_SLICE_MAX(iview->base_layer + max_slice - 1);
>  	ds->db_depth_info = S_02803C_ADDR5_SWIZZLE_MASK(1);
>  	ds->db_z_info = S_028040_FORMAT(format) | S_028040_ZRANGE_PRECISION(1);
>  
> -- 
> 2.9.3
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list