SPIRV-Cross/reference/shaders-msl-no-opt/asm/packing/packed-vector-extract-insert.asm.comp
Hans-Kristian Arntzen 23662668dd Attempt more optimal codegen for OpCompositeInsert.
Speculate that we can modify the SSA value in-place. As long as it is
not used after the modify, this is fine.

Also need to make sure we don't attempt to RMW something that is
impossible to modify.
2022-05-18 16:37:33 +02:00

23 lines
339 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct SSBOScalar
{
float2 a;
packed_float3 b;
packed_float3 c;
float3 d;
};
kernel void main0(device SSBOScalar& _4 [[buffer(0)]])
{
float3 _23 = float3(_4.b);
float3 _24 = _23;
_24.z = 2.0;
_4.a = _23.xy * _23.z;
_4.b = _24;
}