[Mesa-dev] [PATCH] radv: allocate thin textures as linear.
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Thu Apr 13 07:16:48 UTC 2017
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Thu, Apr 13, 2017 at 6:14 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This is ported from radeonsi, and avoids the bug in the
> addrlib code. This should probably be something addrlib
> does for us, but for now this fixes the regression without
> changing addrlib and aligns us with radeonsi.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/amd/vulkan/radv_image.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
> index 0ada7ff..3586e4c 100644
> --- a/src/amd/vulkan/radv_image.c
> +++ b/src/amd/vulkan/radv_image.c
> @@ -41,6 +41,13 @@ radv_choose_tiling(struct radv_device *Device,
> return RADEON_SURF_MODE_LINEAR_ALIGNED;
> }
>
> + /* Textures with a very small height are recommended to be linear. */
> + if (pCreateInfo->imageType == VK_IMAGE_TYPE_1D ||
> + /* Only very thin and long 2D textures should benefit from
> + * linear_aligned. */
> + (pCreateInfo->extent.width > 8 && pCreateInfo->extent.height <= 2))
> + return RADEON_SURF_MODE_LINEAR_ALIGNED;
> +
> /* MSAA resources must be 2D tiled. */
> if (pCreateInfo->samples > 1)
> return RADEON_SURF_MODE_2D;
> --
> 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