Skip to content

[HLSL] Add an attribute to differentiate resource attributes for Buffer vs StructuredBuffer and RawBuffer #107907

@bogner

Description

@bogner

The target extension types for buffers are split into dx.TypedBuffer and dx.RawBuffer in order to separate the types of operation that are possible on the two. Specifically, Typed buffers must be accessed one typed element at a time, whereas Raw and Structured buffers don't have this restriction.

We need to represent this difference in the HLSL AST in order to correctly generate the target types. To do so, we should introduce a type attribute [[raw_buffer]] that will be used on buffer types such as StructuredBuffer or ByteAddressBuffer that do not require typed element access.
 
Note: This is related to llvm/wg-hlsl#68 and llvm/wg-hlsl#42. We should add this attribute to the table in that document.

AC:

  • A new type attribute is introduced that conveys this information on an __hlsl_resource_t

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Supportclang: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