3 Commits

Author SHA1 Message Date
Helena Kotas
e87e028847
[HLSL] Use static create methods to initialize resources in arrays (#157005)
Use static methods `__createFromBinding` and `__createFromImplicitBinding` to initialize resources in resource arrays
instead of calling resource constructors with binding information, per proposal update https://github.com/llvm/wg-hlsl/pull/336.

Test updates include the use of the `llvm-cxxfilt` tool which takes care of demangling of function names for a more readable test baseline.
2025-09-16 16:17:42 -07:00
Helena Kotas
58d2475d8a
[HLSL][NFC] Change line endings to LF (#156930)
Changes line endings in files related to HLSL to LF (`\n`).
2025-09-04 14:19:23 -07:00
Helena Kotas
abb62b6ede
[HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (#154248)
Adds support for accessing sub-arrays from fixed-size multi-dimensional global resource arrays.

Enables indexing into globally scoped, fixed-size resource arrays that have multiple dimensions when the result is a smaller resource array. 

For example:

```
RWBuffer<float> GlobalArray[4][2];

void main() {
  RWBuffer<float> SubArray[2] = GlobalArray[3];
  ...
}
```

The initialization logic is handled during codegen when the ArraySubscriptExpr AST node is processed. When a global resource array is indexed and the result type is a sub-array of the larger array, a local array of the resource type is created and all elements in the array are initialized with a constructor call for the corresponding resource record type and binding.

Closes #145426
2025-09-02 10:10:40 -07:00