diff --git a/engine/core/include/file.hpp b/engine/core/include/file.hpp index e54c051..251486e 100755 --- a/engine/core/include/file.hpp +++ b/engine/core/include/file.hpp @@ -8,6 +8,7 @@ #include #include "log.hpp" +#include "file_utils.hpp" namespace file { enum class Domain { @@ -103,8 +104,6 @@ namespace file { std::vector data; }; - using Path = std::filesystem::path; - /** Sets the domain path to a location in the filesystem. @param domain The domain type. @param mode The access mode. @@ -134,11 +133,5 @@ namespace file { inline Path internal_domain = "/internal", app_domain = "/app"; } -namespace console { - inline void internal_format(std::string& msg, const file::Path& arg) { - auto pos = msg.find_first_of("{}"); - msg.replace(pos, 2, arg.string()); - } -} inline std::array domain_data; diff --git a/engine/gfx/public/gfx.hpp b/engine/gfx/public/gfx.hpp index bc17e8f..07da6fc 100755 --- a/engine/gfx/public/gfx.hpp +++ b/engine/gfx/public/gfx.hpp @@ -279,7 +279,7 @@ public: // check for runtime support virtual bool is_supported() { return false; } virtual GFXContext required_context() { return GFXContext::None; } - virtual ShaderLanguage accepted_shader_language() {} + virtual ShaderLanguage accepted_shader_language() { return ShaderLanguage::GLSL; } virtual const char* get_name() { return nullptr; } virtual bool supports_feature([[maybe_unused]] const GFXFeature feature) { return true; } diff --git a/engine/gfx/vulkan/include/gfx_vulkan.hpp b/engine/gfx/vulkan/include/gfx_vulkan.hpp index 7534a3b..86ed029 100755 --- a/engine/gfx/vulkan/include/gfx_vulkan.hpp +++ b/engine/gfx/vulkan/include/gfx_vulkan.hpp @@ -20,7 +20,9 @@ class GFXVulkanPipeline; class GFXVulkan : public GFX { public: bool is_supported() { return true; } - GFXContext required_context() { return GFXContext::Vulkan; }const char* get_name() override; + ShaderLanguage accepted_shader_language() override { return ShaderLanguage::SPIRV; } + GFXContext required_context() { return GFXContext::Vulkan; } + const char* get_name() override; bool initialize(const GFXCreateInfo& info) override; diff --git a/engine/gfx/vulkan/src/gfx_vulkan.cpp b/engine/gfx/vulkan/src/gfx_vulkan.cpp index d0bd4ab..ec24176 100755 --- a/engine/gfx/vulkan/src/gfx_vulkan.cpp +++ b/engine/gfx/vulkan/src/gfx_vulkan.cpp @@ -547,7 +547,7 @@ GFXPipeline* GFXVulkan::create_graphics_pipeline(const GFXGraphicsPipelineCreate const bool fragment_use_shader_source = info.shaders.fragment_path.empty(); if (vertex_use_shader_source) { - auto& vertex_shader_vector = std::get>(info.shaders.vertex_src); + auto& vertex_shader_vector = info.shaders.vertex_src.as_bytecode(); vertex_module = createShaderModule(vertex_shader_vector.data(), vertex_shader_vector.size() * sizeof(uint32_t)); } @@ -559,7 +559,7 @@ GFXPipeline* GFXVulkan::create_graphics_pipeline(const GFXGraphicsPipelineCreate } if (fragment_use_shader_source) { - auto& fragment_shader_vector = std::get>(info.shaders.fragment_src); + auto& fragment_shader_vector = info.shaders.fragment_src.as_bytecode(); fragment_module = createShaderModule(fragment_shader_vector.data(), fragment_shader_vector.size() * sizeof(uint32_t)); } diff --git a/engine/math/src/transform.cpp b/engine/math/src/transform.cpp index e783a53..2b939e5 100755 --- a/engine/math/src/transform.cpp +++ b/engine/math/src/transform.cpp @@ -1,6 +1,7 @@ #include "transform.hpp" #include +#include #include "math.hpp" diff --git a/engine/utility/CMakeLists.txt b/engine/utility/CMakeLists.txt index ffb09fe..ade6af2 100755 --- a/engine/utility/CMakeLists.txt +++ b/engine/utility/CMakeLists.txt @@ -7,6 +7,7 @@ set(SRC include/aabb.hpp include/path.hpp include/format.hpp + include/file_utils.hpp src/string_utils.cpp) diff --git a/engine/utility/include/file_utils.hpp b/engine/utility/include/file_utils.hpp new file mode 100644 index 0000000..d199933 --- /dev/null +++ b/engine/utility/include/file_utils.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +namespace file { + using Path = std::filesystem::path; +} + +namespace console { + inline void internal_format(std::string& msg, const file::Path& arg) { + auto pos = msg.find_first_of("{}"); + msg.replace(pos, 2, arg.string()); + } +} \ No newline at end of file diff --git a/tools/shadercompiler/main.cpp b/tools/shadercompiler/main.cpp index af0b45a..5f12026 100755 --- a/tools/shadercompiler/main.cpp +++ b/tools/shadercompiler/main.cpp @@ -1,9 +1,11 @@ #include #include +#include #include "shadercompiler.hpp" #include "log.hpp" #include "string_utils.hpp" +#include "file_utils.hpp" bool has_extension(const std::filesystem::path path, const std::string_view extension) { return string_contains(path.filename().string(), extension);