From 5120c1cd072548654c9ce79fa85426a5e48736c4 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Wed, 2 Jul 2025 03:03:41 +0800 Subject: extend fiddle to allow custom lua splices in more places (#7559) * Add fkYAML submodule * Generate slang-ir-inst-defs.h from slang-ir-inst-defs.yaml * generate ir-inst-defs.h * neaten things * neaten inst def parser * add rapidyaml submodule * remove fkyaml * remove fkyaml submodule * remove use of ir-inst-defs.h * format and warnings * fix wasm build * tidy * remove rapidyaml * Extend fiddle to allow custom splices in more places * Use lua to describe ir insts * fix * neaten * neaten * neaten * spelling * neaten * comment comment out assert * merge --- source/slang/slang-emit-spirv.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'source/slang/slang-emit-spirv.cpp') diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index 52e8e3d65..1e6f27e7f 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -3494,7 +3494,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex // all loops gets a header block. for (auto irInst : irBlock->getChildren()) { - if (irInst->getOp() == kIROp_loop) + if (irInst->getOp() == kIROp_Loop) { emitOpLabel(spvFunc, irInst); } @@ -3556,9 +3556,9 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex if (as(irInst)) continue; emitLocalInst(spvBlock, irInst); - if (irInst->getOp() == kIROp_loop) + if (irInst->getOp() == kIROp_Loop) pendingLoopInsts.add(as(irInst)); - if (irInst->getOp() == kIROp_discard && !shouldEmitDiscardAsDemote()) + if (irInst->getOp() == kIROp_Discard && !shouldEmitDiscardAsDemote()) { // If we emitted OpKill for discard, we should stop emitting anything // after this inst in the block, because OpKill is a terminator inst. @@ -3600,7 +3600,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex { for (auto use = block->firstUse; use; use = use->nextUse) { - if (use->getUser()->getOp() == kIROp_loop && + if (use->getUser()->getOp() == kIROp_Loop && as(use->getUser())->getTargetBlock() == block) { loopInst = use->getUser(); @@ -3992,7 +3992,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex case kIROp_SwizzledStore: result = emitSwizzledStore(parent, as(inst)); break; - case kIROp_swizzleSet: + case kIROp_SwizzleSet: result = emitSwizzleSet(parent, as(inst)); break; case kIROp_RWStructuredBufferGetElementPtr: @@ -4005,7 +4005,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex case kIROp_GetUntypedBufferPtr: result = emitGetBufferPtr(parent, inst); break; - case kIROp_swizzle: + case kIROp_Swizzle: result = emitSwizzle(parent, as(inst)); break; case kIROp_IntCast: @@ -4169,7 +4169,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex else result = emitOpReturnValue(parent, inst, as(inst)->getVal()); break; - case kIROp_discard: + case kIROp_Discard: if (shouldEmitDiscardAsDemote()) { ensureExtensionDeclarationBeforeSpv16( @@ -4194,7 +4194,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex case kIROp_EndFragmentShaderInterlock: result = emitOpEndInvocationInterlockEXT(parent, inst); break; - case kIROp_unconditionalBranch: + case kIROp_UnconditionalBranch: { // If we are jumping to the main block of a loop, // emit a branch to the loop header instead. @@ -4207,7 +4207,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex result = emitOpBranch(parent, inst, getIRInstSpvID(targetBlock)); break; } - case kIROp_loop: + case kIROp_Loop: { // Return loop header block in its own block. auto blockId = getIRInstSpvID(inst); @@ -4224,7 +4224,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex result = block; break; } - case kIROp_ifElse: + case kIROp_IfElse: { auto ifelseInst = as(inst); auto afterBlockID = getIRInstSpvID(ifelseInst->getAfterBlock()); @@ -4268,7 +4268,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex case kIROp_Unreachable: result = emitOpUnreachable(parent, inst); break; - case kIROp_conditionalBranch: + case kIROp_ConditionalBranch: SLANG_UNEXPECTED("Unstructured branching is not supported by SPIRV."); break; case kIROp_MakeVector: @@ -4320,7 +4320,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex case kIROp_GetStringHash: result = emitGetStringHash(inst); break; - case kIROp_undefined: + case kIROp_Undefined: result = emitOpUndef(parent, inst, inst->getDataType()); break; case kIROp_SPIRVAsm: @@ -6470,10 +6470,10 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex UInt argStartIndex = 0; switch (branchInst->getOp()) { - case kIROp_unconditionalBranch: + case kIROp_UnconditionalBranch: argStartIndex = 1; break; - case kIROp_loop: + case kIROp_Loop: argStartIndex = 3; break; default: -- cgit v1.2.3