mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
D3DCommon/Shader: Use std::optional with CompileShader()
Allows removing the use of an out parameter, making it nicer to use.
This commit is contained in:
@ -26,11 +26,11 @@ std::unique_ptr<DXShader> DXShader::CreateFromBytecode(ShaderStage stage, Binary
|
||||
|
||||
std::unique_ptr<DXShader> DXShader::CreateFromSource(ShaderStage stage, std::string_view source)
|
||||
{
|
||||
BinaryData bytecode;
|
||||
if (!CompileShader(g_dx_context->GetFeatureLevel(), &bytecode, stage, source))
|
||||
auto bytecode = CompileShader(g_dx_context->GetFeatureLevel(), stage, source);
|
||||
if (!bytecode)
|
||||
return nullptr;
|
||||
|
||||
return CreateFromBytecode(stage, std::move(bytecode));
|
||||
return CreateFromBytecode(stage, std::move(*bytecode));
|
||||
}
|
||||
|
||||
D3D12_SHADER_BYTECODE DXShader::GetD3DByteCode() const
|
||||
|
Reference in New Issue
Block a user