diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2025-07-02 03:03:41 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-01 19:03:41 +0000 |
| commit | 5120c1cd072548654c9ce79fa85426a5e48736c4 (patch) | |
| tree | 989bf03035070bb45e261f513b7c9df2cecb1a30 /source/slang/slang-emit-spirv.cpp | |
| parent | b903ae06242e28263247122632511e39447b9e11 (diff) | |
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
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
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<IRVar>(irInst)) continue; emitLocalInst(spvBlock, irInst); - if (irInst->getOp() == kIROp_loop) + if (irInst->getOp() == kIROp_Loop) pendingLoopInsts.add(as<IRLoop>(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<IRLoop>(use->getUser())->getTargetBlock() == block) { loopInst = use->getUser(); @@ -3992,7 +3992,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex case kIROp_SwizzledStore: result = emitSwizzledStore(parent, as<IRSwizzledStore>(inst)); break; - case kIROp_swizzleSet: + case kIROp_SwizzleSet: result = emitSwizzleSet(parent, as<IRSwizzleSet>(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<IRSwizzle>(inst)); break; case kIROp_IntCast: @@ -4169,7 +4169,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex else result = emitOpReturnValue(parent, inst, as<IRReturn>(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<IRIfElse>(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: |
