-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[HLSL] Implement IncrementCounter
/DecrementCounter
on structured buffers
#113513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
IncrementCounter
/DecrementCounter
on structured buffersIncrementCounter
/DecrementCounter
on RWStructuredBuffer
IncrementCounter
/DecrementCounter
on RWStructuredBuffer
IncrementCounter
/DecrementCounter
on structured buffers
Introduces `__builtin_hlsl_buffer_update_counter` clang buildin that is used to implement IncrementCounter and DecrementCounter methods on RWStructuredBuffer and RasterizerOrderedStructuredBuffer. The builtin is translated to LLVM intrisics llvm.dx.bufferUpdateCounter/llvm.spv.bufferUpdateCounter. Introduces `BuiltinTypeMethodBuilder` helper in `HLSLExternalSemaSource` that allows adding methods to builtin types using the builder pattern like this: BuiltinTypeMethodBuilder(Sema, RecordBuilder, "MethodName", ReturnType) .addParam("param_name", Type, InOutModifier) .callBuiltin("buildin_name", { BuiltinParams }) .finalizeMethod(); Fixes llvm#113513
@llvm/issue-subscribers-clang-codegen Author: Helena Kotas (hekota)
Introduce a clang builtin that will be used to implement the implement `IncrementCounter` and `DecrementCounter` methods on structured buffers. The builtin could be something like this:
Allowed values for The builtin would be lowered to LLVM DirectX intrinsic Applies to:
Docs: Example: AC:
|
@llvm/issue-subscribers-clang-frontend Author: Helena Kotas (hekota)
Introduce a clang builtin that will be used to implement the implement `IncrementCounter` and `DecrementCounter` methods on structured buffers. The builtin could be something like this:
Allowed values for The builtin would be lowered to LLVM DirectX intrinsic Applies to:
Docs: Example: AC:
|
…rs (#117608) Introduces `__builtin_hlsl_buffer_update_counter` clang buildin that is used to implement the `IncrementCounter` and `DecrementCounter` methods on `RWStructuredBuffer` and `RasterizerOrderedStructuredBuffer` (see Note). The builtin is translated to LLVM intrisic `llvm.dx.bufferUpdateCounter` or `llvm.spv.bufferUpdateCounter`. Introduces `BuiltinTypeMethodBuilder` helper in `HLSLExternalSemaSource` that enables adding methods to builtin types using builder pattern like this: ``` BuiltinTypeMethodBuilder(Sema, RecordBuilder, "MethodName", ReturnType) .addParam("param_name", Type, InOutModifier) .callBuiltin("buildin_name", { BuiltinParams }) .finalizeMethod(); ``` Fixes #113513 [First version](#114148) of this PR was reverted because of build break.
Uh oh!
There was an error while loading. Please reload this page.
Introduce a clang builtin that will be used to implement the implement
IncrementCounter
andDecrementCounter
methods on structured buffers. The builtin could be something like this:Allowed values for
value
are1
or-1
.The builtin would be lowered to LLVM DirectX intrinsic
llvm.dx.bufferUpdateCounter
during clang codegen. Related to task #92147.Applies to:
Docs:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-rwstructuredbuffer
Example:
https://godbolt.org/z/1aWf4Pec7
AC:
IncrementCounter
andDecrementCounter
method can be implemented using this builtinThe text was updated successfully, but these errors were encountered: