Explorar el Código

Fix toggling MSAA on Metal. (#3137)

* Fix toggling MSAA on Metal.

m_backBufferColorMsaa was set when sampleCount > 1, but was never reset when
sampleCount became 1 again.

Many other bits of code in the Metal renderer decide what to do by checking
m_backBufferColorMsaa, so these would all do the wrong thing if you toggled
MSAA on and them back off.

* Cleanup
Robin Allen hace 2 años
padre
commit
a50db8f8fd
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. 6 5
      src/renderer_mtl.mm

+ 6 - 5
src/renderer_mtl.mm

@@ -3400,13 +3400,14 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa
 			m_backBufferStencil = s_renderMtl->m_device.newTextureWithDescriptor(desc);
 		}
 
-		if (sampleCount > 1)
+		if (NULL != m_backBufferColorMsaa)
 		{
-			if (NULL != m_backBufferColorMsaa)
-			{
-				release(m_backBufferColorMsaa);
-			}
+			release(m_backBufferColorMsaa);
+			m_backBufferColorMsaa = NULL;
+		}
 
+		if (sampleCount > 1)
+		{
 			desc.pixelFormat = m_metalLayer.pixelFormat;
 			m_backBufferColorMsaa = s_renderMtl->m_device.newTextureWithDescriptor(desc);
 		}