mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -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:
@ -113,10 +113,10 @@ std::unique_ptr<AbstractFramebuffer> Renderer::CreateFramebuffer(AbstractTexture
|
||||
}
|
||||
|
||||
std::unique_ptr<AbstractShader> Renderer::CreateShaderFromSource(ShaderStage stage,
|
||||
const char* source, size_t length)
|
||||
std::string_view source)
|
||||
{
|
||||
DXShader::BinaryData bytecode;
|
||||
if (!DXShader::CompileShader(D3D::feature_level, &bytecode, stage, source, length))
|
||||
if (!DXShader::CompileShader(D3D::feature_level, &bytecode, stage, source))
|
||||
return nullptr;
|
||||
|
||||
return DXShader::CreateFromBytecode(stage, std::move(bytecode));
|
||||
|
Reference in New Issue
Block a user