Skip to content
Permalink
Browse files
Merge pull request #11511 from TellowKrinkle/MTLHD4000
VideoCommon: Avoid creating pipelines with no render targets
  • Loading branch information
phire committed Jan 30, 2023
2 parents 5a8b865 + e4e425b commit 13d1428
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
@@ -418,6 +418,12 @@ StoredPipeline CreatePipeline(const AbstractPipelineConfig& config)
// clang-format on
}
FramebufferState fs = config.framebuffer_state;
if (fs.color_texture_format == AbstractTextureFormat::Undefined &&
fs.depth_texture_format == AbstractTextureFormat::Undefined)
{
// Intel HD 4000's Metal driver asserts if you try to make one of these
PanicAlertFmt("Attempted to create pipeline with no render targets!");
}
[desc setRasterSampleCount:fs.samples];
[color0 setPixelFormat:Util::FromAbstract(fs.color_texture_format)];
[desc setDepthAttachmentPixelFormat:Util::FromAbstract(fs.depth_texture_format)];
@@ -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 =
@@ -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");

0 comments on commit 13d1428

Please sign in to comment.