FocusEngine icon indicating copy to clipboard operation
FocusEngine copied to clipboard

Some pre-compiled shaders have trouble on Macs (MoltenVK translation)

Open phr00t opened this issue 6 years ago • 5 comments

[MoltenVK ERROR] VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (error code 3): Compilation failed:

program_source:678:22: warning: variable 'lightVectorNorm' is uninitialized when used here float3 param_2 = lightVectorNorm; ^~~~~~~~~~~~~~~ program_source:677:5: note: variable 'lightVectorNorm' is declared here float3 lightVectorNorm; ^ program_source:810:22: warning: variable 'lightVectorNorm' is uninitialized when used here float3 param_4 = lightVectorNorm; ^~~~~~~~~~~~~~~ program_source:809:5: note: variable 'lightVectorNorm' is declared here float3 lightVectorNorm; ^ program_source:945:5: error: no matching function for call to 'spvArrayCopyFromStack1' spvArrayCopyFromStack1(param, v_446.SphericalColors_id184); ^~~~~~~~~~~~~~~~~~~~~~ program_source:157:6: note: candidate template ignored: deduced conflicting types for parameter 'T' ('float attribute((ext_vector_type(3)))' (vector of 3 'float' values) vs. 'float constant attribute((ext_vector_type(3)))' (vector of 3 'float' values)) void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N]) ^

phr00t avatar May 23 '19 02:05 phr00t

Shaders are located @ engine/Xenko.Rendering/Rendering/Lights/LightPoint.xksl for example

phr00t avatar May 23 '19 02:05 phr00t

The shader having trouble above is used in the "blank" template for the reflective, shiny sphere.

phr00t avatar May 26 '19 23:05 phr00t

Newer MoltenVK libraries are available, worth trying to see if this helps (although haven't gotten the time to do so yet)

phr00t avatar Jun 22 '19 00:06 phr00t

I've updated MoltenVK libraries, but haven't checked this specifically yet.

phr00t avatar Jul 25 '20 17:07 phr00t

There are other random errors relating to MoltenVK and latest Macs, so overall support for Macs has dropped due to these hoops to get Vulkan working on Macs.

phr00t avatar Jun 04 '21 20:06 phr00t