Ver código fonte

fix using quad to clear framebuffer, but not correctly set scissor rect bug (#1913)

* fix devide by zero in texture viewer when construct orientation matrix

* fix using quad to clear framebuffer, but not set scissor rect, cause clear failed bug
Kitchen 6 anos atrás
pai
commit
462f803cb6
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8 0
      src/renderer_mtl.mm

+ 8 - 0
src/renderer_mtl.mm

@@ -3942,6 +3942,14 @@ namespace bgfx { namespace mtl
 						vp.zfar    = 1.0f;
 						rce.setViewport(vp);
 
+						MTLScissorRect sciRect = {
+							viewState.m_rect.m_x,
+							viewState.m_rect.m_y,
+							viewState.m_rect.m_width,
+							viewState.m_rect.m_height
+						};
+						rce.setScissorRect(sciRect);
+
 						if (BGFX_CLEAR_NONE != (clr.m_flags & BGFX_CLEAR_MASK)
 							&& !clearWithRenderPass)
 						{