D3D11: Resolve variable shadowing within setScissor()

We can simply remove the outer-most variable, since it's not used
anywhere.
This commit is contained in:
Lioncash 2019-08-24 18:39:48 -04:00
parent 4521acd30f
commit f5afb028de

View File

@ -1073,23 +1073,22 @@ struct D3D11CommandQueue final : IGraphicsCommandQueue {
void setScissor(const SWindowRect& rect) override { void setScissor(const SWindowRect& rect) override {
if (m_boundTarget) { if (m_boundTarget) {
D3D11TextureR* ctarget = m_boundTarget.cast<D3D11TextureR>();
int boundHeight = 0; int boundHeight = 0;
switch (m_boundTarget->type()) { switch (m_boundTarget->type()) {
case TextureType::Render: { case TextureType::Render: {
D3D11TextureR* ctarget = m_boundTarget.cast<D3D11TextureR>(); const auto* const ctarget = m_boundTarget.cast<D3D11TextureR>();
boundHeight = ctarget->m_height; boundHeight = ctarget->m_height;
break; break;
} }
case TextureType::CubeRender: { case TextureType::CubeRender: {
D3D11TextureCubeR* ctarget = m_boundTarget.cast<D3D11TextureCubeR>(); const auto* const ctarget = m_boundTarget.cast<D3D11TextureCubeR>();
boundHeight = ctarget->m_width; boundHeight = ctarget->m_width;
break; break;
} }
default: default:
break; break;
} }
D3D11_RECT d3drect = {LONG(rect.location[0]), LONG(boundHeight - rect.location[1] - rect.size[1]), const D3D11_RECT d3drect = {LONG(rect.location[0]), LONG(boundHeight - rect.location[1] - rect.size[1]),
LONG(rect.location[0] + rect.size[0]), LONG(boundHeight - rect.location[1])}; LONG(rect.location[0] + rect.size[0]), LONG(boundHeight - rect.location[1])};
m_deferredCtx->RSSetScissorRects(1, &d3drect); m_deferredCtx->RSSetScissorRects(1, &d3drect);
} }