[clang] [HLSL] Implement TextureCube resource type (PR #218520)
Helena Kotas via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 28 12:18:35 PDT 2026
================
@@ -296,6 +296,32 @@ static BuiltinTypeDeclBuilder setupRWTextureType(CXXRecordDecl *Decl, Sema &S,
.addStaticInitializationFunctions(false);
}
+/// Set up TextureCube type: SRV cube texture. Locations are float3 direction
+/// vectors into the cube rather than texel coordinates, so cube textures have
+/// no Load, no operator[] and no mips member. Their sampling and gather
+/// methods also have no offset overloads.
+static BuiltinTypeDeclBuilder setupTextureCubeType(CXXRecordDecl *Decl,
+ Sema &S) {
+ const ResourceDimension Dim = ResourceDimension::Cube;
----------------
hekota wrote:
```suggestion
constexpr ResourceDimension Dim = ResourceDimension::Cube;
```
This can be constexpr as well. I assume the IsArray variable will become a function arg in the next PR.
https://github.com/llvm/llvm-project/pull/218520
More information about the cfe-commits
mailing list