summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2022-02-17 02:08:33 -0800
committerMarge Bot <emma+marge@anholt.net>2022-02-18 09:52:00 +0000
commit4ed9fd62c9135cae21907cac7227725668dfd745 (patch)
treec3b46be7c8396b0120a24c1687f832669690316d
parentbfdb1064c58402fe11e07317936abbd133f5a78d (diff)
anv: Lower bufferImageGranularity to 1 from 64
The Vulkan 1.3 spec says: "The implementation-dependent limit bufferImageGranularity specifies a page-like granularity at which linear and non-linear resources must be placed in adjacent memory locations to avoid aliasing. Two resources which do not satisfy this granularity requirement are said to alias. bufferImageGranularity is specified in bytes, and must be a power of two. Implementations which do not impose a granularity restriction may report a bufferImageGranularity value of one. Note: Despite its name, bufferImageGranularity is really a granularity between "linear" and "non-linear" resources." We set this limit to 64 bytes (a cacheline) at the dawn of time, without any real rationale attached. There shouldn't be any restrictions here. Our tile sizes are typically 4K, and tiled resource addresses are aligned to the tile size, and the extent is also a multiple of the tile sized. So if a linear resource occurs before a tiled one, there will naturally be some space due to the alignment of the tiled resource's starting address. If a linear resource occurs after a tiled one, the tiled resource's ending address is already 4K aligned, which is already guaranteeing that they won't share a cacheline. So I think it should be fine to reduce this to 1. The other Vulkan driver for our hardware seems to advertise 1 here as well. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15066>
-rw-r--r--src/intel/vulkan/anv_device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 3bdb9d40cf2..3ce0a4e6f21 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1840,7 +1840,7 @@ void anv_GetPhysicalDeviceProperties(
.maxPushConstantsSize = MAX_PUSH_CONSTANTS_SIZE,
.maxMemoryAllocationCount = UINT32_MAX,
.maxSamplerAllocationCount = 64 * 1024,
- .bufferImageGranularity = 64, /* A cache line */
+ .bufferImageGranularity = 1,
.sparseAddressSpaceSize = 0,
.maxBoundDescriptorSets = MAX_SETS,
.maxPerStageDescriptorSamplers = max_samplers,