radv: Rename emulated float helpers
Use only conversion functions now. Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
This commit is contained in:
committed by
Marge Bot
parent
db946364df
commit
37525c11d1
@@ -203,24 +203,16 @@ align(uint32_t value, uint32_t alignment)
|
||||
return (value + alignment - 1) & ~(alignment - 1);
|
||||
}
|
||||
|
||||
void
|
||||
min_float_emulated(REF(int32_t) addr, float f)
|
||||
int32_t
|
||||
to_emulated_float(float f)
|
||||
{
|
||||
int32_t bits = floatBitsToInt(f);
|
||||
atomicMin(DEREF(addr), f < 0 ? -2147483648 - bits : bits);
|
||||
}
|
||||
|
||||
void
|
||||
max_float_emulated(REF(int32_t) addr, float f)
|
||||
{
|
||||
int32_t bits = floatBitsToInt(f);
|
||||
atomicMax(DEREF(addr), f < 0 ? -2147483648 - bits : bits);
|
||||
return f < 0 ? -2147483648 - bits : bits;
|
||||
}
|
||||
|
||||
float
|
||||
load_minmax_float_emulated(VOID_REF addr)
|
||||
from_emulated_float(int32_t bits)
|
||||
{
|
||||
int32_t bits = DEREF(REF(int32_t)(addr));
|
||||
return intBitsToFloat(bits < 0 ? -2147483648 - bits : bits);
|
||||
}
|
||||
|
||||
|
||||
@@ -310,10 +310,10 @@ main(void)
|
||||
|
||||
DEREF(id_ptr).id = is_active ? pack_ir_node_id(dst_offset, node_type) : RADV_BVH_INVALID_NODE;
|
||||
|
||||
min_float_emulated(INDEX(int32_t, args.bounds, 0), bounds.min.x);
|
||||
min_float_emulated(INDEX(int32_t, args.bounds, 1), bounds.min.y);
|
||||
min_float_emulated(INDEX(int32_t, args.bounds, 2), bounds.min.z);
|
||||
max_float_emulated(INDEX(int32_t, args.bounds, 3), bounds.max.x);
|
||||
max_float_emulated(INDEX(int32_t, args.bounds, 4), bounds.max.y);
|
||||
max_float_emulated(INDEX(int32_t, args.bounds, 5), bounds.max.z);
|
||||
atomicMin(DEREF(INDEX(int32_t, args.bounds, 0)), to_emulated_float(bounds.min.x));
|
||||
atomicMin(DEREF(INDEX(int32_t, args.bounds, 1)), to_emulated_float(bounds.min.y));
|
||||
atomicMin(DEREF(INDEX(int32_t, args.bounds, 2)), to_emulated_float(bounds.min.z));
|
||||
atomicMax(DEREF(INDEX(int32_t, args.bounds, 3)), to_emulated_float(bounds.max.x));
|
||||
atomicMax(DEREF(INDEX(int32_t, args.bounds, 4)), to_emulated_float(bounds.max.y));
|
||||
atomicMax(DEREF(INDEX(int32_t, args.bounds, 5)), to_emulated_float(bounds.max.z));
|
||||
}
|
||||
|
||||
@@ -78,12 +78,12 @@ main(void)
|
||||
vec3 center = (bounds.min + bounds.max) * 0.5;
|
||||
|
||||
AABB bvh_bounds;
|
||||
bvh_bounds.min.x = load_minmax_float_emulated(VOID_REF(args.bounds));
|
||||
bvh_bounds.min.y = load_minmax_float_emulated(OFFSET(args.bounds, 4));
|
||||
bvh_bounds.min.z = load_minmax_float_emulated(OFFSET(args.bounds, 8));
|
||||
bvh_bounds.max.x = load_minmax_float_emulated(OFFSET(args.bounds, 12));
|
||||
bvh_bounds.max.y = load_minmax_float_emulated(OFFSET(args.bounds, 16));
|
||||
bvh_bounds.max.z = load_minmax_float_emulated(OFFSET(args.bounds, 20));
|
||||
bvh_bounds.min.x = from_emulated_float(DEREF(INDEX(int32_t, args.bounds, 0)));
|
||||
bvh_bounds.min.y = from_emulated_float(DEREF(INDEX(int32_t, args.bounds, 1)));
|
||||
bvh_bounds.min.z = from_emulated_float(DEREF(INDEX(int32_t, args.bounds, 2)));
|
||||
bvh_bounds.max.x = from_emulated_float(DEREF(INDEX(int32_t, args.bounds, 3)));
|
||||
bvh_bounds.max.y = from_emulated_float(DEREF(INDEX(int32_t, args.bounds, 4)));
|
||||
bvh_bounds.max.z = from_emulated_float(DEREF(INDEX(int32_t, args.bounds, 5)));
|
||||
|
||||
vec3 normalized_center = (center - bvh_bounds.min) / (bvh_bounds.max - bvh_bounds.min);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user