Skip to content

Commit 1823c11

Browse files
Merge pull request #2453 from KhronosGroup/msl-ptr-bitcast-cleanup
MSL: Use the more proper pointer typing.
2 parents a8834b0 + 3b8b263 commit 1823c11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spirv_msl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10025,11 +10025,11 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
1002510025
auto &type = get<SPIRType>(ops[0]);
1002610026
auto &input_type = expression_type(ops[2]);
1002710027

10028-
if (opcode != OpBitcast || type.pointer || input_type.pointer)
10028+
if (opcode != OpBitcast || is_pointer(type) || is_pointer(input_type))
1002910029
{
1003010030
string op;
1003110031

10032-
if ((type.vecsize == 1 || type.pointer) && (input_type.vecsize == 1 || input_type.pointer))
10032+
if ((type.vecsize == 1 || is_pointer(type)) && (input_type.vecsize == 1 || is_pointer(input_type)))
1003310033
op = join("reinterpret_cast<", type_to_glsl(type), ">(", to_unpacked_expression(ops[2]), ")");
1003410034
else if (input_type.vecsize == 2)
1003510035
op = join("reinterpret_cast<", type_to_glsl(type), ">(as_type<ulong>(", to_unpacked_expression(ops[2]), "))");

0 commit comments

Comments
 (0)