From 8564a4c58483b5ca2703a97d0c8729ff18292fd2 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 21 Sep 2021 16:05:53 +0100 Subject: [PATCH] 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 Reviewed-by: Bas Nieuwenhhuizen Part-of: --- 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))); {