Don't add volatile to thread address space variables

This commit is contained in:
Evan Tang 2024-08-07 12:03:25 -05:00
parent 670cc7fb1d
commit 467ba39110
2 changed files with 5 additions and 2 deletions

View File

@ -11,7 +11,7 @@ struct main0_out
}; };
static inline __attribute__((always_inline)) 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; bool _14 = gl_HelperInvocation;
float _17 = float(_14); float _17 = float(_14);

View File

@ -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" : ""; 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) const char *CompilerMSL::to_restrict(uint32_t id, bool space)