Commit 104b5a81 authored by Axel Davy's avatar Axel Davy Committed by Emil Velikov

st/nine: clean device9ex.

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's avatarDavid Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy's avatarAxel Davy <axel.davy@ens.fr>
parent 9b7037a3
......@@ -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");
......
......@@ -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);
}
......@@ -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 );
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment