mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-12 15:10:30 +00:00
MSL: Only do address-of expression when needed.
This commit is contained in:
parent
ed7ba43062
commit
0836c81e73
@ -10027,7 +10027,8 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
|
||||
// We are considered to have a pointer to array and one element shifts by one array at a time.
|
||||
// If we use normal array indexing, we'll first decay to pointer, and lose the array-ness,
|
||||
// so we have to take pointer to array explicitly.
|
||||
expr = enclose_expression(address_of_expression(expr));
|
||||
if (!should_dereference(base))
|
||||
expr = enclose_expression(address_of_expression(expr));
|
||||
}
|
||||
|
||||
if (ptr_chain && i == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user