Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.83k stars 222 forks source link

vkquake compiles ok but fails to launch under MacOS.. #132

Closed oscarbg closed 6 years ago

oscarbg commented 6 years ago

we had a twitter interchange few days ago saying to interested on Metal and I said let's improve current situation by getting feedback to both Apple for Metal impros and MoltenVK..

so tried to compile vkquake using MacOS Vulkan SDK and to my surprise compiled ok changing only libvulkan.so for -framework vulkan.. I did previously: brew upgrade libsdl to use also new SDL 2.0.8 supporting Vulkan for Macos..

also seems crashes very late in the process of Vulkan init so seems good news: will report to MoltenVK devs but anyway is easy to fix from your side this error?: VkPrimitiveTopology value 5 is not supported for rendering worse seems this shader compiler error:


program_source:46:20: error: called object type 'float' is not a function or function pointer
    float dot = dot(vertexnormal, ubo.shade_vector);
                ~~~^

./vkquake Command line: ./vkquake Found SDL version 2.0.8 Detected 4 CPUs. Quake 1.09 (c) id Software GLQuake 1.00 (c) id Software FitzQuake 0.85 (c) John Fitzgibbons FitzQuake SDL port (c) SleepwalkR, Baker QuakeSpasm 0.93.0 (c) Ozkan Sezer, Eric Wasylishen & others vkQuake 0.97.3 (c) Axel Gneiting & others Host_Init Playing shareware version. Console initialized. UDP_Init: skipping gethostbyname for iMac-de-oscar.local UDP Initialized Server using protocol 666 (FitzQuake) Exe: 15:55:12 Mar 3 2018 256.0 megabyte heap

Vulkan Initialization Vendor: NVIDIA Device: AMD Radeon RX Vega 56 Using D32 depth buffer format Creating command buffers Initializing staging Creating descriptor set layouts Initializing dynamic vertex buffers Initializing dynamic index buffers Initializing dynamic uniform buffers Initializing samplers Creating pipeline layouts Using FIFO present mode fpCreateSwapchainKHR Creating color buffer AA disabled Creating depth buffer Creating render passes Creating frame buffers Creating pipelines [MoltenVK ERROR] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPrimitiveTopology value 5 is not supported for rendering. [MoltenVK ERROR] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPrimitiveTopology value 5 is not supported for rendering. [MoltenVK ERROR] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPrimitiveTopology value 5 is not supported for rendering. [MoltenVK ERROR] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPrimitiveTopology value 5 is not supported for rendering. [MoltenVK ERROR] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPrimitiveTopology value 5 is not supported for rendering. [MoltenVK ERROR] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPrimitiveTopology value 5 is not supported for rendering. [MoltenVK ERROR] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPrimitiveTopology value 5 is not supported for rendering. [MoltenVK ERROR] VK_ERROR_INITIALIZATION_FAILED: Shader module compilation failed (code 3):

Compilation failed:

program_source:46:20: error: called object type 'float' is not a function or function pointer float dot = dot(vertexnormal, ubo.shade_vector);



-[MTLRenderPipelineDescriptorInternal validateWithDevice:]:2149: failed assertion `vertexFunction must not be nil.'
Abort trap: 6
Novum commented 6 years ago

How is this a vkQuake bug? This is clearly a flaw in MoltenVK. You should file a bug with them.

oscarbg commented 6 years ago

you are correct not a vkquake bug.. just saying if it's "easy" to massage code to work on MoltenVK.. FYI the shader compiler bug has been fixed so seems right now only missing is triangle fan aka "VkPrimitiveTopology value 5" which is not supported by Metal.. don't know if much work changing triangle fan draw calls for other ones metal supports.. thanks..

Novum commented 6 years ago

Yeah, seems like triangle fans are just not supported. I can look into making it use strips or lists.

oscarbg commented 6 years ago

Would be nice.. thanks..

Novum commented 6 years ago

Try 77f3caf16d46736015ace94e85810c7d2ce8909b

oscarbg commented 6 years ago

thanks... will try now soon that Vulkan 1.1.73 SDK includes Macos binary release with fixes.. curiosity have you tested it already? I see latest commit mentions "restrict the workaround to OSX builds only" are you planning on providing vkquake Macos binary builds on github also?

Novum commented 6 years ago

I do not own Apple hardware and I have no intention to buy any.

oscarbg commented 6 years ago

no problem now it's working!! only some minor issues changing screen res but also not your problem captura de pantalla 2018-04-23 a las 4 32 27

Novum commented 6 years ago

Glad that it works for you