https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/170949
This PR updates the definition for CheckAccessFullyMapped in hlsl_intrinsics.h. Previously, the whole uint would be cast to a bool, which means any value > 0 would be treated as true. However, the DXC implementation actually casts just the LSB to bool and returns that. So all even values would result in false, and odd values would result in true after running CheckAccessFullyMapped on it. This PR changes the implementation to match the DXC implementation. >From 94cbb6d39d6bcefe88edc29519b688297f57de72 Mon Sep 17 00:00:00 2001 From: Joshua Batista <[email protected]> Date: Fri, 5 Dec 2025 15:20:17 -0800 Subject: [PATCH] update cafm def --- clang/lib/Headers/hlsl/hlsl_intrinsics.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/Headers/hlsl/hlsl_intrinsics.h b/clang/lib/Headers/hlsl/hlsl_intrinsics.h index a538be5ebd099..e8cda388b4ff4 100644 --- a/clang/lib/Headers/hlsl/hlsl_intrinsics.h +++ b/clang/lib/Headers/hlsl/hlsl_intrinsics.h @@ -667,7 +667,9 @@ smoothstep(__detail::HLSL_FIXED_VECTOR<float, N> Min, } inline bool CheckAccessFullyMapped(uint Status) { - return static_cast<bool>(Status); + // The bool cast should only apply to the LSB. + uint TruncStatus = Status % 2; + return static_cast<bool>(TruncStatus); } //===----------------------------------------------------------------------===// _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
