radv/rt: Write inactive node data in ALWAYS_ACTIVE workaround
Fixes:a9831caa
("radv/rt: Add workaround to make leaves always active") (cherry picked from commitf66055a6a6
) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27341>
This commit is contained in:

committed by
Eric Engestrom

parent
50d34ed642
commit
1ba1f0871e
@@ -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
|
||||
|
Reference in New Issue
Block a user