From 4c78efd0c34442866f20e9d00bbb6908115c9a01 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 16 Nov 2023 14:32:33 -0800 Subject: 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 --- source/slang/slang-serialize-ir.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'source/slang/slang-serialize-ir.cpp') 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(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(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(); -- cgit v1.2.3