diff options
| author | Yong He <yonghe@outlook.com> | 2023-11-16 14:32:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 14:32:33 -0800 |
| commit | 4c78efd0c34442866f20e9d00bbb6908115c9a01 (patch) | |
| tree | 03ca8584847f0937a926f6b27386dcd982ed7780 /source/slang/slang-serialize-ir.cpp | |
| parent | 12f7237e4060388494c549623f4a640327b7ca08 (diff) | |
Unify stdlib `Texture` types into one generic type. (#3327)
* Unify Texture types in stdlib into 1 generic type.
* Fixes.
* Fix.
* Fixes.
* Fix reflection.
* Fix binding reflection.
* Add gather intrinsics.
* Fix gather intrinsics.
* Fix texture type toText.
* Fix intrinsic.
* fix cuda intrinsic.
* Fix project files.
* cleanup.
* Fix.
* Fix.
* Fix sampler feedback test.
* Fix getDimension intrinsics.
* Fix spirv sample image intrinsics.
* Fix test.
* Fix GLSL intrinsic.
* Cleanup.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-serialize-ir.cpp')
| -rw-r--r-- | source/slang/slang-serialize-ir.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/source/slang/slang-serialize-ir.cpp b/source/slang/slang-serialize-ir.cpp index d84049b74..ccd5a2e7d 100644 --- a/source/slang/slang-serialize-ir.cpp +++ b/source/slang/slang-serialize-ir.cpp @@ -10,12 +10,6 @@ namespace Slang { -static bool _isTextureTypeBase(IROp opIn) -{ - const int op = (kIROpMask_OpMask & opIn); - return op >= kIROp_FirstTextureTypeBase && op <= kIROp_LastTextureTypeBase; -} - static bool _isConstant(IROp opIn) { const int op = (kIROpMask_OpMask & opIn); @@ -246,15 +240,6 @@ Result IRSerialWriter::write(IRModule* module, SerialSourceLocWriter* sourceLocW continue; } - IRTextureTypeBase* textureBase = as<IRTextureTypeBase>(srcInst); - if (textureBase) - { - dstInst.m_payloadType = PayloadType::OperandAndUInt32; - dstInst.m_payload.m_operandAndUInt32.m_uint32 = uint32_t(srcInst->getOp()) >> kIROpMeta_OtherShift; - dstInst.m_payload.m_operandAndUInt32.m_operand = getInstIndex(textureBase->getElementType()); - continue; - } - // ModuleInst is different, in so far as it holds a pointer to IRModule, but we don't need // to save that off in a special way, so can just use regular path @@ -834,22 +819,6 @@ Result IRSerialReader::read(const IRSerialData& data, Session* session, SerialSo insts[i] = irConst; } - else if (_isTextureTypeBase(op)) - { - // TODO: We should clean up the IR encoding of texture types so that - // they do not need to have special-case suport in the serialization layer. - - // All IR texture types currently have a single operand - Int operandCount = 1; - IRTextureTypeBase* inst = module->_allocateInst<IRTextureTypeBase>(op, operandCount); - SLANG_ASSERT(srcInst.m_payloadType == PayloadType::OperandAndUInt32); - - // Reintroduce the texture type bits into the the - const uint32_t other = srcInst.m_payload.m_operandAndUInt32.m_uint32; - inst->m_op = IROp(uint32_t(inst->getOp()) | (other << kIROpMeta_OtherShift)); - - insts[i] = inst; - } else { int numOperands = srcInst.getNumOperands(); |
