Skip to content

Commit 66eb23e

Browse files
committed
get inst->id directly
1 parent df8279f commit 66eb23e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/slang/slang-emit-spirv.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,13 +2765,13 @@ struct SPIRVEmitContext
27652765
if (isQuad)
27662766
{
27672767
verifyComputeDerivativeGroupModifiers(this->m_sink, inst->sourceLoc, true, false, numThreadsDecor);
2768-
requireSPIRVExecutionMode(nullptr, getID(ensureInst(entryPoint)), SpvExecutionModeDerivativeGroupQuadsNV);
2768+
requireSPIRVExecutionMode(nullptr, getIRInstSpvID(entryPoint), SpvExecutionModeDerivativeGroupQuadsNV);
27692769
requireSPIRVCapability(SpvCapabilityComputeDerivativeGroupQuadsNV);
27702770
}
27712771
else
27722772
{
27732773
verifyComputeDerivativeGroupModifiers(this->m_sink, inst->sourceLoc, false, true, numThreadsDecor);
2774-
requireSPIRVExecutionMode(nullptr, getID(ensureInst(entryPoint)), SpvExecutionModeDerivativeGroupLinearNV);
2774+
requireSPIRVExecutionMode(nullptr, getIRInstSpvID(entryPoint), SpvExecutionModeDerivativeGroupLinearNV);
27752775
requireSPIRVCapability(SpvCapabilityComputeDerivativeGroupLinearNV);
27762776
}
27772777
}
@@ -2790,7 +2790,7 @@ struct SPIRVEmitContext
27902790
case kIROp_BeginFragmentShaderInterlock:
27912791
ensureExtensionDeclaration(UnownedStringSlice("SPV_EXT_fragment_shader_interlock"));
27922792
requireSPIRVCapability(SpvCapabilityFragmentShaderPixelInterlockEXT);
2793-
requireSPIRVExecutionMode(nullptr, getID(ensureInst(getParentFunc(inst))), SpvExecutionModePixelInterlockOrderedEXT);
2793+
requireSPIRVExecutionMode(nullptr, getIRInstSpvID(getParentFunc(inst)), SpvExecutionModePixelInterlockOrderedEXT);
27942794
result = emitOpBeginInvocationInterlockEXT(parent, inst);
27952795
break;
27962796
case kIROp_EndFragmentShaderInterlock:
@@ -3130,7 +3130,7 @@ struct SPIRVEmitContext
31303130
if (mode == SpvExecutionModeMax)
31313131
return;
31323132

3133-
requireSPIRVExecutionMode(nullptr, getID(ensureInst(entryPoint)), mode);
3133+
requireSPIRVExecutionMode(nullptr, getIRInstSpvID(entryPoint), mode);
31343134
}
31353135

31363136
// Make user type name conform to `SPV_GOOGLE_user_type` spec.
@@ -3249,14 +3249,14 @@ struct SPIRVEmitContext
32493249
{
32503250
case Stage::Fragment:
32513251
//OpExecutionMode %main OriginUpperLeft
3252-
requireSPIRVExecutionMode(nullptr, getID(ensureInst(entryPoint)), SpvExecutionModeOriginUpperLeft);
3252+
requireSPIRVExecutionMode(nullptr, getIRInstSpvID(entryPoint), SpvExecutionModeOriginUpperLeft);
32533253
maybeEmitEntryPointDepthReplacingExecutionMode(entryPoint, referencedBuiltinIRVars);
32543254
for (auto decor : entryPoint->getDecorations())
32553255
{
32563256
switch (decor->getOp())
32573257
{
32583258
case kIROp_EarlyDepthStencilDecoration:
3259-
requireSPIRVExecutionMode(nullptr, getID(ensureInst(entryPoint)), SpvExecutionModeEarlyFragmentTests);
3259+
requireSPIRVExecutionMode(nullptr, getIRInstSpvID(entryPoint), SpvExecutionModeEarlyFragmentTests);
32603260
break;
32613261
default:
32623262
break;

0 commit comments

Comments
 (0)