From 1ba1f0871e3a832db636752e2c4f4c3a3b23e373 Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Mon, 29 Jan 2024 19:52:30 +0100 Subject: [PATCH] radv/rt: Write inactive node data in ALWAYS_ACTIVE workaround Fixes: a9831caa ("radv/rt: Add workaround to make leaves always active") (cherry picked from commit f66055a6a6773dee32e4877f4914ed8338f48e91) Part-of: --- .pick_status.json | 2 +- src/amd/vulkan/bvh/leaf.comp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index c090b24cbf3..402a0675969 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -794,7 +794,7 @@ "description": "radv/rt: Write inactive node data in ALWAYS_ACTIVE workaround", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "a9831caa144f9944fec936608faf03d253e9bb7d", "notes": null diff --git a/src/amd/vulkan/bvh/leaf.comp b/src/amd/vulkan/bvh/leaf.comp index 1c2dcd0563c..4456c0a808f 100644 --- a/src/amd/vulkan/bvh/leaf.comp +++ b/src/amd/vulkan/bvh/leaf.comp @@ -187,6 +187,7 @@ TYPE(AccelerationStructureInstance, 8); bool build_triangle(inout radv_aabb bounds, VOID_REF dst_ptr, uint32_t global_id) { + bool is_valid = true; triangle_indices indices = load_indices(args.indices, args.index_format, global_id); triangle_vertices vertices = load_vertices(args.data, indices, args.vertex_format, args.stride); @@ -196,7 +197,11 @@ build_triangle(inout radv_aabb bounds, VOID_REF dst_ptr, uint32_t global_id) * format does not have a NaN representation, then all triangles are considered active. */ if (isnan(vertices.vertex[0].x) || isnan(vertices.vertex[1].x) || isnan(vertices.vertex[2].x)) +#if ALWAYS_ACTIVE + is_valid = false; +#else return false; +#endif if (args.transform != NULL) { mat4 transform = mat4(1.0); @@ -228,12 +233,13 @@ build_triangle(inout radv_aabb bounds, VOID_REF dst_ptr, uint32_t global_id) DEREF(node).geometry_id_and_flags = args.geometry_id; DEREF(node).id = 9; - return true; + return is_valid; } bool build_aabb(inout radv_aabb bounds, VOID_REF src_ptr, VOID_REF dst_ptr, uint32_t global_id) { + bool is_valid = true; REF(radv_ir_aabb_node) node = REF(radv_ir_aabb_node)(dst_ptr); for (uint32_t vec = 0; vec < 2; vec++) @@ -250,14 +256,18 @@ build_aabb(inout radv_aabb bounds, VOID_REF src_ptr, VOID_REF dst_ptr, uint32_t * NaN, and the first is not, the behavior is undefined. */ if (isnan(bounds.min.x)) - return false; +#if ALWAYS_ACTIVE + is_valid = false; +#else + return false; +#endif DEREF(node).base.aabb = bounds; DEREF(node).base.cost = 0.0; DEREF(node).primitive_id = global_id; DEREF(node).geometry_id_and_flags = args.geometry_id; - return true; + return is_valid; } bool