-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
HLSLHLSL Language SupportHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Use existing clang builtins __builtin_hlsl_buffer_update_counter and __builtin_hlsl_resource_getpointer to implement the Append method on AppendStructuredBuffer and Consume method on ConsumeStructuredBuffer.
These builtins would be lowered to appropriate LLVM DirectX intrinsics during clang codegen.
Depends on #92147 and #106188.
https://godbolt.org/z/qKGdYj5zj
struct MyStruct {
float4 a;
};
AppendStructuredBuffer<MyStruct> AB;
ConsumeStructuredBuffer<MyStruct> CB;
[numthreads(4,1,1)]
void main() {
MyStruct val = CB.Consume();
AB.Append(val);
}
Docs:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-appendstructuredbuffer-append
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-consumestructuredbuffer-consume
AC:
Append/Consumemethods are added to theAppendStructuredBuffer/ConsumeStructuredBufferusing the builtins- Tests added
Metadata
Metadata
Assignees
Labels
HLSLHLSL Language SupportHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Type
Projects
Status
Closed