[clang] [llvm] [HLSL] Add Texture2DMS (PR #211972)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 17 09:52:54 PDT 2026
================
@@ -297,6 +297,24 @@ static BuiltinTypeDeclBuilder setupRWTextureType(CXXRecordDecl *Decl, Sema &S,
.addStaticInitializationFunctions(false);
}
+/// Set up Texture2DMS (multisampled) type: SRV texture with only operator[]
+/// and sample-indexed Load. It does not support sampling, gather, LOD, or mips.
+static BuiltinTypeDeclBuilder setupMSTextureType(CXXRecordDecl *Decl, Sema &S,
+ bool IsArray,
+ ResourceDimension Dim) {
+ return BuiltinTypeDeclBuilder(S, Decl)
+ .addTextureHandle(ResourceClass::SRV, /*IsROV=*/false, IsArray, Dim,
+ /*IsMultiSampled=*/true)
+ .addTextureLoadMSMethods(Dim, IsArray)
+ .addArraySubscriptOperators(Dim, IsArray)
+ // TODO: Add MS-specific GetDimensions (with a NumberOfSamples output);
+ // the generic addGetDimensionsMethods is mip-based and unsuitable here.
----------------
bogner wrote:
I assume we have an issue for this - can we link it here?
https://github.com/llvm/llvm-project/pull/211972
More information about the cfe-commits
mailing list