[clang] [llvm] [HLSL] Implement Sample* methods for Texture2D (PR #179322)

Steven Perron via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 5 12:00:25 PST 2026


================
@@ -1265,6 +1265,276 @@ BuiltinTypeDeclBuilder::addSampleMethods(ResourceDimension Dim) {
       .finalize();
 }
 
+BuiltinTypeDeclBuilder &
+BuiltinTypeDeclBuilder::addSampleBiasMethods(ResourceDimension Dim) {
+  assert(!Record->isCompleteDefinition() && "record is already complete");
+
+  ASTContext &AST = Record->getASTContext();
+  QualType ReturnType = getFirstTemplateTypeParam();
+
+  QualType SamplerStateType =
+      lookupBuiltinType(SemaRef, "SamplerState", Record->getDeclContext());
+
+  uint32_t VecSize = getResourceDimensions(Dim);
+
+  QualType FloatTy = AST.FloatTy;
+  QualType Float2Ty = AST.getExtVectorType(FloatTy, VecSize);
+
+  QualType IntTy = AST.IntTy;
+  QualType Int2Ty = AST.getExtVectorType(IntTy, VecSize);
+
----------------
s-perron wrote:

Done.

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


More information about the cfe-commits mailing list