Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
WinRT: removed unneeded Direct3D stencil buffer code
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Nov 26, 2012
1 parent bd141d1 commit 9ac5c38
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
22 changes: 1 addition & 21 deletions src/video/windowsrt/SDL_winrtrenderer.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
}
Expand All @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/video/windowsrt/SDL_winrtrenderer.h
Expand Up @@ -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;
Expand Down

0 comments on commit 9ac5c38

Please sign in to comment.