summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-04-13 14:12:28 +1000
committerDave Airlie <[email protected]>2017-04-13 20:31:38 +1000
commit4bcebe10ca322c1237d93a0bb786b91731f90589 (patch)
tree368fd40e240a3bdf543f5f6b2612210554b91423 /src/amd
parent9ced105a52896dddf272a6052412275f65efe3b6 (diff)
radv: allocate thin textures as linear.
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. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_image.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 0ada7ffa615..3586e4c158b 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;