diff --git a/src/ObjCompiling/Shader/D3DShaderCompiler.cpp b/src/ObjCompiling/Shader/D3DShaderCompiler.cpp index e4302833..657b3c29 100644 --- a/src/ObjCompiling/Shader/D3DShaderCompiler.cpp +++ b/src/ObjCompiling/Shader/D3DShaderCompiler.cpp @@ -122,18 +122,18 @@ namespace shader #endif } - result::Expected, std::string> CompileShader(const std::string& shaderFile, - const std::string& entryPoint, - const std::string& target, - const bool debug, - ISearchPath& searchPath, - MemoryManager& memory) + std::expected, std::string> CompileShader(const std::string& shaderFile, + const std::string& entryPoint, + const std::string& target, + const bool debug, + ISearchPath& searchPath, + MemoryManager& memory) { #ifdef _WIN32 if (!initialized) InitializeShaderCompilation(); if (!compilationAvailable) - return result::Unexpected("Shader compilation unavailable"); + return std::unexpected("Shader compilation unavailable"); const auto fileName = GetSourceFileNameForShaderAssetName(shaderFile); auto file = searchPath.Open(fileName); @@ -141,7 +141,7 @@ namespace shader return std::optional(std::nullopt); if (std::cmp_greater(file.m_length, MAX_SHADER_SIZE)) - return result::Unexpected(std::format("File too big: {}", file.m_length)); + return std::unexpected(std::format("File too big: {}", file.m_length)); const auto shaderSize = file.m_length; const auto shaderData = std::make_unique(static_cast(shaderSize)); @@ -185,7 +185,7 @@ namespace shader if (shaderBlob) shaderBlob->Release(); - return result::Unexpected(std::move(errorMessage)); + return std::unexpected(std::move(errorMessage)); } const auto shaderBlobSize = static_cast(shaderBlob->GetBufferSize()); @@ -199,7 +199,7 @@ namespace shader .m_shader_size = shaderBlobSize, }); #else - return result::Unexpected("Shader compilation unavailable"); + return std::unexpected("Shader compilation unavailable"); #endif } } // namespace shader diff --git a/src/ObjCompiling/Shader/D3DShaderCompiler.h b/src/ObjCompiling/Shader/D3DShaderCompiler.h index c281a80e..e79e313e 100644 --- a/src/ObjCompiling/Shader/D3DShaderCompiler.h +++ b/src/ObjCompiling/Shader/D3DShaderCompiler.h @@ -2,8 +2,8 @@ #include "SearchPath/ISearchPath.h" #include "Utils/MemoryManager.h" -#include "Utils/Result.h" +#include #include #include @@ -18,6 +18,6 @@ namespace shader bool ShaderCompilationAvailable(); - result::Expected, std::string> CompileShader( + std::expected, std::string> CompileShader( const std::string& shaderFile, const std::string& entryPoint, const std::string& target, bool debug, ISearchPath& searchPath, MemoryManager& memory); } // namespace shader