WinRT: removed unneeded Direct3D stencil buffer code
authorDavid Ludwig
Sun, 25 Nov 2012 19:10:02 -0500
changeset 8370a7b682df854c
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
     1.1 --- a/src/video/windowsrt/SDL_winrtrenderer.cpp	Sun Nov 25 19:05:56 2012 -0500
     1.2 +++ b/src/video/windowsrt/SDL_winrtrenderer.cpp	Sun Nov 25 19:10:02 2012 -0500
     1.3 @@ -359,15 +359,6 @@
     1.4  			)
     1.5  		);
     1.6  
     1.7 -	CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
     1.8 -	DX::ThrowIfFailed(
     1.9 -		m_d3dDevice->CreateDepthStencilView(
    1.10 -			depthStencil.Get(),
    1.11 -			&depthStencilViewDesc,
    1.12 -			&m_depthStencilView
    1.13 -			)
    1.14 -		);
    1.15 -
    1.16  	// Set the rendering viewport to target the entire window.
    1.17  	CD3D11_VIEWPORT viewport(
    1.18  		0.0f,
    1.19 @@ -431,7 +422,6 @@
    1.20  		ID3D11RenderTargetView* nullViews[] = {nullptr};
    1.21  		m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
    1.22  		m_renderTargetView = nullptr;
    1.23 -		m_depthStencilView = nullptr;
    1.24  		m_d3dContext->Flush();
    1.25  		CreateWindowSizeDependentResources();
    1.26  	}
    1.27 @@ -445,13 +435,6 @@
    1.28  		blackColor
    1.29  		);
    1.30  
    1.31 -	m_d3dContext->ClearDepthStencilView(
    1.32 -		m_depthStencilView.Get(),
    1.33 -		D3D11_CLEAR_DEPTH,
    1.34 -		1.0f,
    1.35 -		0
    1.36 -		);
    1.37 -
    1.38  	// Only draw the cube once it is loaded (loading is asynchronous).
    1.39  	if (!m_loadingComplete)
    1.40  	{
    1.41 @@ -487,7 +470,7 @@
    1.42  	m_d3dContext->OMSetRenderTargets(
    1.43  		1,
    1.44  		m_renderTargetView.GetAddressOf(),
    1.45 -		m_depthStencilView.Get()
    1.46 +		nullptr
    1.47  		);
    1.48  
    1.49  	UINT stride = sizeof(VertexPositionColor);
    1.50 @@ -544,9 +527,6 @@
    1.51  	// overwritten. If dirty or scroll rects are used, this call should be removed.
    1.52  	m_d3dContext->DiscardView(m_renderTargetView.Get());
    1.53  
    1.54 -	// Discard the contents of the depth stencil.
    1.55 -	m_d3dContext->DiscardView(m_depthStencilView.Get());
    1.56 -
    1.57  	// If the device was removed either by a disconnect or a driver upgrade, we 
    1.58  	// must recreate all device resources.
    1.59  	if (hr == DXGI_ERROR_DEVICE_REMOVED)
     2.1 --- a/src/video/windowsrt/SDL_winrtrenderer.h	Sun Nov 25 19:05:56 2012 -0500
     2.2 +++ b/src/video/windowsrt/SDL_winrtrenderer.h	Sun Nov 25 19:10:02 2012 -0500
     2.3 @@ -34,7 +34,6 @@
     2.4  	Microsoft::WRL::ComPtr<ID3D11DeviceContext1> m_d3dContext;
     2.5  	Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain;
     2.6  	Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView;
     2.7 -	Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_depthStencilView;
     2.8  	Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout;
     2.9  	Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer;
    2.10  	Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader;