[clang] Create Texture Dimension attribute in HLSL (PR #104239)

Joshua Batista via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 15:15:42 PDT 2024


bob80905 wrote:

> What is this attribute supposed to mean? I think we need some design here before we create the attribute, as it isn't clear to me that a single integer covers our needs. The texture kinds that need to be representable by this and whatever other attributes we design are 1D, 2D, 3D, Cube, and arrays of 1D, 2D, and Cube. How does a single integer map to these? Is the idea that there will be another attribute for arrays and yet another for the Cube case? I'm not convinced this change makes sense on its own without a plan for how it maps to DXIL and probably also SPIR-V.

You're right, a single integer won't be able to match to all those dimension kinds. 
I propose we make an enum, much like llvm::ResourceKind, called TextureDimensionKind, that enumerates all the texture kinds you listed above. Then I can make the attribute take a single enum argument, whether that be "1D", or "1DArray", and that should cover all texture dimension kinds.
Thoughts?

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


More information about the cfe-commits mailing list