Firstly, there are only three supported surface formats. This is because MoltenVK uses a CAMetalLayer for its rendering, and this only supports five formats, and two of them are just downright odd, so justifiably ignored. These translate into the following Vulkan surface formats...
VK_FORMAT_B8G8R8A8_UNORM
VK_FORMAT_B8G8R8A8_SRGB
VK_FORMAT_R16G16B16A16_SFLOAT
...which gives us plenty to work with. This should not be considered odd at all, the current Nvidia drivers on Linux, 396.54, as well as the current Nvidia Windows drivers, 411.70, only report the first two of those formats on the 750M I tested (the same MacBookPro I tested the Mac version on). It should be noted, that on Windows and Linux, Vulkan will initialise with other formats, where as on Mac it will crash with a...
*** Terminating app due to uncaught exception 'CAMetalLayerInvalid', reason: 'invalid pixel format 70'
The only other quirk I encountered was the order of operations. As the shader takes a single float in a uniform buffer, the exact location of the vkCmdCopyBuffer() call to update the uniform buffer caused the drawing to stop right after the clear command was issued, so I was left with a ClearColor coloured window, even though everything was reporting success. That was without the full Command Queue debugging options enabled, so I suspect that will complain if you have it enabled.
If you want to play with shaders on Vulkan, on either of the three platforms, the repository is here.
No comments:
Post a Comment