Skip to content

airconv: guard null UAV counter pointers, fix Dot2AddHalf accumulation, and return 0 from WaveReadLaneFirst for helper-only lanes - #369

Open
cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/airconv-uav-counter-dot2-wave
Open

cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/airconv-uav-counter-dot2-wave

Conversation

@cyyever

@cyyever cyyever commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Null UAV counter pointer guard (src/airconv/dxil_converter.cpp, src/airconv/nt/dxbc_converter_base.cpp): In DXIL BufferUpdateCounter and DXBC InstAtomicImmIncrement / InstAtomicImmDecrement, branch on ir.CreateIsNotNull(ptr) before issuing air.CreateAtomicRMW, returning 0 via a PHI node when a UAV has no counter resource bound instead of dereferencing a null pointer on the GPU. In dxil_converter.cpp, split the block cleanly at call via SplitBlock and guard !h.counter as well.
  • Dot2AddHalf accumulation order (src/airconv/dxil_converter.cpp): Compute acc + fma(a.y, b.y, a.x * b.x) so the 2-element dot product completes before accumulating into acc, matching SM 6.4 dot2add semantics.
  • WaveReadLaneFirst for helper-only waves (src/airconv/dxil_converter.cpp): When all active lanes in a pixel shader wave are helper lanes (real == 0), return 0 (Constant::getNullValue(ty)) instead of shuffling from the first helper lane (matches vkd3d-proton's test_sm67_helper_lane_only_wave_ops).

Verification

  • Audited all LLVM IR builder calls (SplitBlock, BasicBlock::Create, CreateIsNotNull, PHINode::Create, Constant::getNullValue, CreateFAdd/CreateFMul) against up/main's LLVM 15 APIs in dxil_converter.cpp and dxbc_converter_base.cpp.

…n, and return 0 from WaveReadLaneFirst for helper-only lanes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant