[clang] [HLSL] Add `InterlockedMax` function and resource methods (PR #222160)
Joshua Batista via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 21 13:01:04 PDT 2026
================
@@ -49,4 +57,6 @@ void main(uint3 id : SV_DispatchThreadID) {
InterlockedOr(UOut[id], 1u);
InterlockedXor(UOut[id], 1u);
InterlockedMin(UOut[id], 1u);
+ InterlockedMax(Out[id.xy], 1);
----------------
bob80905 wrote:
Out is RWTexture2D<int> and id is uint3. Out[id] compiles but emits -Wvector-conversion "implicit conversion truncates vector". Out[id.xy] is the explicit, warning-free form and matches the pre-existing InterlockedAdd/InterlockedMin lines above it. UOut is RWTexture2DArray<uint>, which takes all 3 components, so it uses id.
https://github.com/llvm/llvm-project/pull/222160
More information about the cfe-commits
mailing list