Explorar o código

OVR: Fixed redundant clears.

Branimir Karadžić %!s(int64=9) %!d(string=hai) anos
pai
achega
daeab5c239
Modificáronse 2 ficheiros con 0 adicións e 17 borrados
  1. 0 14
      src/renderer_d3d11.cpp
  2. 0 3
      src/renderer_gl.cpp

+ 0 - 14
src/renderer_d3d11.cpp

@@ -3808,26 +3808,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 		if (NULL != m_msaaTexture[_eye])
 		{
 			deviceCtx->OMSetRenderTargets(1, &m_msaaRtv[_eye], m_depthBuffer[_eye]);
-			deviceCtx->ClearRenderTargetView(m_msaaRtv[_eye], black);
-			deviceCtx->ClearDepthStencilView(m_depthBuffer[_eye], D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1, 0);
 		}
 		else // MSAA disabled? render directly to eye buffer
 		{
 			int texIndex = 0;
 			ovr_GetTextureSwapChainCurrentIndex(m_session, m_textureSwapChain[_eye], &texIndex);
-
 			deviceCtx->OMSetRenderTargets(1, &m_eyeRtv[_eye][texIndex], m_depthBuffer[_eye]);
-			deviceCtx->ClearRenderTargetView(m_eyeRtv[_eye][texIndex], black);
-			deviceCtx->ClearDepthStencilView(m_depthBuffer[_eye], D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1, 0);
-
-			D3D11_VIEWPORT D3Dvp;
-			D3Dvp.TopLeftX = 0;
-			D3Dvp.TopLeftY = 0;
-			D3Dvp.Width = (FLOAT)_desc.m_eyeSize[_eye].m_w;
-			D3Dvp.Height = (FLOAT)_desc.m_eyeSize[_eye].m_h;
-			D3Dvp.MinDepth = 0;
-			D3Dvp.MaxDepth = 1;
-			deviceCtx->RSSetViewports(1, &D3Dvp);
 		}
 	}
 

+ 0 - 3
src/renderer_gl.cpp

@@ -3664,9 +3664,6 @@ namespace bgfx { namespace gl
 			GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_eyeFbo[_eye]) );
 			GL_CHECK(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_eyeTexId[_eye][texIndex], 0) );
 		}
-
-		GL_CHECK(glViewport(0, 0, _desc.m_eyeSize[_eye].m_w, _desc.m_eyeSize[_eye].m_h) );
-		GL_CHECK(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) );
 	}
 
 	bool VRImplOVRGL::submitSwapChain(const VRDesc& _desc)