Skip to content

Commit

Permalink
Code review for const auto vs auto const
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Feb 4, 2025
1 parent 5ec3483 commit daae732
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion d3d11game_uwp_cppwinrt_dr/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Game::Clear()
context->OMSetRenderTargets(1, &renderTarget, depthStencil);

// Set the viewport.
auto const viewport = m_deviceResources->GetScreenViewport();
const auto viewport = m_deviceResources->GetScreenViewport();
context->RSSetViewports(1, &viewport);

PIXEndEvent(context);
Expand Down
2 changes: 1 addition & 1 deletion d3d11game_uwp_dr/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Game::Clear()
context->OMSetRenderTargets(1, &renderTarget, depthStencil);

// Set the viewport.
auto const viewport = m_deviceResources->GetScreenViewport();
const auto viewport = m_deviceResources->GetScreenViewport();
context->RSSetViewports(1, &viewport);

PIXEndEvent(context);
Expand Down
4 changes: 2 additions & 2 deletions d3d11game_win32_dr/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void Game::Clear()
context->OMSetRenderTargets(1, &renderTarget, depthStencil);

// Set the viewport.
auto const viewport = m_deviceResources->GetScreenViewport();
const auto viewport = m_deviceResources->GetScreenViewport();
context->RSSetViewports(1, &viewport);

m_deviceResources->PIXEndEvent();
Expand Down Expand Up @@ -133,7 +133,7 @@ void Game::OnResuming()

void Game::OnWindowMoved()
{
auto const r = m_deviceResources->GetOutputSize();
const auto r = m_deviceResources->GetOutputSize();
m_deviceResources->WindowSizeChanged(r.right, r.bottom);
}

Expand Down
8 changes: 4 additions & 4 deletions d3d12game_uwp_cppwinrt_dr/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ void Game::Clear()
PIXBeginEvent(commandList, PIX_COLOR_DEFAULT, L"Clear");

// Clear the views.
auto const rtvDescriptor = m_deviceResources->GetRenderTargetView();
auto const dsvDescriptor = m_deviceResources->GetDepthStencilView();
const auto rtvDescriptor = m_deviceResources->GetRenderTargetView();
const auto dsvDescriptor = m_deviceResources->GetDepthStencilView();

commandList->OMSetRenderTargets(1, &rtvDescriptor, FALSE, &dsvDescriptor);
commandList->ClearRenderTargetView(rtvDescriptor, Colors::CornflowerBlue, 0, nullptr);
commandList->ClearDepthStencilView(dsvDescriptor, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, nullptr);

// Set the viewport and scissor rect.
auto const viewport = m_deviceResources->GetScreenViewport();
auto const scissorRect = m_deviceResources->GetScissorRect();
const auto viewport = m_deviceResources->GetScreenViewport();
const auto scissorRect = m_deviceResources->GetScissorRect();
commandList->RSSetViewports(1, &viewport);
commandList->RSSetScissorRects(1, &scissorRect);

Expand Down
8 changes: 4 additions & 4 deletions d3d12game_uwp_dr/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ void Game::Clear()
PIXBeginEvent(commandList, PIX_COLOR_DEFAULT, L"Clear");

// Clear the views.
auto const rtvDescriptor = m_deviceResources->GetRenderTargetView();
auto const dsvDescriptor = m_deviceResources->GetDepthStencilView();
const auto rtvDescriptor = m_deviceResources->GetRenderTargetView();
const auto dsvDescriptor = m_deviceResources->GetDepthStencilView();

commandList->OMSetRenderTargets(1, &rtvDescriptor, FALSE, &dsvDescriptor);
commandList->ClearRenderTargetView(rtvDescriptor, Colors::CornflowerBlue, 0, nullptr);
commandList->ClearDepthStencilView(dsvDescriptor, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, nullptr);

// Set the viewport and scissor rect.
auto const viewport = m_deviceResources->GetScreenViewport();
auto const scissorRect = m_deviceResources->GetScissorRect();
const auto viewport = m_deviceResources->GetScreenViewport();
const auto scissorRect = m_deviceResources->GetScissorRect();
commandList->RSSetViewports(1, &viewport);
commandList->RSSetScissorRects(1, &scissorRect);

Expand Down
10 changes: 5 additions & 5 deletions d3d12game_win32_dr/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ void Game::Clear()
PIXBeginEvent(commandList, PIX_COLOR_DEFAULT, L"Clear");

// Clear the views.
auto const rtvDescriptor = m_deviceResources->GetRenderTargetView();
auto const dsvDescriptor = m_deviceResources->GetDepthStencilView();
const auto rtvDescriptor = m_deviceResources->GetRenderTargetView();
const auto dsvDescriptor = m_deviceResources->GetDepthStencilView();

commandList->OMSetRenderTargets(1, &rtvDescriptor, FALSE, &dsvDescriptor);
commandList->ClearRenderTargetView(rtvDescriptor, Colors::CornflowerBlue, 0, nullptr);
commandList->ClearDepthStencilView(dsvDescriptor, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, nullptr);

// Set the viewport and scissor rect.
auto const viewport = m_deviceResources->GetScreenViewport();
auto const scissorRect = m_deviceResources->GetScissorRect();
const auto viewport = m_deviceResources->GetScreenViewport();
const auto scissorRect = m_deviceResources->GetScissorRect();
commandList->RSSetViewports(1, &viewport);
commandList->RSSetScissorRects(1, &scissorRect);

Expand Down Expand Up @@ -155,7 +155,7 @@ void Game::OnResuming()

void Game::OnWindowMoved()
{
auto const r = m_deviceResources->GetOutputSize();
const auto r = m_deviceResources->GetOutputSize();
m_deviceResources->WindowSizeChanged(r.right, r.bottom);
}

Expand Down

0 comments on commit daae732

Please sign in to comment.