Skip to content

Commit

Permalink
Use SpvOpExecutionModeId for modes that require it
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusikkala committed Jan 5, 2025
1 parent 2cda16c commit 1862056
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions source/slang/slang-check-modifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,7 @@ Modifier* SemanticsVisitor::checkModifier(

for (auto member : decl->parentDecl->members)
{
auto constantId =
member->findModifier<VkConstantIdAttribute>();
auto constantId = member->findModifier<VkConstantIdAttribute>();
if (constantId)
{
SLANG_ASSERT(constantId->args.getCount() == 1);
Expand Down
10 changes: 9 additions & 1 deletion source/slang/slang-emit-spirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7967,10 +7967,18 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
{
if (m_executionModes[entryPoint].add(executionMode))
{
SpvOp execModeOp = SpvOpExecutionMode;
if (executionMode == SpvExecutionModeLocalSizeId ||
executionMode == SpvExecutionModeLocalSizeHintId ||
executionMode == SpvExecutionModeSubgroupsPerWorkgroupId)
{
execModeOp = SpvOpExecutionModeId;
}

emitInst(
getSection(SpvLogicalSectionID::ExecutionModes),
parentInst,
SpvOpExecutionMode,
execModeOp,
entryPoint,
executionMode,
ops...);
Expand Down

0 comments on commit 1862056

Please sign in to comment.