phr00t / FocusEngine

Focus Game Engine. This is Stride/Xenko fast-tracked for Phr00t's Software games. Improvements over the original Focus on Vulkan support, PC platforms, VR, performance & ease. Cherry-picks commits from other forks as needed.
MIT License
98 stars 11 forks source link

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

Closed phr00t closed 2 months ago

phr00t commented 5 years ago

[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 commented 5 years ago

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

phr00t commented 5 years ago

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

phr00t commented 5 years ago

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

phr00t commented 3 years ago

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

phr00t commented 3 years ago

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.