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

Author: Rhys Perry <[email protected]>
Date:   Tue Jul 11 20:29:12 2023 +0100

radv: don't set vertex_attribute_strides on GFX8+

Bounds checking no longer compares against the stride.

fossil-db (navi21):
Totals from 5 (0.00% of 133461) affected shaders:
Instrs: 1532 -> 1520 (-0.78%)
CodeSize: 8144 -> 8084 (-0.74%)
Latency: 5104 -> 5102 (-0.04%)
InvThroughput: 686 -> 680 (-0.87%)
VClause: 19 -> 17 (-10.53%)
PreVGPRs: 118 -> 116 (-1.69%)

Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24115>

---

 src/amd/vulkan/radv_pipeline_graphics.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_pipeline_graphics.c 
b/src/amd/vulkan/radv_pipeline_graphics.c
index 783b3a94eec..30bcebcc364 100644
--- a/src/amd/vulkan/radv_pipeline_graphics.c
+++ b/src/amd/vulkan/radv_pipeline_graphics.c
@@ -1843,7 +1843,9 @@ radv_generate_graphics_pipeline_key(const struct 
radv_device *device, const stru
          key.vs.vertex_attribute_offsets[i] = offset;
          key.vs.instance_rate_divisors[i] = 
state->vi->bindings[binding].divisor;
 
-         if (!(pipeline->dynamic_states & 
RADV_DYNAMIC_VERTEX_INPUT_BINDING_STRIDE)) {
+         /* vertex_attribute_strides is only needed to workaround GFX6/7 
offset>=stride checks. */
+         if (!(pipeline->dynamic_states & 
RADV_DYNAMIC_VERTEX_INPUT_BINDING_STRIDE) &&
+             pdevice->rad_info.gfx_level < GFX8) {
             /* From the Vulkan spec 1.2.157:
              *
              * "If the bound pipeline state object was created with the

Reply via email to