Spirv_intrinsics: Add support of type specifier to spirv_type
Previously, spirv_type doesn't accept type specifier as its parameter. With this change, we can input non-array type specifier. This is because some SPIR-V type definition intructions often need to reference other SPIR-V types as its source operands. We add the support to facilitate such usage.
This commit is contained in:
parent
eaa7057768
commit
051f18c0cc
10 changed files with 1468 additions and 1359 deletions
|
|
@ -98,12 +98,23 @@ struct TSpirvInstruction {
|
|||
struct TSpirvTypeParameter {
|
||||
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
|
||||
|
||||
TSpirvTypeParameter(const TIntermConstantUnion* arg) { constant = arg; }
|
||||
TSpirvTypeParameter(const TIntermConstantUnion* arg)
|
||||
{
|
||||
constant = arg;
|
||||
type = nullptr;
|
||||
}
|
||||
|
||||
bool operator==(const TSpirvTypeParameter& rhs) const { return constant == rhs.constant; }
|
||||
TSpirvTypeParameter(const TType *arg)
|
||||
{
|
||||
constant = nullptr;
|
||||
type = arg;
|
||||
}
|
||||
|
||||
bool operator==(const TSpirvTypeParameter& rhs) const;
|
||||
bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); }
|
||||
|
||||
const TIntermConstantUnion* constant;
|
||||
const TIntermConstantUnion* constant; // Constant expression
|
||||
const TType* type; // Type specifier
|
||||
};
|
||||
|
||||
typedef TVector<TSpirvTypeParameter> TSpirvTypeParameters;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue