Closed zettdaymond closed 4 years ago
Think it's to do with the Vulkan version. Works for me and I'm using 1.0.85. Got this last time I tried to update it. I'll try again to a more update to a more recent version.
Seems like on newer Vulkan/Moltenvk versions commenting out //deviceFeatures.shaderCullDistance = VK_TRUE; Before vkCreateDevice fixes the issue.
After update to the latest dev
branch, I got those errors:
[20:30:56] LUMOS: Lumos Engine - Version 0.2.2
[20:30:56] LUMOS: Initialised JobSystem with [8 cores] [8 threads]
[20:30:56] LUMOS: Initializing System
[20:30:56] LUMOS: Creating window - Title : Sandbox, Width : 1280, Height : 800
[20:30:56] LUMOS: Initialised GLFW version : 3.3.0 Cocoa NSGL EGL OSMesa
[20:30:57] LUMOS: Battery Info - Percentage : 19 , Time Left 2280s , State : On Battery
[20:30:57] LUMOS: Vulkan : 1.0.108
[20:30:57] LUMOS: GPU : AMD Radeon R9 M370X
[20:30:57] LUMOS: Vendor ID : 4098
[20:30:57] LUMOS: Device Type : DISCRETE GPU
[20:30:57] LUMOS: Driver Version : 0.2.1843
[20:30:57] LUMOS: Profiler Enabled
[20:30:57] LUMOS: Creating SoundSystem!
[20:30:57] LUMOS: Found the following devices: Built-in Output
[20:30:57] LUMOS: SoundSystem created with device: Built-in Output
[20:30:57] APP: [SceneManager] - Enqueued scene : SceneModelViewer
[20:30:57] APP: [SceneManager] - Enqueued scene : 2D Test
[20:30:57] APP: [SceneManager] - Enqueued scene : Physics Scene
[20:30:57] APP: [SceneManager] - Enqueued scene : Terrain Test
[20:30:57] APP: [SceneManager] - Enqueued scene : Material Test
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
Compilation failed:
program_source:190:158: error: expected ')'
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:190:16: note: to match this '('
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:232:36: error: use of undeclared identifier 'material'; did you mean 'Material'?
float3 Lh = normalize(Li + material.View);
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:233:42: error: use of undeclared identifier 'material'; did you mean 'Material'?
float cosLi = fast::max(0.0, dot(material.Normal, Li));
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:234:42: error: use of undeclared identifier 'material'; did you mean 'Material'?
float cosLh = fast::max(0.0, dot(material.Normal, Lh));
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:236:48: error: use of undeclared identifier 'material'; did you mean 'Material'?
float param_1 = fast::max(0.0, dot(Lh, material.View));
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:239:25: error: use of undeclared identifier 'material'; did you mean 'Material'?
float param_3 = material.Roughness;
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:242:25: error: use of undeclared identifier 'material'; did you mean 'Material'?
float param_5 = material.NDotV;
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:243:25: error: use of undeclared identifier 'material'; did you mean 'Material'?
float param_6 = material.Roughness;
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:245:48: error: use of undeclared identifier 'material'; did you mean 'Material'?
float3 kd = (float3(1.0) - F) * (1.0 - material.Specular.x);
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:246:35: error: use of undeclared identifier 'material'; did you mean 'Material'?
float3 diffuseBRDF = kd * material.Albedo.xyz;
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
program_source:247:119: error: use of undeclared identifier 'material'; did you mean 'Material'?
float3 specularBRDF = ((F * D) * G) / float3(fast::max(9.9999997473787516355514526367188e-06, (4.0 * cosLi) * material.NDotV));
^~~~~~~~
Material
program_source:190:149: note: 'Material' declared here
float3 Lighting(thread const float3& F0, thread const float& shadow, thread const float3& wsPos, constant UniformBufferLight& ubo, thread Material& Material material)
^
.
[mvk-error] VK_ERROR_INVALID_SHADER_NV: Fragment shader function could not be compiled into pipeline. See previous logged error.
[20:30:58] LUMOS: [SceneManager] - Scene switched to : Physics Scene
Segmentation fault: 11
Looks like it is my hardware/MoltenVK problem. Anyway, thank you for answers.
Hmm strange the shader not compiling on a different moltenvk version. I've submitted a potential fix.
Fix helped! Thank you.
But all tests passed:
Reproduced on
master
anddev
branch