You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RWStructuredBuffer has IncrementCounter and DecrementCounter. Only one of these methods can ever be called on any given RWStructuredBuffer instance - the buffer counter can only be incremented or decremented but not both.
Test case rejects IR that calls updateCounter with both a positive and negative number
Design:
Add a new late stage DXIL only pass to llvm/lib/Target/DirectX/DirectXIRPasses that errors when updateCounter is incremented and decremented on the same resource, this pass should be small/focused in order to avoid becoming a kitchen sync
Register the pass in Target/DirectX/DirectXTargetMachine.cpp before DXILOpLowering
Walk the module searching for updateCounter calls. For each updateCounter call
extract the resource handle, and the current inc/dec value
resolve the handle into binding info
check if the key is in a pass global map
if yes: error if map value != current inc/dec value
if no: insert key into map with current inc/dev value
Notes:
SPIR-V doesn't have this restriction so the validation isn't added there
The text was updated successfully, but these errors were encountered:
hekota
changed the title
Validate that updateCounter is only either incremented or decremented and not both
[HLSL] Validate that updateCounter is only either incremented or decremented and not both
Oct 29, 2024
hekota
changed the title
[HLSL] Validate that updateCounter is only either incremented or decremented and not both
[HLSL] Validate that updateCounter is only either incremented or decremented and not both
Oct 29, 2024
RWStructuredBuffer
hasIncrementCounter
andDecrementCounter
. Only one of these methods can ever be called on any givenRWStructuredBuffer
instance - the buffer counter can only be incremented or decremented but not both.DXC validation rule: Instr.OnlyOneAllocConsume
AC:
updateCounter
with both a positive and negative numberDesign:
llvm/lib/Target/DirectX/DirectXIRPasses
that errors whenupdateCounter
is incremented and decremented on the same resource, this pass should be small/focused in order to avoid becoming a kitchen syncTarget/DirectX/DirectXTargetMachine.cpp
beforeDXILOpLowering
updateCounter
calls. For eachupdateCounter
callNotes:
The text was updated successfully, but these errors were encountered: