mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 23:49:19 +02:00
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.
This commit is contained in:
@@ -95,9 +95,18 @@ option(ENABLE_AVX2 "Enable AVX2 instruction set (requires AVX2-capable CPU, Hasw
|
||||
option(ADD_VERSION_SUFFIX "Add date and commit hash to the executable name" ON)
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# vcpkg init
|
||||
# vcpkg init. The triplet has to follow the host, or a non-Windows build looks
|
||||
# for its packages (DXC, used by the betterRenderer shader compiler) in a
|
||||
# directory that only ever exists on Windows.
|
||||
set(VCPKG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/ref/vcpkg")
|
||||
set(VCPKG_INSTALLED_PATH "${VCPKG_ROOT}/installed/x64-windows")
|
||||
if (WIN32)
|
||||
set(VCPKG_TRIPLET "x64-windows")
|
||||
elseif (APPLE)
|
||||
set(VCPKG_TRIPLET "x64-osx")
|
||||
else()
|
||||
set(VCPKG_TRIPLET "x64-linux")
|
||||
endif()
|
||||
set(VCPKG_INSTALLED_PATH "${VCPKG_ROOT}/installed/${VCPKG_TRIPLET}")
|
||||
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_INSTALLED_PATH}")
|
||||
list(APPEND CMAKE_MODULE_PATH "${VCPKG_INSTALLED_PATH}/share")
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
// OpenGL includes required by EU07 includes
|
||||
#include <glad/glad.h> // for GLuint, GLint
|
||||
#include <GLFW/glfw3.h> // for GLFWwindow
|
||||
#include "utilities/Globals_macros.h"
|
||||
|
||||
// Div. includes required by EU07 includes
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
|
||||
#include <nvrhi/nvrhi.h>
|
||||
#include <yaml-cpp/yaml.h>
|
||||
@@ -21,15 +21,23 @@
|
||||
#include <future>
|
||||
#include <mutex>
|
||||
|
||||
// EU07 includes
|
||||
// EU07 includes. This header is consumed by translation units that include
|
||||
// nothing else, so everything it names has to be imported here rather than
|
||||
// relied on to arrive from the including file.
|
||||
import eu07.utilities.classes;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.simcore;
|
||||
import eu07.rendering.geometrybank;
|
||||
import eu07.global_include.interfaces.imaterial;
|
||||
import eu07.global_include.interfaces.itexture;
|
||||
import eu07.gl.shader;
|
||||
|
||||
#include "nvrenderer_enums.h"
|
||||
#include "quadtree.h"
|
||||
import eu07.rendering.renderer;
|
||||
#include "resource_registry.h"
|
||||
import eu07.environment.sky;
|
||||
import eu07.glm;
|
||||
|
||||
namespace Rt {
|
||||
struct IRtModel;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtx/component_wise.hpp>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
import eu07.glm;
|
||||
#include <cstdint>
|
||||
|
||||
struct QuadTreeLeave {
|
||||
QuadTreeLeave(const glm::dvec3& origin, const glm::dvec3& extent,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <nvrhi/nvrhi.h>
|
||||
|
||||
#include <entt/entt.hpp>
|
||||
#include <glm/glm.hpp>
|
||||
import eu07.glm;
|
||||
|
||||
class NvTextureManager;
|
||||
class MaResourceRegistry;
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <cmath>
|
||||
#include "imgui/imgui.h"
|
||||
import eu07.glm;
|
||||
|
||||
namespace XeGTAO
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <nvrhi/utils.h>
|
||||
|
||||
#include "nvrendererbackend.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
void Bloom::UpdateConstants(nvrhi::ICommandList* command_list) {
|
||||
BloomConstants constants{};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <nvrhi/nvrhi.h>
|
||||
import eu07.glm;
|
||||
|
||||
struct Bloom {
|
||||
struct BloomConstants {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <nvrhi/nvrhi.h>
|
||||
#include <glm/glm.hpp>
|
||||
import eu07.glm;
|
||||
|
||||
struct MaContactShadows {
|
||||
MaContactShadows(class NvRenderer* renderer, class NvGbuffer* gbuffer);
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
import eu07.utilities.globals;
|
||||
#include "gbuffer.h"
|
||||
#include "gbufferblitpass.h"
|
||||
import eu07.glm;
|
||||
#include <queue>
|
||||
|
||||
NvFSR::NvFSR(NvRenderer* renderer)
|
||||
: m_backend(renderer->m_backend.get()),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <ffx-fsr2-api/ffx_fsr2.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "nvrendererbackend.h"
|
||||
import eu07.glm;
|
||||
|
||||
struct NvFSR {
|
||||
NvFSR(class NvRenderer* renderer);
|
||||
|
||||
@@ -11,6 +11,7 @@ import eu07.utilities.timer;
|
||||
#include "nvrendererbackend.h"
|
||||
#include "sky.h"
|
||||
#include "ssao.h"
|
||||
import eu07.glm;
|
||||
|
||||
GbufferBlitPass::GbufferBlitPass(NvRenderer* renderer, NvGbuffer* gbuffer,
|
||||
NvGbuffer* gbuffer_shadow, NvSsao* ssao,
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
#include <nvrhi/utils.h>
|
||||
|
||||
#include <glm/gtc/packing.hpp>
|
||||
|
||||
#include "gbuffer.h"
|
||||
#include "nvrendererbackend.h"
|
||||
#include "ssao.h"
|
||||
#include "config.h"
|
||||
import eu07.glm;
|
||||
|
||||
void GbufferLighting::Init() {
|
||||
auto fb_info = m_renderer->m_gbuffer->m_framebuffer->getFramebufferInfo();
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <nvrenderer/nvrenderer.h>
|
||||
#include <nvrhi/nvrhi.h>
|
||||
import eu07.glm;
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
struct GbufferLighting : public MaResourceRegistry {
|
||||
GbufferLighting(NvRenderer* renderer)
|
||||
|
||||
@@ -7,11 +7,12 @@ import eu07.utilities.globals;
|
||||
import eu07.utilities.logs;
|
||||
#include <fmt/format.h>
|
||||
import eu07.model.material;
|
||||
#include <parser.h>
|
||||
import eu07.utilities.parser;
|
||||
#include "utilities/utilities_macros.h"
|
||||
import eu07.utilities.utilities;
|
||||
#include <yaml-cpp/yaml.h>
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
std::string_view MaterialAdapter::GetTexturePathForEntry(
|
||||
std::string_view key) const {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <string>
|
||||
import eu07.glm;
|
||||
|
||||
struct MaterialAdapterInternal {
|
||||
virtual ~MaterialAdapterInternal() = default;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <glm/glm.hpp>
|
||||
import eu07.glm;
|
||||
#include <cassert>
|
||||
|
||||
struct MotionCacheId {
|
||||
union {
|
||||
|
||||
@@ -8,7 +8,6 @@ import eu07.application.application;
|
||||
import eu07.simulation.simulation;
|
||||
|
||||
#include <future>
|
||||
#include <glm/gtx/transform.hpp>
|
||||
|
||||
#include "auto_exposure.h"
|
||||
#include "bloom.h"
|
||||
@@ -39,6 +38,9 @@ import eu07.simulation.simulation;
|
||||
#include "rt_model.h"
|
||||
#include "tinyexr.h"
|
||||
#include "windshield_rain.h"
|
||||
import eu07.glm;
|
||||
#include "utilities/utilities_macros.h"
|
||||
import eu07.utilities.utilities;
|
||||
|
||||
bool NvRenderer::Init(GLFWwindow *Window) {
|
||||
m_message_callback = std::make_shared<NvRendererMessageCallback>();
|
||||
|
||||
@@ -16,6 +16,7 @@ import eu07.utilities.logs;
|
||||
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
|
||||
|
||||
#include "nvrendererbackend.h"
|
||||
#include <queue>
|
||||
|
||||
#define MA_ERROR_LOG(fmt_str, ...) ErrorLog(fmt::format(fmt_str, __VA_ARGS__))
|
||||
#define MA_INFO_LOG(fmt_str, ...) WriteLog(fmt::format(fmt_str, __VA_ARGS__))
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <nvrhi/vulkan.h>
|
||||
|
||||
#include <vulkan/vulkan.hpp>
|
||||
#include <queue>
|
||||
|
||||
class NvRendererBackend_Vulkan : public NvRendererBackend {
|
||||
friend class NvRenderer;
|
||||
|
||||
@@ -16,6 +16,7 @@ import eu07.utilities.logs;
|
||||
#include "stbi/stb_image.h"
|
||||
#define STB_IMAGE_RESIZE2_IMPLEMENTATION
|
||||
#include "stbi/stb_image_resize2.h"
|
||||
import eu07.model.texture;
|
||||
#undef STB_IMAGE_RESIZE2_IMPLEMENTATION
|
||||
|
||||
uint64_t NvTexture::s_change_counter = 0;
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#include <unordered_map>
|
||||
#include <nvrhi/nvrhi.h>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
import eu07.global_include.interfaces.itexture;
|
||||
#include "nvrenderer/nvrenderer_enums.h"
|
||||
import eu07.glm;
|
||||
|
||||
enum MaTextureTraits {
|
||||
MaTextureTraits_Sharpen,
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/vec3.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include "nvrenderer/nvrenderer.h"
|
||||
|
||||
class TSubModel;
|
||||
class TModel3d;
|
||||
// TSubModel/TModel3d are owned by the simulation core; a forward
|
||||
// declaration here would be a second, conflicting declaration.
|
||||
import eu07.simcore;
|
||||
import eu07.glm;
|
||||
|
||||
namespace Rt {
|
||||
struct IRtModel {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include "nvrenderer_vulkan.h"
|
||||
#include <queue>
|
||||
|
||||
#if LIBMANUL_WITH_VULKAN
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "nvrendererbackend.h"
|
||||
import eu07.simulation.simulationenvironment;
|
||||
import eu07.simulation.simulationtime;
|
||||
#include "imgui/imgui.h"
|
||||
import eu07.glm;
|
||||
|
||||
namespace {
|
||||
static const float PI = 3.14159265358979323846f;
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
#include <nvrhi/nvrhi.h>
|
||||
#include <nvrhi/utils.h>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "XeGTAO.h"
|
||||
#include "gbuffer.h"
|
||||
#include "nvrenderer/nvrenderer.h"
|
||||
#include "nvrendererbackend.h"
|
||||
#include "imgui/imgui.h"
|
||||
import eu07.glm;
|
||||
|
||||
NvSsao::NvSsao(NvRenderer* renderer)
|
||||
: m_backend(renderer->m_backend.get()),
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include <nvrhi/nvrhi.h>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include "XeGTAO.h"
|
||||
import eu07.glm;
|
||||
|
||||
struct NvSsao {
|
||||
NvSsao(class NvRenderer* renderer);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Model3d.h>
|
||||
import eu07.simcore;
|
||||
|
||||
struct MaTopologyUtils {
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
import eu07.utilities.timer;
|
||||
import eu07.simcore;
|
||||
import eu07.simulation.simulation;
|
||||
import eu07.glm;
|
||||
#include "utilities/utilities_macros.h"
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.utilities.float3d;
|
||||
|
||||
namespace BatchingUtils {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user