D3D11: Invert conditional within setScissor()

Turns the condition into a guard clause, which allows unindenting all of
the code within the function by one level.
This commit is contained in:
Lioncash 2019-08-24 18:42:37 -04:00
parent f5afb028de
commit 532e58414c
1 changed files with 22 additions and 19 deletions

View File

@ -1072,7 +1072,10 @@ struct D3D11CommandQueue final : IGraphicsCommandQueue {
}
void setScissor(const SWindowRect& rect) override {
if (m_boundTarget) {
if (!m_boundTarget) {
return;
}
int boundHeight = 0;
switch (m_boundTarget->type()) {
case TextureType::Render: {
@ -1088,11 +1091,11 @@ struct D3D11CommandQueue final : IGraphicsCommandQueue {
default:
break;
}
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])};
m_deferredCtx->RSSetScissorRects(1, &d3drect);
}
}
std::unordered_map<D3D11TextureR*, std::pair<size_t, size_t>> m_texResizes;
void resizeRenderTexture(const boo::ObjToken<ITextureR>& tex, size_t width, size_t height) override {