Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

WinRT: removed unneeded Direct3D stencil buffer code

  • Loading branch information
DavidLudwig committed Nov 26, 2012
1 parent bd141d1 commit 9ac5c38b91f5db0325a1c3e7f467fc8ab366fe4e
Showing with 1 addition and 22 deletions.
  1. +1 −21 src/video/windowsrt/SDL_winrtrenderer.cpp
  2. +0 −1 src/video/windowsrt/SDL_winrtrenderer.h
@@ -359,15 +359,6 @@ void SDL_winrtrenderer::CreateWindowSizeDependentResources()
)
);

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 @@ void SDL_winrtrenderer::UpdateForWindowSizeChange()
ID3D11RenderTargetView* nullViews[] = {nullptr};
m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
m_renderTargetView = nullptr;
m_depthStencilView = nullptr;
m_d3dContext->Flush();
CreateWindowSizeDependentResources();
}
@@ -445,13 +435,6 @@ void SDL_winrtrenderer::Render(SDL_Surface * surface, SDL_Rect * rects, int numr
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 @@ void SDL_winrtrenderer::Render(SDL_Surface * surface, SDL_Rect * rects, int numr
m_d3dContext->OMSetRenderTargets(
1,
m_renderTargetView.GetAddressOf(),
m_depthStencilView.Get()
nullptr
);

UINT stride = sizeof(VertexPositionColor);
@@ -544,9 +527,6 @@ void SDL_winrtrenderer::Present()
// 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)
@@ -34,7 +34,6 @@ protected private:
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;

0 comments on commit 9ac5c38

Please sign in to comment.