From e1de423483017d9487823b1409b87e52d691b338 Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Thu, 27 Oct 2022 14:12:53 +0800 Subject: [PATCH] Treat all shaders as built in for now to facilitate getting shader module by name --- .../src/Assets/Libraries/Compilers/SHShaderSourceCompiler.cpp | 2 +- SHADE_Engine/src/Assets/SHAssetManager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SHADE_Engine/src/Assets/Libraries/Compilers/SHShaderSourceCompiler.cpp b/SHADE_Engine/src/Assets/Libraries/Compilers/SHShaderSourceCompiler.cpp index 242e25f4..329e34e9 100644 --- a/SHADE_Engine/src/Assets/Libraries/Compilers/SHShaderSourceCompiler.cpp +++ b/SHADE_Engine/src/Assets/Libraries/Compilers/SHShaderSourceCompiler.cpp @@ -23,7 +23,7 @@ namespace SHADE { std::string newPath{ path.string() }; newPath = newPath.substr(0, newPath.find_last_of('.')); - newPath += SHADER_EXTENSION.data(); + newPath += SHADER_BUILT_IN_EXTENSION.data(); std::ofstream file{ newPath, std::ios::binary | std::ios::out | std::ios::trunc }; diff --git a/SHADE_Engine/src/Assets/SHAssetManager.cpp b/SHADE_Engine/src/Assets/SHAssetManager.cpp index ca9e9ce1..f6760ec0 100644 --- a/SHADE_Engine/src/Assets/SHAssetManager.cpp +++ b/SHADE_Engine/src/Assets/SHAssetManager.cpp @@ -302,8 +302,8 @@ namespace SHADE if (ext == GLSL_EXTENSION.data()) { newAsset.path = SHShaderSourceCompiler::LoadAndCompileShader(path).value(); - newAsset.id = GenerateAssetID(AssetType::SHADER); - newAsset.type = AssetType::SHADER; + newAsset.id = GenerateAssetID(AssetType::SHADER_BUILT_IN); + newAsset.type = AssetType::SHADER_BUILT_IN; } else if (ext == DDS_EXTENSION.data()) {