You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This layer <em>is not</em> part of standard Vulkan driver installs, you must package the layer with the application for it to run on environments without Vulkan SDK / Vulkan Configurator. Read more <ahref="https://docs.vulkan.org/samples/latest/samples/extensions/shader_object/README.html#_emulation_layer">here</a>.
36
36
</div>
37
37
38
+
Since desired layers may not be available, we can set up a defensive check:
auto const available = vk::enumerateInstanceLayerProperties();
46
+
for (char const* layer : desired) {
47
+
auto const pred = [layer = std::string_view{layer}](
48
+
vk::LayerProperties const& properties) {
49
+
return properties.layerName == layer;
50
+
};
51
+
if (std::ranges::find_if(available, pred) == available.end()) {
52
+
std::println("[lvk][WARNING] Vulkan Layer '{}' not found", layer);
53
+
continue;
54
+
}
55
+
ret.push_back(layer);
56
+
}
57
+
return ret;
58
+
}
59
+
60
+
// ...
61
+
auto const layers = get_layers(layers_v);
62
+
instance_ci.setPEnabledLayerNames(layers);
63
+
```
64
+
38
65
## `class ShaderObject`
39
66
40
67
We will encapsulate both vertex and fragment shaders into a single `ShaderProgram`, which will also bind the shaders before a draw, and expose/set various dynamic states.
0 commit comments