Skip to content

[DirectX] Introduce llvm.dx.updateCounter intrinsic and lower it to the dxil op #92147

@bogner

Description

@bogner

We need the intrinsic lowering for the bufferUpdateCounter DXIL op, which is emitted to implement RWStructuredBuffer's increment and decrement counter methods as well as Append/Consume methods on AppendStructuredBuffer and ConsumeStructuredBuffer.

This is needed for llvm/wg-hlsl#179

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);
}

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions