From 813e399803dc0ce1574bd465a1d7cc49b023fad4 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 23 Mar 2026 14:23:44 -0400 Subject: [PATCH] panvk: Reduce minTexelBufferOffsetAlignment There are formats that require a 128B alignment but they're compressed and not allowed for texel buffers. The biggest texel size we can have for a texel buffer is RGBA32, which is 16B. The only reason why we needed the large alignment was to work around a bug in the way we were turning texel buffers into attribute descriptors on Bifrost. That bug is now fixed so we can reduce to a reasonable alignment requiremdnt. Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Christoph Pillmayer Reviewed-by: Lorenzo Rossi Part-of: --- src/panfrost/vulkan/panvk_vX_physical_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/panfrost/vulkan/panvk_vX_physical_device.c b/src/panfrost/vulkan/panvk_vX_physical_device.c index 7c4a4039139..4dfabc54bfc 100644 --- a/src/panfrost/vulkan/panvk_vX_physical_device.c +++ b/src/panfrost/vulkan/panvk_vX_physical_device.c @@ -841,8 +841,8 @@ panvk_per_arch(get_physical_device_properties)( .viewportSubPixelBits = 0, /* Align on a page. */ .minMemoryMapAlignment = os_page_size, - /* Some compressed texture formats require 128-byte alignment. */ - .minTexelBufferOffsetAlignment = 64, + /* The largest buffer texture format is 16B */ + .minTexelBufferOffsetAlignment = 16, /* Always aligned on a uniform slot (vec4). */ .minUniformBufferOffsetAlignment = 16, /* Lowered to global accesses, which happen at the 32-bit granularity. */ @@ -1057,8 +1057,8 @@ panvk_per_arch(get_physical_device_properties)( .integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = false, .integerDotProductAccumulatingSaturating64BitSignedAccelerated = false, .integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = false, - .storageTexelBufferOffsetAlignmentBytes = 64, - .storageTexelBufferOffsetSingleTexelAlignment = false, + .storageTexelBufferOffsetAlignmentBytes = 16, + .storageTexelBufferOffsetSingleTexelAlignment = true, .uniformTexelBufferOffsetAlignmentBytes = 4, .uniformTexelBufferOffsetSingleTexelAlignment = true, .maxBufferSize = PANVK_MAX_BUFFER_SIZE,