Skip to content

Commit 7594d2b

Browse files
Revert questionable change to bitcast.
1 parent 8f37924 commit 7594d2b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

reference/opt/shaders-msl/comp/buffer_device_address-packed-vec-and-cast-to-and-from-uvec2.msl23.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct SSBO
1919
kernel void main0(constant UBO& _10 [[buffer(0)]])
2020
{
2121
(reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b)))->a1 = float3(1.0, 2.0, 3.0);
22-
device SSBO* _39 = reinterpret_cast<device SSBO*>(as_type<ulong>(as_type<uint2>(reinterpret_cast<ulong>((reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b + uint2(32u))))))));
22+
device SSBO* _39 = reinterpret_cast<device SSBO*>(as_type<ulong>(as_type<uint2>(reinterpret_cast<ulong>(reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b + uint2(32u)))))));
2323
_39->a1 = float3(_39->a1) + float3(1.0);
2424
}
2525

reference/shaders-msl/comp/buffer_device_address-packed-vec-and-cast-to-and-from-uvec2.msl23.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct SSBO
1919
kernel void main0(constant UBO& _10 [[buffer(0)]])
2020
{
2121
(reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b)))->a1 = float3(1.0, 2.0, 3.0);
22-
uint2 v2 = as_type<uint2>(reinterpret_cast<ulong>((reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b + uint2(32u))))));
22+
uint2 v2 = as_type<uint2>(reinterpret_cast<ulong>(reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b + uint2(32u)))));
2323
float3 v3 = float3((reinterpret_cast<device SSBO*>(as_type<ulong>(v2)))->a1);
2424
(reinterpret_cast<device SSBO*>(as_type<ulong>(v2)))->a1 = v3 + float3(1.0);
2525
}

spirv_msl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10529,7 +10529,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
1052910529
if (opcode != OpBitcast || is_pointer(type) || is_pointer(input_type))
1053010530
{
1053110531
string op;
10532-
auto input_expr = is_pointer(input_type) ? to_ptr_expression(ops[2]) : to_unpacked_expression(ops[2]);
10532+
auto input_expr = to_unpacked_expression(ops[2]);
1053310533

1053410534
if ((type.vecsize == 1 || is_pointer(type)) && (input_type.vecsize == 1 || is_pointer(input_type)))
1053510535
op = join("reinterpret_cast<", type_to_glsl(type), ">(", input_expr, ")");

0 commit comments

Comments
 (0)