Skip to content

[HLSL] Move resource attributes to resource's handles instead of the class itself #98556

@bogner

Description

@bogner

Currently resource attributes sit on the resource class itself, like so:

[[hlsl::resource(...)]]
[[hlsl::resource_class(uav)]]
template <typename T> class RWBuffer {
  // ...
};

We'd like the attributes to be attached to the resource's internal handle instead as we move towards the "intangible" handle type:

template <typename T> class RWBuffer {
  [[hlsl::resource(...)]]
  [[hlsl::resource_class(uav)]]
  __hlsl_resource_t Handle;
};

Note that this is not blocked by the introduction of the intangible handle type - resources already have a void *Handle member, and we can simply attach these attributes there.

AC:

  • All of the HLSL resource attributes are attached to the handle
  • Diagnostic and backend logic that refers to these attributes continues to work
  • Existing tests are updated to conform to this approach
  • Utility functions added to find information about resource types based on these attributes

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