st/nine: Fix useless swapchain init checks
authorAxel Davy <axel.davy@ens.fr>
Wed, 19 Oct 2016 18:57:48 +0000 (20:57 +0200)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:20 +0000 (23:44 +0100)
In NineDevice9_SetDefaultState we can assume the
implicit swapchain is properly initialized.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c

index 7bdf19fdc9765713f49c34ce4cfc6390a20f74db..1796fa3ce7461d34ffb2fa0fae08d46802f868e7 100644 (file)
@@ -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;