Skip to content

[DirectX] Introduce llvm.dx.handle.fromBinding intrinsic and lowering #91366

@bogner

Description

@bogner

When creating handles from binding information in llvm we'll represent it with a llvm.dx.handle.fromBinding intrinsic that creates a target type. There's more information in #90553 but generally this will look something like so:

; RWBuffer<float4> Buf : register(u5, space3)
%buf = call target("dx.Buffer", <4 x float>, 1, 0)
            @llvm.dx.handle.fromBinding.tdx.Buffer_v4f32_1_0(
                i32 3, i32 5, i32 1, i32 0, i1 false)

This will need to be lowered to either createHandle or createHandleFromBinding + annotateHandle dxil operations depending on the shader model, as well as the dxil metadata for resource binding.

Acceptance Criteria

  • The llvm intrinsic and dxil operation are defined
  • Emitting dxil will translate the llvm intrinsic to the appropriate dxil op(s) and metadata
  • Pre-SM6.6 DXIL and post are both handled.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions