SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unord-relational-op.relax-nan.asm.frag
Hans-Kristian Arntzen 31be74a853 Add relax_nan_checks options.
Makes codegen from typical D3D emulation SPIR-V more readable.
Also makes cross compilation with NotEqual more sensible.
It's very rare to actually need the strict NaN-checks in practice.

Also, glslang now emits UnordNotEqual by default it seems, so give up
trying to assume OrdNotEqual. Harmonize for UnordNotEqual as the sane
default.
2022-03-03 14:50:56 +01:00

23 lines
472 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant float a_tmp [[function_constant(1)]];
constant float a = is_function_constant_defined(a_tmp) ? a_tmp : 1.0;
constant float b_tmp [[function_constant(2)]];
constant float b = is_function_constant_defined(b_tmp) ? b_tmp : 2.0;
struct main0_out
{
float4 FragColor [[color(0)]];
};
fragment main0_out main0()
{
main0_out out = {};
out.FragColor = float4(a + b);
return out;
}