Put compiled shaders into version subdirectory

This commit is contained in:
Lwmte 2024-12-30 17:57:34 +01:00
parent 9df0004e6b
commit 2b69daeb5e

View file

@ -5,7 +5,9 @@
#include "Renderer/Structures/RendererShader.h"
#include "Specific/configuration.h"
#include "Specific/trutils.h"
#include "version.h"
using namespace TEN::Utils;
using namespace TEN::Renderer::Structures;
namespace TEN::Renderer::Utils
@ -167,8 +169,8 @@ namespace TEN::Renderer::Utils
// Define paths for native (uncompiled) shaders and compiled shaders.
auto shaderPath = GetAssetPath(L"Shaders\\");
auto compiledShaderPath = shaderPath + L"Bin\\";
auto wideFileName = TEN::Utils::ToWString(fileName);
auto compiledShaderPath = shaderPath + L"Bin\\" + ToWString(TEN_VERSION_STRING) + L"\\";
auto wideFileName = ToWString(fileName);
// Ensure the /Bin subdirectory exists.
std::filesystem::create_directories(compiledShaderPath);
@ -189,7 +191,7 @@ namespace TEN::Renderer::Utils
srcFileNameWithExtension = srcFileName + L".fx";
if (!std::filesystem::exists(srcFileNameWithExtension))
{
TENLog("Shader source file not found: " + TEN::Utils::ToString(srcFileNameWithExtension), LogLevel::Error);
TENLog("Shader source file not found: " + ToString(srcFileNameWithExtension), LogLevel::Error);
throw std::runtime_error("Shader source file not found.");
}
}