-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed as not planned
Closed as not planned
Copy link
Labels
HLSLHLSL Language SupportHLSL Language SupportobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM
Description
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.
DXC validation rule: Instr.OnlyOneAllocConsume
AC:
- Test case rejects IR that calls
updateCounterwith both a positive and negative number
Design:
- Add a new late stage DXIL only pass to
llvm/lib/Target/DirectX/DirectXIRPassesthat errors whenupdateCounteris 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.cppbeforeDXILOpLowering - Walk the module searching for
updateCountercalls. For eachupdateCountercall- 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
This PR is step 3/4 of the changes proposed by https://github.com/llvm/wg-hlsl/blob/main/proposals/0022-resource-instance-analysis.md
Metadata
Metadata
Assignees
Labels
HLSLHLSL Language SupportHLSL Language SupportobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM
Type
Projects
Status
Closed