[clang] [HLSL] Add empty struct test cases to `__builtin_hlsl_is_typed_resource_element_compatible` test file (PR #115045)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 13:51:09 PST 2024


https://github.com/llvm-beanz requested changes to this pull request.

I think there is actually a bigger problem with your earlier PR that we need to address.

There is an inconsistency in the [design document](https://github.com/llvm/wg-hlsl/blob/main/proposals/0011-resource-element-type-validation.md). Specifically in the beginning of the document it says:

> Element types for typed buffer resources:
> * Are not intangible (e.g., isn't a resource type)
> * Must be vectors or scalars of arithmetic types, not bools nor enums nor arrays
> * Should be a scalar or homogenous vector of a floating-point or integer type, with a maximum of 4 components after translating 64-bit components into pairs of uint32_t components Element types for raw buffer resources:
> * Are not intangible (e.g., isn't a resource type)

By this, elements should either be scalar or vectors, but not struct types.

The document later goes on to list test cases that are struct types.

I believe we had determined that DXC generates invalid code for some (most? all?) cases of structs in typed buffer elements, so we had determined to not support structs as element types in Clang.

https://github.com/llvm/llvm-project/pull/115045


More information about the cfe-commits mailing list