Module: Mesa
Branch: main
Commit: 2daa14f1820946be9ec2101744848aa961c9374c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2daa14f1820946be9ec2101744848aa961c9374c

Author: Iago Toral Quiroga <[email protected]>
Date:   Mon Aug 29 10:10:26 2022 +0200

v3d,v3dv: lower texel buffer aligment requirements

Reviewed-by: Alejandro PiƱeiro <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18291>

---

 src/broadcom/common/v3d_limits.h     | 3 +++
 src/broadcom/vulkan/v3dv_device.c    | 2 +-
 src/gallium/drivers/v3d/v3d_screen.c | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/broadcom/common/v3d_limits.h b/src/broadcom/common/v3d_limits.h
index eba894252d2..c47f5338116 100644
--- a/src/broadcom/common/v3d_limits.h
+++ b/src/broadcom/common/v3d_limits.h
@@ -53,6 +53,9 @@
 /* Size of a cache line */
 #define V3D_NON_COHERENT_ATOM_SIZE 256
 
+/* Minimum alignment for texel buffers */
+#define V3D_TMU_TEXEL_ALIGN 64
+
 #define V3D_MAX_IMAGE_DIMENSION 4096
 
 /* The HW can do 16384 (15), but we run into hangs when we expose that. Also,
diff --git a/src/broadcom/vulkan/v3dv_device.c 
b/src/broadcom/vulkan/v3dv_device.c
index 6b73fdfe00e..61c5a36fddd 100644
--- a/src/broadcom/vulkan/v3dv_device.c
+++ b/src/broadcom/vulkan/v3dv_device.c
@@ -1485,7 +1485,7 @@ v3dv_GetPhysicalDeviceProperties(VkPhysicalDevice 
physicalDevice,
                                                     2.0 * max_fb_size - 1 },
       .viewportSubPixelBits                     = 0,
       .minMemoryMapAlignment                    = page_size,
-      .minTexelBufferOffsetAlignment            = V3D_UIFBLOCK_SIZE,
+      .minTexelBufferOffsetAlignment            = V3D_TMU_TEXEL_ALIGN,
       .minUniformBufferOffsetAlignment          = 32,
       .minStorageBufferOffsetAlignment          = 32,
       .minTexelOffset                           = -8,
diff --git a/src/gallium/drivers/v3d/v3d_screen.c 
b/src/gallium/drivers/v3d/v3d_screen.c
index 83fe69b31ca..2ab601a8d47 100644
--- a/src/gallium/drivers/v3d/v3d_screen.c
+++ b/src/gallium/drivers/v3d/v3d_screen.c
@@ -298,7 +298,7 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
                 return true;
 
         case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
-                return 256;
+                return V3D_TMU_TEXEL_ALIGN;
 
         case PIPE_CAP_IMAGE_STORE_FORMATTED:
                 return false;

Reply via email to