Skip to content

Commit

Permalink
Don't add volatile to thread address space variables
Browse files Browse the repository at this point in the history
  • Loading branch information
etang-cw committed Aug 7, 2024
1 parent 670cc7f commit 467ba39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct main0_out
};

static inline __attribute__((always_inline))
void func(thread float& FragColor, volatile thread bool& gl_HelperInvocation)
void func(thread float& FragColor, thread bool& gl_HelperInvocation)
{
bool _14 = gl_HelperInvocation;
float _17 = float(_14);
Expand Down
5 changes: 4 additions & 1 deletion spirv_msl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13213,7 +13213,10 @@ string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id, bo
addr_space = type.pointer || (argument && type.basetype == SPIRType::ControlPointArray) ? "thread" : "";
}

return join(decoration_flags_signal_volatile(flags) ? "volatile " : "", addr_space);
if (decoration_flags_signal_volatile(flags) && 0 != strcmp(addr_space, "thread"))
return join("volatile ", addr_space);
else
return addr_space;
}

const char *CompilerMSL::to_restrict(uint32_t id, bool space)
Expand Down

0 comments on commit 467ba39

Please sign in to comment.