mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
VideoCommon/RenderBase: Use a std::string_view with CreateShaderFromSource()
Greatly simplifies the overall interface when it comes to compiling shaders. Also allows getting rid of a std::string overload of the same name. Now std::string and const char* both go through the same function.
This commit is contained in:
@ -24,11 +24,10 @@ std::unique_ptr<DXShader> DXShader::CreateFromBytecode(ShaderStage stage, Binary
|
||||
return shader;
|
||||
}
|
||||
|
||||
std::unique_ptr<DXShader> DXShader::CreateFromSource(ShaderStage stage, const char* source,
|
||||
size_t length)
|
||||
std::unique_ptr<DXShader> DXShader::CreateFromSource(ShaderStage stage, std::string_view source)
|
||||
{
|
||||
BinaryData bytecode;
|
||||
if (!CompileShader(g_dx_context->GetFeatureLevel(), &bytecode, stage, source, length))
|
||||
if (!CompileShader(g_dx_context->GetFeatureLevel(), &bytecode, stage, source))
|
||||
return nullptr;
|
||||
|
||||
return CreateFromBytecode(stage, std::move(bytecode));
|
||||
|
Reference in New Issue
Block a user