WinRT: removed unneeded Direct3D stencil buffer code
authorDavid Ludwig <dludwig@pobox.com>
Sun, 25 Nov 2012 19:10:02 -0500
changeset 8370 a7b682df854c
parent 8369 6dfc4ba22640
child 8371 0814a5de5b48
WinRT: removed unneeded Direct3D stencil buffer code
src/video/windowsrt/SDL_winrtrenderer.cpp
src/video/windowsrt/SDL_winrtrenderer.h
--- a/src/video/windowsrt/SDL_winrtrenderer.cpp	Sun Nov 25 19:05:56 2012 -0500
+++ b/src/video/windowsrt/SDL_winrtrenderer.cpp	Sun Nov 25 19:10:02 2012 -0500
@@ -359,15 +359,6 @@
 			)
 		);
 
-	CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
-	DX::ThrowIfFailed(
-		m_d3dDevice->CreateDepthStencilView(
-			depthStencil.Get(),
-			&depthStencilViewDesc,
-			&m_depthStencilView
-			)
-		);
-
 	// Set the rendering viewport to target the entire window.
 	CD3D11_VIEWPORT viewport(
 		0.0f,
@@ -431,7 +422,6 @@
 		ID3D11RenderTargetView* nullViews[] = {nullptr};
 		m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
 		m_renderTargetView = nullptr;
-		m_depthStencilView = nullptr;
 		m_d3dContext->Flush();
 		CreateWindowSizeDependentResources();
 	}
@@ -445,13 +435,6 @@
 		blackColor
 		);
 
-	m_d3dContext->ClearDepthStencilView(
-		m_depthStencilView.Get(),
-		D3D11_CLEAR_DEPTH,
-		1.0f,
-		0
-		);
-
 	// Only draw the cube once it is loaded (loading is asynchronous).
 	if (!m_loadingComplete)
 	{
@@ -487,7 +470,7 @@
 	m_d3dContext->OMSetRenderTargets(
 		1,
 		m_renderTargetView.GetAddressOf(),
-		m_depthStencilView.Get()
+		nullptr
 		);
 
 	UINT stride = sizeof(VertexPositionColor);
@@ -544,9 +527,6 @@
 	// overwritten. If dirty or scroll rects are used, this call should be removed.
 	m_d3dContext->DiscardView(m_renderTargetView.Get());
 
-	// Discard the contents of the depth stencil.
-	m_d3dContext->DiscardView(m_depthStencilView.Get());
-
 	// If the device was removed either by a disconnect or a driver upgrade, we 
 	// must recreate all device resources.
 	if (hr == DXGI_ERROR_DEVICE_REMOVED)
--- a/src/video/windowsrt/SDL_winrtrenderer.h	Sun Nov 25 19:05:56 2012 -0500
+++ b/src/video/windowsrt/SDL_winrtrenderer.h	Sun Nov 25 19:10:02 2012 -0500
@@ -34,7 +34,6 @@
 	Microsoft::WRL::ComPtr<ID3D11DeviceContext1> m_d3dContext;
 	Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain;
 	Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView;
-	Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_depthStencilView;
 	Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout;
 	Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer;
 	Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader;