diff options
| author | sriramm-nv <85252063+sriramm-nv@users.noreply.github.com> | 2024-04-16 23:59:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-16 23:59:41 -0700 |
| commit | 4b3f554a58e4224806c31d66874fbe60f1f09332 (patch) | |
| tree | ac19836249c875f2b8e3cdd74894a17d963ef1fd /source/core | |
| parent | 67313584d6879d68db53ced3108c2370bed5e8c1 (diff) | |
Force Inline all the InterlockedAdd functions in stdlib (#3965)
This change forcibly inlines the InterlockedAdd functions when using byteAddress buffer.
The IR generated when using nonUniformResourceInst on RWByteAddressBuffer:
buffer[NonUniformResourceIndex(uint(0))].InterlockedAdd(0, 1);
follows the sequence of a call into an index lookup that is wrapped by a nonuniformResourceIndex:
%ld = nonUniformResourceIndex(0)
Call RWStructBufferInterlockedAdd(%ld, 0, 1)
This prevents NonUniformResource decoration of the buffer because it is wrapped by the function call to
InterlockedAdd, that further expands to:
%gep = getElement(%buffer, 0)
SpirvAsmInst(..., rwStructuredBufferGEP(%gep, 0), ...)
By Force-Inlining the atomic functions, the buffer / resource is made visible to the nonUniformResourceIndex inst,
allowing the decoration.
Identified while debugging tests/spirv/coherent-2.slang
Diffstat (limited to 'source/core')
0 files changed, 0 insertions, 0 deletions
