diff options
author | Axel Davy <[email protected]> | 2016-10-19 20:57:48 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:20 +0100 |
commit | d38215fb175140050c721a357c0982377ce423bb (patch) | |
tree | d4a782ca19968451fe132b3375e4dedf5155093d /src | |
parent | 409ad787778461e774b5b0dfa4e6c77f355ca16f (diff) |
st/nine: Fix useless swapchain init checks
In NineDevice9_SetDefaultState we can assume the
implicit swapchain is properly initialized.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 7bdf19fdc97..1796fa3ce74 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -92,25 +92,18 @@ NineDevice9_SetDefaultState( struct NineDevice9 *This, boolean is_reset ) nine_state_set_defaults(This, &This->caps, is_reset); + refSurf = This->swapchains[0]->buffers[0]; + assert(refSurf); + This->state.viewport.X = 0; This->state.viewport.Y = 0; - This->state.viewport.Width = 0; - This->state.viewport.Height = 0; + This->state.viewport.Width = refSurf->desc.Width; + This->state.viewport.Height = refSurf->desc.Height; This->state.scissor.minx = 0; This->state.scissor.miny = 0; - This->state.scissor.maxx = 0xffff; - This->state.scissor.maxy = 0xffff; - - if (This->nswapchains && This->swapchains[0]->params.BackBufferCount) - refSurf = This->swapchains[0]->buffers[0]; - - if (refSurf) { - This->state.viewport.Width = refSurf->desc.Width; - This->state.viewport.Height = refSurf->desc.Height; - This->state.scissor.maxx = refSurf->desc.Width; - This->state.scissor.maxy = refSurf->desc.Height; - } + This->state.scissor.maxx = refSurf->desc.Width; + This->state.scissor.maxy = refSurf->desc.Height; if (This->nswapchains && This->swapchains[0]->params.EnableAutoDepthStencil) { This->state.rs[D3DRS_ZENABLE] = TRUE; |