Skip to content

Commit ade5a45

Browse files
committed
address review + fix test
1 parent 66eb23e commit ade5a45

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

source/slang/slang-emit-spirv-ops.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,6 @@ SpvInst* emitOpEntryPoint(
7373
return emitInst(parent, inst, SpvOpEntryPoint, executionModel, entryPoint, name, interfaces);
7474
}
7575

76-
// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpExecutionMode
77-
template<typename... Operands, typename T>
78-
SpvInst* emitOpExecutionMode(
79-
SpvInstParent* parent,
80-
IRInst* inst,
81-
const T& entryPoint,
82-
SpvExecutionMode mode,
83-
const Operands& ...ops
84-
)
85-
{
86-
static_assert(isSingular<T>);
87-
return emitInst(parent, inst, SpvOpExecutionMode, entryPoint, mode, ops...);
88-
}
89-
9076
// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpCapability
9177
SpvInst* emitOpCapability(SpvInstParent* parent, IRInst* inst, SpvCapability capability)
9278
{

source/slang/slang-emit-spirv.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6141,15 +6141,17 @@ struct SPIRVEmitContext
61416141
}
61426142
}
61436143

6144+
// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpExecutionMode
61446145
Dictionary<SpvWord, OrderedHashSet<SpvExecutionMode>> m_executionModes;
61456146
template<typename... Operands>
61466147
void requireSPIRVExecutionMode(IRInst* parentInst, SpvWord entryPoint, SpvExecutionMode executionMode, const Operands& ...ops)
61476148
{
61486149
if (m_executionModes[entryPoint].add(executionMode))
61496150
{
6150-
emitOpExecutionMode(
6151+
emitInst(
61516152
getSection(SpvLogicalSectionID::ExecutionModes),
61526153
parentInst,
6154+
SpvOpExecutionMode,
61536155
entryPoint,
61546156
executionMode,
61556157
ops...

tests/glsl-intrinsic/compute-derivative/intrinsic-derivative-function-in-compute.slang

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
// CHECK_GLSL_LINEAR_C: layout(derivative_group_linearNV)
1111

1212
//TEST:SIMPLE(filecheck=CHECK_SPV_QUAD_C): -allow-glsl -stage compute -entry computeMain -target spirv -DQUAD -DCOMPUTE
13-
// CHECK_SPV_QUAD_C-COUNT-1: DerivativeGroupQuadsNV
14-
// CHECK_SPV_QUAD_C-COUNT-1: "SPV_NV_compute_shader_derivatives"
13+
// CHECK_SPV_QUAD_C: DerivativeGroupQuadsNV
14+
// CHECK_SPV_QUAD_C-NOT: DerivativeGroupQuadsNV
15+
// CHECK_SPV_QUAD_C: "SPV_NV_compute_shader_derivatives"
16+
// CHECK_SPV_QUAD_C-NOT: "SPV_NV_compute_shader_derivatives"
1517

1618
//TEST:SIMPLE(filecheck=CHECK_SPV_LINEAR_C): -allow-glsl -stage compute -entry computeMain -target spirv -DLINEAR -DCOMPUTE
17-
// CHECK_SPV_LINEAR_C-COUNT-1: DerivativeGroupLinearNV
18-
// CHECK_SPV_LINEAR_C-COUNT-1: "SPV_NV_compute_shader_derivatives"
19+
// CHECK_SPV_LINEAR_C: DerivativeGroupLinearNV
20+
// CHECK_SPV_LINEAR_C-NOT: DerivativeGroupLinearNV
21+
// CHECK_SPV_LINEAR_C: "SPV_NV_compute_shader_derivatives"
22+
// CHECK_SPV_LINEAR_C-NOT: "SPV_NV_compute_shader_derivatives"
1923

2024
//TEST:SIMPLE(filecheck=CHECK_HLSL_C): -allow-glsl -stage compute -entry computeMain -target hlsl -DCOMPUTE
2125
// CHECK_HLSL_C: computeMain(

0 commit comments

Comments
 (0)