Skip to content

[HLSL] Emit dx.handle.fromBinding instead of dx.create_handle when resource is created  #105076

Closed
@bogner

Description

@bogner

Currently when we generate the constructor for resources in HLSLExternalSemaSource, we emit the dx.create_handle intrinsic. We need to update this to emit dx.handle.fromBinding instead as part of the transition to using target extension types for resources. The call to this intrinsic should capture the binding information from the HLSLResourceBindingAttr on the decl.

The decl with the binding information is not accessible from the resource constructor thought. The dx.handle.fromBinding calls need to be emitted for all resources at the beginning of the entry point function based on the resource binding information collected in task #58051.

In the future, we'll need to handle cases where this should generate other handle creation functions like dx.handle.fromHeap, but that's out of scope of this task.

The dx.create_handle intrinsic will no longer be used after this and can be removed.

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Supportclang:codegenIR generation bugs: mangling, exceptions, etc.clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions