mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-03 14:20:21 +01:00
Some renaming
This commit is contained in:
47
betterRenderer/mashadercompiler/src/shader_compiler.hpp
Normal file
47
betterRenderer/mashadercompiler/src/shader_compiler.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include <nvrhi/nvrhi.h>
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <WinAdapter.h>
|
||||
#else
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
#include <dxcapi.h>
|
||||
|
||||
template <typename T>
|
||||
using RefCountPtr = nvrhi::RefCountPtr<T>;
|
||||
|
||||
enum class MaterialRenderPass : int { Deferred, Forward, CubeMap, Count };
|
||||
|
||||
enum class ShaderPlatform { D3D12, Vulkan };
|
||||
|
||||
class MaShaderCompiler {
|
||||
public:
|
||||
int Run();
|
||||
std::filesystem::path m_project_path;
|
||||
std::filesystem::path m_output_path;
|
||||
|
||||
private:
|
||||
std::filesystem::path m_shader_path;
|
||||
bool m_generate_debug = false;
|
||||
void ParseOptions();
|
||||
void Init();
|
||||
YAML::Binary CompileShaderToBlob(
|
||||
std::filesystem::path file_name, std::wstring entry_name,
|
||||
std::vector<std::tuple<std::wstring, std::wstring>> defines,
|
||||
std::string target, ShaderPlatform platform);
|
||||
bool CompileUtilityShader(YAML::Node& dest, const YAML::Node& src,
|
||||
const YAML::Node& templates,
|
||||
ShaderPlatform platform);
|
||||
bool CompileMaterial(YAML::Node& dest, const YAML::Node& src,
|
||||
const YAML::Node& templates, ShaderPlatform platform);
|
||||
bool CompileProject(YAML::Node& dest, const YAML::Node& src,
|
||||
const YAML::Node& templates, ShaderPlatform platform);
|
||||
RefCountPtr<IDxcUtils> m_dxc_utils;
|
||||
RefCountPtr<IDxcCompiler3> m_dxc_compiler;
|
||||
RefCountPtr<IDxcIncludeHandler> m_dxc_include_handler;
|
||||
};
|
||||
Reference in New Issue
Block a user