I would like to use this lib with Vulkan(for metal on macos) but it fails. It seems like a shader problem( user(locn2)
) but can’t understand it. Any idea why?
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 3):
Fragment input(s) `user(locn2)` mismatching vertex shader output type(s) or not written by vertex shader.
ERROR:GRAPHICS: Vulkan Error (../src/vulkan/graphics_vulkan.cpp:1540) VK_ERROR_INITIALIZATION_FAILED
Assertion failed: (0), function GetOrCreatePipeline, file graphics_vulkan.cpp, line 1540.
Edit: I guess it is related to sprite tex1 on fp
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
program_source:103:165: error: cannot reserve 'texture' resource location at index 0
fragment main0_out main0(main0_in in [[stage_in]], constant _DMENGINE_GENERATED_UB_FS_0& _130 [[buffer(0)]], texture2d<float> tex1 [[texture(0)]], texture2d<float> tex0 [[texture(0)]], sampler tex1Smplr [[sampler(0)]], sampler tex0Smplr [[sampler(0)]])
^
program_source:103:228: error: cannot reserve 'sampler' resource location at index 0
fragment main0_out main0(main0_in in [[stage_in]], constant _DMENGINE_GENERATED_UB_FS_0& _130 [[buffer(0)]], texture2d<float> tex1 [[texture(0)]], texture2d<float> tex0 [[texture(0)]], sampler tex1Smplr [[sampler(0)]], sampler tex0Smplr [[sampler(0)]])
Edit: It works without fog lines on fp but not as expected. Shaders with Vulkan cause issues like flickering and misplacement.
// Fog
// float dist = abs(var_view_pos.z);
// float fog_max = fog.y;
// float fog_min = fog.x;
// float fog_factor = clamp((fog_max - dist) / (fog_max - fog_min) + fog_color.a, 0.0, 1.0 );
// frag_color = mix(fog_color.rgb, frag_color, fog_factor);