From 0e61471c5e0706572b52fb38d0af5ad7727d5c99 Mon Sep 17 00:00:00 2001 From: Samuliak Date: Tue, 27 Aug 2024 16:01:50 +0200 Subject: [PATCH] skip draws when pipeline is invalid --- src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp index e5a6a9f6..008cac99 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp @@ -1114,6 +1114,14 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32 renderPipelineState = m_pipelineCache->GetMeshPipelineState(fetchShader, vertexShader, geometryShader, pixelShader, m_state.m_lastUsedFBO, LatteGPUState.contextNew, hostIndexType); else renderPipelineState = m_pipelineCache->GetRenderPipelineState(fetchShader, vertexShader, pixelShader, m_state.m_lastUsedFBO, LatteGPUState.contextNew); + + // HACK + if (!renderPipelineState) + { + debug_printf("invalid render pipeline state, skipping draw\n"); + return; + } + if (renderPipelineState != encoderState.m_renderPipelineState) { renderCommandEncoder->setRenderPipelineState(renderPipelineState);