st/nine: clean device9ex.
authorAxel Davy <axel.davy@ens.fr>
Mon, 24 Nov 2014 23:38:01 +0000 (00:38 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 26 Nov 2014 20:09:10 +0000 (20:09 +0000)
Pass ex specific parameters as arguments to device9 ctor instead
of passing them by filling the structure.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/adapter9.c
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/device9.h
src/gallium/state_trackers/nine/device9ex.c

index 8d574deeca3b14696a9301e5993ce3c08e5265ad..e409d5f34730495360fdf68a48b0d2bcb9ac4567 100644 (file)
@@ -990,7 +990,7 @@ NineAdapter9_CreateDevice( struct NineAdapter9 *This,
     params.BehaviorFlags = BehaviorFlags;
 
     hr = NineDevice9_new(screen, &params, &caps, pPresentationParameters,
-                         pD3D9, pPresentationGroup, This->ctx,
+                         pD3D9, pPresentationGroup, This->ctx, FALSE, NULL,
                          (struct NineDevice9 **)ppReturnedDeviceInterface);
     if (FAILED(hr)) {
         DBG("Failed to create device.\n");
index 7d2142d03f1ea68a418d3ef524191c6317aa4dbd..5f95b42aa00315afeb9e887d1ff8b62d3fc5906f 100644 (file)
@@ -139,7 +139,9 @@ NineDevice9_ctor( struct NineDevice9 *This,
                   D3DPRESENT_PARAMETERS *pPresentationParameters,
                   IDirect3D9 *pD3D9,
                   ID3DPresentGroup *pPresentationGroup,
-                  struct d3dadapter9_context *pCTX )
+                  struct d3dadapter9_context *pCTX,
+                  boolean ex,
+                  D3DDISPLAYMODEEX *pFullscreenDisplayMode )
 {
     unsigned i;
     HRESULT hr = NineUnknown_ctor(&This->base, pParams);
@@ -151,6 +153,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
     This->caps = *pCaps;
     This->d3d9 = pD3D9;
     This->params = *pCreationParameters;
+    This->ex = ex;
     This->present = pPresentationGroup;
     IDirect3D9_AddRef(This->d3d9);
     ID3DPresentGroup_AddRef(This->present);
@@ -177,12 +180,12 @@ NineDevice9_ctor( struct NineDevice9 *This,
         if (FAILED(hr))
             return hr;
 
-        if (This->ex) {
+        if (ex) {
             D3DDISPLAYMODEEX *mode = NULL;
             struct NineSwapChain9Ex **ret =
                 (struct NineSwapChain9Ex **)&This->swapchains[i];
 
-            if (This->pFullscreenDisplayMode) mode = &(This->pFullscreenDisplayMode[i]);
+            if (pFullscreenDisplayMode) mode = &(pFullscreenDisplayMode[i]);
             /* when this is a Device9Ex, it should create SwapChain9Exs */
             hr = NineSwapChain9Ex_new(This, TRUE, present,
                                       &pPresentationParameters[i], pCTX,
@@ -310,9 +313,6 @@ NineDevice9_ctor( struct NineDevice9 *This,
     This->update = &This->state;
     nine_update_state(This, ~0);
 
-    /* Is just used to pass the parameter from NineDevice9Ex_ctor */
-    This->pFullscreenDisplayMode = NULL;
-
     ID3DPresentGroup_Release(This->present);
 
     return D3D_OK;
@@ -974,7 +974,7 @@ create_zs_or_rt_surface(struct NineDevice9 *This,
     } else {
         resource = NULL;
     }
-    hr = NineSurface9_new(This, NULL, resource, 0, 0, 0, &desc, &surface);
+    hr = NineSurface9_new(This, NULL, resource, NULL, 0, 0, 0, &desc, &surface);
     pipe_resource_reference(&resource, NULL);
 
     if (SUCCEEDED(hr))
@@ -3447,6 +3447,8 @@ NineDevice9_new( struct pipe_screen *pScreen,
                  IDirect3D9 *pD3D9,
                  ID3DPresentGroup *pPresentationGroup,
                  struct d3dadapter9_context *pCTX,
+                 boolean ex,
+                 D3DDISPLAYMODEEX *pFullscreenDisplayMode,
                  struct NineDevice9 **ppOut )
 {
     BOOL lock;
@@ -3454,5 +3456,6 @@ NineDevice9_new( struct pipe_screen *pScreen,
 
     NINE_NEW(Device9, ppOut, lock, /* args */
              pScreen, pCreationParameters, pCaps,
-             pPresentationParameters, pD3D9, pPresentationGroup, pCTX);
+             pPresentationParameters, pD3D9, pPresentationGroup, pCTX,
+             ex, pFullscreenDisplayMode);
 }
index 9dc248e64fbd5c9964148b02f513989ad0d4674c..3649e1b479e76fdf279ffddd304c6fb6eacb45dd 100644 (file)
@@ -48,7 +48,6 @@ struct NineDevice9
 {
     struct NineUnknown base;
     boolean ex;
-    D3DDISPLAYMODEEX *pFullscreenDisplayMode;
 
     /* G3D context */
     struct pipe_screen *screen;
@@ -134,6 +133,8 @@ NineDevice9_new( struct pipe_screen *pScreen,
                  IDirect3D9 *pD3D9,
                  ID3DPresentGroup *pPresentationGroup,
                  struct d3dadapter9_context *pCTX,
+                 boolean ex,
+                 D3DDISPLAYMODEEX *pFullscreenDisplayMode,
                  struct NineDevice9 **ppOut );
 
 HRESULT
@@ -145,7 +146,9 @@ NineDevice9_ctor( struct NineDevice9 *This,
                   D3DPRESENT_PARAMETERS *pPresentationParameters,
                   IDirect3D9 *pD3D9,
                   ID3DPresentGroup *pPresentationGroup,
-                  struct d3dadapter9_context *pCTX );
+                  struct d3dadapter9_context *pCTX,
+                  boolean ex,
+                  D3DDISPLAYMODEEX *pFullscreenDisplayMode );
 
 void
 NineDevice9_dtor( struct NineDevice9 *This );
index 00d460bdee48cae06de7e37f9c163a02e7827495..d36189d45716061e8e9d37b4d5027509bf610de1 100644 (file)
@@ -39,13 +39,11 @@ NineDevice9Ex_ctor( struct NineDevice9Ex *This,
                     ID3DPresentGroup *pPresentationGroup,
                     struct d3dadapter9_context *pCTX )
 {
-    This->base.ex = TRUE;
-    This->base.pFullscreenDisplayMode = pFullscreenDisplayMode;
-
     return NineDevice9_ctor(&This->base, pParams,
                             pScreen, pCreationParameters, pCaps,
                             pPresentationParameters,
-                            (IDirect3D9 *)pD3D9Ex, pPresentationGroup, pCTX);
+                            (IDirect3D9 *)pD3D9Ex, pPresentationGroup, pCTX,
+                            TRUE, pFullscreenDisplayMode);
 }
 
 static void