Closed webez closed 3 weeks ago
Again, this is invalid SPIR-V:
%param_var_tex = OpVariable %_ptr_Function_type_2d_image Function
%param_var_cmpSampler = OpVariable %_ptr_Function_type_sampler Function
%26 = OpLoad %type_2d_image %depthTex
OpStore %param_var_tex %26
%27 = OpLoad %type_sampler %depthSampler
OpStore %param_var_cmpSampler %27
%28 = OpFunctionCall %float %DepthSampleCmp %param_var_tex %param_var_cmpSampler
You cannot load and store opaque texture objects like this. -fcgl seems to be "disable legalization", which obviously will not generate correct code.
Hi, I have found that this hlsl code, compiled with Dxc -fcgl , generates non valid msl. It seems that spirv-cross can change the parameter of the function that contains the call to SampleCmpto depth2D but can´t traverse the hierarchy to change all the needed places
Replicated in Shader Playground https://shader-playground.timjones.io/36b79836bf8f6953e9f9d17122b58004