17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-18 06:49:18 +02:00
Files
maszyna/betterRenderer/eu07_source/register.cpp
maj00r 02c6e6895e cover the units that are not module units
The template-header propagation only walked files with a module
declaration, so EU07.cpp, windows.cpp, export_e3d_standalone.cpp and
every betterRenderer source were outside it - including the file with
main(). They reach cParser and friends through eu07.simcore and
instantiate their templates without the headers those bodies name.

Adds audit_modules.py, which checks the whole tree for the seven classes
this migration hit; all seven are clean now.
2026-09-10 02:04:06 +02:00

45 lines
1.4 KiB
C++

#include <memory>
#include "nvrenderer/nvrenderer.h"
#include <array>
#include <chrono>
#include <cstddef>
#include <deque>
#include <limits>
#include <mutex>
#include <ostream>
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
import eu07.utilities.logs;
namespace {
std::unique_ptr<gfx_renderer> create_nvrenderer_for_d3d12() {
return std::make_unique<NvRenderer>(NvRenderer::Api::D3D12);
}
std::unique_ptr<gfx_renderer> create_nvrenderer_for_vulkan() {
return std::make_unique<NvRenderer>(NvRenderer::Api::Vulkan);
}
std::unique_ptr<gfx_renderer> create_nvrenderer_default() {
#if LIBMANUL_WITH_D3D12
return std::make_unique<NvRenderer>(NvRenderer::Api::D3D12);
#elif LIBMANUL_WITH_VULKAN
return std::make_unique<NvRenderer>(NvRenderer::Api::Vulkan);
#endif
ErrorLog("Failed to initialize any NVRHI Renderer");
return nullptr;
}
} // namespace
bool register_manul_d3d12 =
LIBMANUL_WITH_D3D12 &&
gfx_renderer_factory::get_instance()->register_backend(
"experimental_d3d12", &create_nvrenderer_for_d3d12);
bool register_manul_vulkan =
LIBMANUL_WITH_VULKAN &&
gfx_renderer_factory::get_instance()->register_backend(
"experimental_vk", &create_nvrenderer_for_vulkan);
bool register_manul = gfx_renderer_factory::get_instance()->register_backend(
"experimental", &create_nvrenderer_default);