17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 14:29:20 +02:00
Files
maszyna/betterRenderer/renderer/source/shaders_vulkan.cpp
maj00r 7667d8d4d3 build betterRenderer against the modules
Verified locally now that Vulkan and DXC are installed: all 31 targets
compile. glm has to come from eu07.glm only - having it both as a plain
include and as an import made every overload ambiguous. nvrenderer.h is
self-sufficient, since register.cpp includes nothing else. Fixes the
vcpkg triplet, which was pinned to x64-windows.
2026-09-09 23:45:53 +02:00

33 lines
1.0 KiB
C++

#include <yaml-cpp/yaml.h>
#include "nvrenderer_vulkan.h"
#include <queue>
#if LIBMANUL_WITH_VULKAN
void NvRendererBackend_Vulkan::LoadShaderBlobs() {
auto root = YAML::LoadFile("shaders/shaders_spirv.manul");
for (const auto entry : root["materials"]) {
std::string_view material = entry.first.as<std::string_view>();
for (const auto shader : entry.second) {
auto binary = shader.second["binary"].as<YAML::Binary>();
auto entrypoint = shader.second["entrypoint"].as<std::string>();
AddMaterialShaderBlob(
material, shader.first.as<std::string_view>(),
std::string(binary.data(), binary.data() + binary.size()),
entrypoint);
}
}
for (const auto shader : root["utility"]) {
auto binary = shader.second["binary"].as<YAML::Binary>();
auto entrypoint = shader.second["entrypoint"].as<std::string>();
AddShaderBlob(shader.first.as<std::string_view>(),
std::string(binary.data(), binary.data() + binary.size()),
entrypoint);
}
}
#endif