metal: fix a crash when the window has no depth or stencil.

This commit is contained in:
Sasha Szpakowski
2024-09-28 18:23:09 -03:00
parent ef252b7d0f
commit a16db4fb72
+4 -1
View File
@@ -696,7 +696,10 @@ id<MTLRenderCommandEncoder> Graphics::useRenderEncoder()
auto &key = lastRenderPipelineKey;
key.colorRenderTargetFormats = isGammaCorrect() ? PIXELFORMAT_BGRA8_sRGB : PIXELFORMAT_BGRA8_UNORM;
key.depthStencilFormat = backbufferDepthStencil->getPixelFormat();
if (backbufferDepthStencil.get())
key.depthStencilFormat = backbufferDepthStencil->getPixelFormat();
else
key.depthStencilFormat = PIXELFORMAT_UNKNOWN;
key.msaa = backbufferMSAA ? (uint8) backbufferMSAA->getMSAA() : 1;
}