llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.42k stars 12.16k forks source link

[DirectX] Introduce llvm.dx.bufferGetDimensions and lower it to getDimensions dxil ops #112982

Open hekota opened 1 month ago

hekota commented 1 month ago

We need LLVM intrinsic for bufferGetDimensions which will be lowered to the op.dx.getDimensions dxil operations. These will be used on structured buffers.

https://godbolt.org/z/bz7zxsf5n

damyanp commented 1 month ago

@hekota - can you compare this to #101579 please and figure out which one we should go forward with?

farzonl commented 2 weeks ago
farzonl commented 1 week ago

There are 54 cases of GetDimensions we need to support. Below is how they are used per Handle type.

Texture1D

Texture1DArray

Texture2D

Texture2DMS

Texture2DArray

Texture2DArrayMS

Texture3D

TextureCUBE

TextureCUBEArray

Buffer

RWTexture1D

RWTexture1DArray

RWTexture2D

RWTexture2DArray

RWTexture2DMS

RWTexture3D

RWBuffer

ByteAddressBuffer

RWByteAddressBuffer

StructuredBuffer

RWStructuredBuffer

AppendStructuredBuffer

ConsumeStructuredBuffer