VideoCommon: Don't create pipelines with no render targets

Some backends don't like it when you do that
This commit is contained in:
TellowKrinkle 2023-01-29 14:35:23 -06:00
parent d380d43209
commit 1119a9ba32
2 changed files with 10 additions and 0 deletions

View File

@ -709,6 +709,9 @@ bool PostProcessing::CompilePixelShader()
bool PostProcessing::CompilePipeline()
{
if (m_framebuffer_format == AbstractTextureFormat::Undefined)
return true; // Not needed (some backends don't like making pipelines with no targets)
AbstractPipelineConfig config = {};
config.vertex_shader = m_vertex_shader.get();
config.geometry_shader =

View File

@ -1068,6 +1068,13 @@ bool Renderer::InitializeImGui()
bool Renderer::RecompileImGuiPipeline()
{
if (m_backbuffer_format == AbstractTextureFormat::Undefined)
{
// No backbuffer (nogui) means no imgui rendering will happen
// Some backends don't like making pipelines with no render targets
return true;
}
std::unique_ptr<AbstractShader> vertex_shader =
CreateShaderFromSource(ShaderStage::Vertex, FramebufferShaderGen::GenerateImGuiVertexShader(),
"ImGui vertex shader");