Closed webez closed 3 weeks ago
This is invalid SPIR-V.
error: line 52: Pointer operand '19[%19]' must be a memory object declaration
%20 = OpFunctionCall %void %Func %19
You cannot take an access chain and pass it as a parameter like this. DXC is generating illegal code here.
I don't know what -fcgl is, but it's not documented.
-fcgl enables CodeGenHighLevel in Dxc (which disables legalization) and is needed to generate msl that still looks like the original hlsl source.
Yes, but if it generates invalid SPIR-V, it generates invalid SPIR-V. At least maybe run partial legalization that does not require inlining.
Hi, I have found that this hlsl code, compiled with Dxc -fcgl , generates non valid msl with error: non-const reference cannot bind to vector element. I am using Dxc -fcgl and almost non spirv-opt passes to have msl as faithful to the original hlsl code as possible.
Replicated in Shader Playground https://shader-playground.timjones.io/74fa5859a78e876ae148496f74810e1e