================
@@ -2163,6 +2163,51 @@ static void BuildFlattenedTypeList(QualType BaseTy,
   }
 }
 
+bool SemaHLSL::IsLineVectorLayoutCompatibleType(clang::QualType QT) {
+  if (QT.isNull())
+    return false;
+
+  llvm::SmallVector<QualType, 16> QTTypes;
+  BuildFlattenedTypeList(QT, QTTypes);
----------------
bob80905 wrote:

Understandable, though I think this way is significantly simpler, and won't be 
much of a perf hit.
We allocate at most 4 elements in the list per resource, never any more for 
valid shaders. We would need to allocate at least one subelement with which to 
compare other subelements against using your method. It may be slightly less 
performant, but I think this is readable and it doesn't drag the performance 
down from O(1) to O(N) for valid shaders.(N being number of subelements)


https://github.com/llvm/llvm-project/pull/113730
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to