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

Author: Joshua Ashton <[email protected]>
Date:   Tue Sep 21 16:05:53 2021 +0100

radv: Push box traversal results onto stack in correct order

Currently, it's pushing from lowest distance to highest distance, so when these 
are popped off the stack, we start at the highest distance to lowest.

Signed-off-by: Joshua Ashton <[email protected]>
Reviewed-by: Bas Nieuwenhhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12960>

---

 src/amd/vulkan/radv_pipeline_rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_pipeline_rt.c 
b/src/amd/vulkan/radv_pipeline_rt.c
index ea4cc7820fa..430080c1343 100644
--- a/src/amd/vulkan/radv_pipeline_rt.c
+++ b/src/amd/vulkan/radv_pipeline_rt.c
@@ -1681,7 +1681,7 @@ insert_traversal(struct radv_device *device, const 
VkRayTracingPipelineCreateInf
          {
             /* box */
 
-            for (unsigned i = 0; i < 4; ++i) {
+            for (unsigned i = 4; i-- > 0; ) {
                nir_ssa_def *new_node = nir_vector_extract(b, result, 
nir_imm_int(b, i));
                nir_push_if(b, nir_ine(b, new_node, nir_imm_int(b, 
0xffffffff)));
                {

Reply via email to