diff --git a/TGEngine/private/graphics/Vulkan/VulkanShaderModule.cpp b/TGEngine/private/graphics/Vulkan/VulkanShaderModule.cpp index 52e6279..936ea37 100644 --- a/TGEngine/private/graphics/Vulkan/VulkanShaderModule.cpp +++ b/TGEngine/private/graphics/Vulkan/VulkanShaderModule.cpp @@ -14,8 +14,15 @@ #undef ERROR #define SPR_NO_DEBUG_OUTPUT 1 #define SPR_NO_GLSL_INCLUDE 1 +#define SPR_NO_STATIC 1 +#define SPR_STATIC extern #include "../../../public/headerlibs/ShaderPermute.hpp" +namespace permute { +std::map lookupCounter; +permute::lookup glslLookup = {{"next", next}}; +} // namespace permute + namespace tge::shader { using namespace vk; diff --git a/TGEngine/public/Error.hpp b/TGEngine/public/Error.hpp index 753e7ba..2d55048 100644 --- a/TGEngine/public/Error.hpp +++ b/TGEngine/public/Error.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include diff --git a/TGEngine/public/headerlibs/ShaderPermute.hpp b/TGEngine/public/headerlibs/ShaderPermute.hpp index 8961df4..1ae45e6 100644 --- a/TGEngine/public/headerlibs/ShaderPermute.hpp +++ b/TGEngine/public/headerlibs/ShaderPermute.hpp @@ -265,7 +265,7 @@ struct GlslSettings { SPR_STATIC std::map lookupCounter; -SPR_STATIC std::string next(const std::string &input) { +inline std::string next(const std::string &input) { const auto id = lookupCounter[input]; lookupCounter[input]++; #ifdef SPR_USE_FORMAT_LIB @@ -285,7 +285,9 @@ SPR_STATIC std::string next(const std::string &input) { SPR_STATIC lookup glslLookup #ifndef SPR_NO_STATIC - = {{"next", next}} + = {{"next", next}}; +#else + ; #endif // SPR_STATIC ;