SPIRV-Cross/reference/shaders-msl-no-opt/comp/trivial-select-cast-vector.comp
Hans-Kristian Arntzen 6071df5840 Fix wrong detection of trivial_mix_op.
Effectively, only the last component of the select was considered, need
to correctly early out if any case is hit.
2021-10-13 15:34:00 +02:00

20 lines
334 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct A
{
float3 a;
float3 b;
};
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
kernel void main0(device A& _14 [[buffer(0)]])
{
bool3 c = _14.b < float3(1.0);
_14.a = select(float3(1.0, 0.0, 0.0), float3(0.0, 0.0, 1.0), c);
}