summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2016-09-23 17:55:08 +0200
committerAxel Davy <axel.davy@ens.fr>2016-10-10 23:43:51 +0200
commitf8c01e7a96aed4e64eab11acbae8aef70c8e7cbe (patch)
treef8661b7db1f9bdd41c08f1c7009f4d563e9231da
parent63367e6c9507dccba4e8bc563e190123e25b6893 (diff)
st/nine: Use NineDevice9_CreateDepthStencilSurface in swapchain9
Replace custom code with NineDevice9_CreateDepthStencilSurface. All functionality is given now.
-rw-r--r--src/gallium/state_trackers/nine/swapchain9.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index 37e433ff746..9459786c6cf 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -353,27 +353,31 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
if (tmplt.format == PIPE_FORMAT_NONE)
return D3DERR_INVALIDCALL;
- resource = This->screen->resource_create(This->screen, &tmplt);
- if (!resource) {
- DBG("Failed to create pipe_resource for depth buffer.\n");
- return D3DERR_OUTOFVIDEOMEMORY;
- }
if (This->zsbuf) {
+ resource = This->screen->resource_create(This->screen, &tmplt);
+ if (!resource) {
+ DBG("Failed to create pipe_resource for depth buffer.\n");
+ return D3DERR_OUTOFVIDEOMEMORY;
+ }
+
NineSurface9_SetMultiSampleType(This->zsbuf, desc.MultiSampleType);
NineSurface9_SetResourceResize(This->zsbuf, resource);
pipe_resource_reference(&resource, NULL);
} else {
- /* XXX wine thinks the container of this should be the device */
- desc.Format = pParams->AutoDepthStencilFormat;
- desc.Usage = D3DUSAGE_DEPTHSTENCIL;
- hr = NineSurface9_new(pDevice, NineUnknown(pDevice), resource, NULL, 0,
- 0, 0, &desc, &This->zsbuf);
- pipe_resource_reference(&resource, NULL);
+ hr = NineDevice9_CreateDepthStencilSurface(pDevice,
+ pParams->BackBufferWidth,
+ pParams->BackBufferHeight,
+ pParams->AutoDepthStencilFormat,
+ pParams->MultiSampleType,
+ pParams->MultiSampleQuality,
+ 0,
+ (IDirect3DSurface9 **)&This->zsbuf,
+ NULL);
if (FAILED(hr)) {
DBG("Failed to create ZS surface.\n");
return hr;
}
- This->zsbuf->base.base.forward = FALSE;
+ NineUnknown_ConvertRefToBind(NineUnknown(This->zsbuf));
}
}
@@ -493,7 +497,7 @@ NineSwapChain9_dtor( struct NineSwapChain9 *This )
}
}
if (This->zsbuf)
- NineUnknown_Destroy(NineUnknown(This->zsbuf));
+ NineUnknown_Unbind(NineUnknown(This->zsbuf));
if (This->present)
ID3DPresent_Release(This->present);