[all-commits] [llvm/llvm-project] 5dc371: [HLSL] Split out resource class data from resource...

Joshua Batista via All-commits all-commits at lists.llvm.org
Fri Jul 12 13:10:57 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5dc371e289584928345f74f560a18a805226b5f8
      https://github.com/llvm/llvm-project/commit/5dc371e289584928345f74f560a18a805226b5f8
  Author: Joshua Batista <jbatista at microsoft.com>
  Date:   2024-07-12 (Fri, 12 Jul 2024)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Sema/SemaHLSL.h
    M clang/lib/CodeGen/CGHLSLRuntime.cpp
    M clang/lib/Sema/HLSLExternalSemaSource.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/lib/Sema/SemaHLSL.cpp
    M clang/test/AST/HLSL/RWBuffer-AST.hlsl
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test
    A clang/test/ParserHLSL/hlsl_resource_class_attr.hlsl
    A clang/test/ParserHLSL/hlsl_resource_class_attr_error.hlsl

  Log Message:
  -----------
  [HLSL] Split out resource class data from resource attribute (#98419)

The ability to spell out and specify the resource class is necessary for
testing various resource binding behaviors. Though it is not intended
for users to use this in customized HLSL source code, the ability to
specify the resource class via an attribute is immensely helpful for
writing thorough tests.
This PR introduces a new attribute, hlsl::resource_attribute, that can
only be applied on structs. This attribute only has 1 required argument,
and must be one of:
```
SRV
UAV
CBuffer
Sampler
```
By applying this attribute to a struct, the struct will have the
`HLSLResourceClassAttr` attribute attached to it in the AST
representation, which provides information on the type of resource class
the struct is meant to be.

The resource class data that was originally contained within the
`HLSLResourceAttr` attribute has been removed in favor of this new
attribute, and so certain ast-dump tests need to be modified so that the
same information can be represented via 2 attributes instead of one.

Fixes #98193

---------

Co-authored-by: Damyan Pepper <damyanp at microsoft.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list