[llvm] [SPIRV] Add reads from image buffer for shaders. (PR #115178)
Steven Perron via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 8 06:42:41 PST 2024
================
@@ -388,6 +391,12 @@ class SPIRVGlobalRegistry {
unsigned getScalarOrVectorComponentCount(Register VReg) const;
unsigned getScalarOrVectorComponentCount(SPIRVType *Type) const;
+ // Return the component type in a vector if the argument is associated with
+ // a vector type. Returns the argument itself for a scalar type, and nullptr
+ // for a missing type.
+ SPIRVType *getScalarOrVectorComponentType(Register VReg) const;
+ SPIRVType *getScalarOrVectorComponentType(SPIRVType *Type) const;
----------------
s-perron wrote:
I updated the comment to say that it returns the type itself for any type other than vector.
This behaviour matches all of the other `scalarOrVector` functions. I've added an assert to make sure that the result of this function matches with `isScalarOrVectorOfType`.
https://github.com/llvm/llvm-project/pull/115178
More information about the llvm-commits
mailing list