KhronosGroup / MoltenVK

MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
Apache License 2.0
4.63k stars 402 forks source link

Shader objects, strange error with vertex input bindings #2251

Open fknfilewalker opened 3 weeks ago

fknfilewalker commented 3 weeks ago

When I use a Shader Object with a shader having the following inputs:

layout(location = 0) in vec2 aPos;
layout(location = 1) in vec2 aUV;
layout(location = 2) in vec4 aColor;

I get the following error when creating the Shader Object.

[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute aPos(0) is missing from the vertex descriptor.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute aPos(0) is missing from the vertex descriptor.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute aPos(0) is missing from the vertex descriptor.

yes 3 times.

Code can be found in the following file. https://github.com/fknfilewalker/evk/blob/main/src/imgui_backend.cpp Target "imgui_rasterizer_triangle", though it requires a new llvm version e.g., from homebrew

cdavis5e commented 3 weeks ago

Based on this line, you appear to be using VK_EXT_vertex_input_dynamic_state, which we don't support. This extension is distinct from the VK_EXT_extended_dynamic_state extensions that we do support.

fknfilewalker commented 3 weeks ago

How do you set this for a shader object then?