From 516e5fbe0ee83641c5c81cdb8c0026603f857ec0 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 11 Sep 2016 19:34:45 -1000 Subject: [PATCH] Also restore Metal scissor rect --- lib/graphicsdev/Metal.mm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/graphicsdev/Metal.mm b/lib/graphicsdev/Metal.mm index fc36456..6409945 100644 --- a/lib/graphicsdev/Metal.mm +++ b/lib/graphicsdev/Metal.mm @@ -719,9 +719,15 @@ struct MetalCommandQueue : IGraphicsCommandQueue m_enc = [m_cmdBuf renderCommandEncoderWithDescriptor:ctarget->m_passDesc]; [m_enc setFrontFacingWinding:MTLWindingCounterClockwise]; } - if (ctarget == m_boundTarget && (m_boundVp.width || m_boundVp.height)) - [m_enc setViewport:m_boundVp]; - m_boundTarget = ctarget; + if (ctarget == m_boundTarget) + { + if (m_boundVp.width || m_boundVp.height) + [m_enc setViewport:m_boundVp]; + if (m_boundScissor.width || m_boundScissor.height) + [m_enc setScissorRect:m_boundScissor]; + } + else + m_boundTarget = ctarget; } void setRenderTarget(ITextureR* target)