diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-14 16:23:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-14 16:23:19 -0700 |
| commit | 661d6198bbb9857d3fdc6df477e0742ed0b0765c (patch) | |
| tree | 974a57cfa2e43624e91502e9e652a0cc78105b3a /source/slang/slang-ir-util.cpp | |
| parent | 0403e0556b470f6b316153caea2dc6f5c314da5b (diff) | |
Support per field matrix layout (#3101)
* Support per field matrix layout
* Fix warnings.
* Fix.
* Fix tests.
* Fix spiv gen.
* Fix.
* More test fixes.
* Fix.
* Run only GPU tests on self-hosted servers.
* Remove -use-glsl-matrix-layout-modifier.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
| -rw-r--r-- | source/slang/slang-ir-util.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 41ac19ee9..f96cc174c 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -407,6 +407,8 @@ bool isPtrLikeOrHandleType(IRInst* type) return true; if (as<IRPseudoPtrType>(type)) return true; + if (as<IRHLSLStructuredBufferTypeBase>(type)) + return true; switch (type->getOp()) { case kIROp_ComPtrType: @@ -871,10 +873,15 @@ bool isGlobalOrUnknownMutableAddress(IRGlobalValueWithCode* parentFunc, IRInst* if (root) { + // If this is a global readonly resource, it is not a mutable address. if (as<IRParameterGroupType>(root->getDataType())) { return false; } + if (as<IRHLSLStructuredBufferType>(root->getDataType())) + { + return false; + } } switch (root->getOp()) @@ -991,6 +998,47 @@ void resetScratchDataBit(IRInst* inst, int bitIndex) } } +UnownedStringSlice getBasicTypeNameHint(IRType* basicType) +{ + switch (basicType->getOp()) + { + case kIROp_IntType: + return UnownedStringSlice::fromLiteral("int"); + case kIROp_Int8Type: + return UnownedStringSlice::fromLiteral("int8"); + case kIROp_Int16Type: + return UnownedStringSlice::fromLiteral("int16"); + case kIROp_Int64Type: + return UnownedStringSlice::fromLiteral("int64"); + case kIROp_IntPtrType: + return UnownedStringSlice::fromLiteral("intptr"); + case kIROp_UIntType: + return UnownedStringSlice::fromLiteral("uint"); + case kIROp_UInt8Type: + return UnownedStringSlice::fromLiteral("uint8"); + case kIROp_UInt16Type: + return UnownedStringSlice::fromLiteral("uint16"); + case kIROp_UInt64Type: + return UnownedStringSlice::fromLiteral("uint64"); + case kIROp_UIntPtrType: + return UnownedStringSlice::fromLiteral("uintptr"); + case kIROp_FloatType: + return UnownedStringSlice::fromLiteral("float"); + case kIROp_HalfType: + return UnownedStringSlice::fromLiteral("half"); + case kIROp_DoubleType: + return UnownedStringSlice::fromLiteral("double"); + case kIROp_BoolType: + return UnownedStringSlice::fromLiteral("bool"); + case kIROp_VoidType: + return UnownedStringSlice::fromLiteral("void"); + case kIROp_CharType: + return UnownedStringSlice::fromLiteral("char"); + default: + return UnownedStringSlice(); + } +} + struct GenericChildrenMigrationContextImpl { IRCloneEnv cloneEnv; |
