Closed jiradeto closed 5 years ago
That is because MSL lacks overloads of refract()
for scalars. Most of the functions in <metal_geometric>
, like the length()
function (as you discovered in #1047), lack scalar overloads.
Odd that this is even allowed in SPIR-V, another easy fix I guess ...
On MacOS 10.14, I tried to convert SPIR-V to MSL and found an issue that when using a float variable identifier as the argument of a refract function, the MSL compiler gives the following error:
The GLSL fragment shader:
The MSL shader obtained by SPIRV-Cross:
Versions:
Steps to reproduce:
glslangValidator -V sample.frag -o sample.spv
spirv-cross --msl sample.spv --output result.msl
xcrun --sdk macosx10.14 metal -x metal -std=macos-metal1.2 result.msl
Note that before running SPIRV-Cross, I also used spirv-val to check that the SPIR-V produced by glslangValidator is valid.
This Archive.zip contains the original fragment shader, the associated SPIR-V, and MSL shader.
Issue found using GraphicsFuzz.