While debugging a test failure on MoltenVK I discovered that commit 66cb2815f0662713c3255113255cfd7cf5e406fb triggers a validation failure in `test_shader_input_output_components()`: ``` VUID-RuntimeSpirv-OpTypeVector-06816(ERROR / SPEC): msgNum: 79036675 - Validation Error: [ VUID-RuntimeSpirv-OpTypeVector-06816 ] Object 0: handle = 0x590000000059, type = VK_OBJECT_TYPE_SHADER_MODULE; Object 1: handle = 0x5a000000005a, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x4b60103 | vkCreateGraphicsPipelines(): pCreateInfos[0] starting at Location 2 Component 0 the Output (VK_SHADER_STAGE_VERTEX_BIT) has a Vec4 while Input (VK_SHADER_STAGE_FRAGMENT_BIT) as a Vec3. Enable VK_KHR_maintenance4 device extension to allow relaxed interface matching between input and output vectors. The Vulkan spec states: Any OpTypeVector output interface variables must not have a higher Component Count than a matching OpTypeVector input interface variable (https://www.khronos.org/registry/vulkan/specs/1.2/html/vkspec.html#VUID-Runt...) ```
The validation error seems to be related to the MoltenVK failure I'm debugging, but there must be something more because testing on the parent commit gets rid of the validation error, but not of the MoltenVK failure, which incidentally is: ``` [mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 3): Fragment input(s) `user(locn2_3)` mismatching vertex shader output type(s) or not written by vertex shader. d3d12:11826: Test 4: Test failed: Got {0.00000000e+00, 1.00000000e+00, 0.00000000e+00, 1.00000000e+00}, expected {0.00000000e+00, 1.00000000e+00, 0.00000000e+00, 2.50000000e-01} at (0, 0). ``` Even if the validation error is not the direct cause of the failure, it looks like something we'd want to fix anyway.
I intent to spend some more time on this, but if in the meantime somebody more expert of I/O interfaces wants to have a look, now you know!