Module: wine
Branch: refs/heads/master
Commit: 99f67c676b73bc5138fd27f072cd788a29292c42
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=99f67c676b73bc5138fd27f…
Author: Ivan Gyurdiev <ivg231(a)gmail.com>
Date: Thu Jul 20 23:06:32 2006 -0400
wined3d: Respect EnableAutoDepthStencil parameter.
---
dlls/wined3d/device.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index babbb9b..53c4986 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1752,7 +1752,7 @@ #endif
}
/* Under directX swapchains share the depth stencil, so only create one depth-stencil */
- if (pPresentationParameters->EnableAutoDepthStencil && hr == WINED3D_OK) {
+ if (*(pPresentationParameters->EnableAutoDepthStencil) && hr == WINED3D_OK) {
TRACE("Creating depth stencil buffer\n");
if (This->depthStencilBuffer == NULL ) {
hr = D3DCB_CreateDepthStencil((IUnknown *) This->parent,
@@ -2127,12 +2127,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl
TRACE("Setting rendertarget to NULL\n");
This->renderTarget = NULL;
- IWineD3DSurface_GetParent(This->depthStencilBuffer, &stencilBufferParent);
- IUnknown_Release(stencilBufferParent); /* once for the get parent */
- if(IUnknown_Release(stencilBufferParent) >0){ /* the second time for when it was created */
- FIXME("(%p) Something's still holding the depthStencilBuffer\n",This);
+ if (This->depthStencilBuffer) {
+ IWineD3DSurface_GetParent(This->depthStencilBuffer, &stencilBufferParent);
+ IUnknown_Release(stencilBufferParent); /* once for the get parent */
+ if(IUnknown_Release(stencilBufferParent) >0){ /* the second time for when it was created */
+ FIXME("(%p) Something's still holding the depthStencilBuffer\n",This);
+ }
+ This->depthStencilBuffer = NULL;
}
- This->depthStencilBuffer = NULL;
for(i=0; i < This->NumberOfSwapChains; i++) {
TRACE("Releasing the implicit swapchain %d\n", i);
Module: wine
Branch: refs/heads/master
Commit: 0c6c9f04a76c7666d07689cedd21970eca81953e
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=0c6c9f04a76c7666d07689c…
Author: Ivan Gyurdiev <ivg231(a)gmail.com>
Date: Thu Jul 20 23:03:31 2006 -0400
wined3d: Restore recording mode later in ActiveRender().
---
dlls/wined3d/device.c | 34 +++++++++++++++-------------------
1 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2956a15..fb7e084 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -7225,6 +7225,8 @@ #endif
static HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
IWineD3DSurface *RenderSurface) {
HRESULT ret = WINED3DERR_INVALIDCALL;
+ BOOL oldRecording;
+ IWineD3DStateBlockImpl *oldUpdateStateBlock;
/**
* Currently only active for GLX >= 1.3
@@ -7444,23 +7446,14 @@ #endif
}
}
-#if 1 /* Apply the stateblock to the new context
-FIXME: This is a bit of a hack, each context should know it's own state,
-the directX current directX state should then be applied to the context */
- {
- BOOL oldRecording;
- IWineD3DStateBlockImpl *oldUpdateStateBlock;
- oldUpdateStateBlock = This->updateStateBlock;
- oldRecording= This->isRecordingState;
- This->isRecordingState = FALSE;
- This->updateStateBlock = This->stateBlock;
- IWineD3DStateBlock_Apply((IWineD3DStateBlock *)This->stateBlock);
-
- This->isRecordingState = oldRecording;
- This->updateStateBlock = oldUpdateStateBlock;
- }
-#endif
-
+ /* Disable recording, and apply the stateblock to the new context
+ * FIXME: This is a bit of a hack, each context should know it's own state,
+ * the directX current directX state should then be applied to the context */
+ oldUpdateStateBlock = This->updateStateBlock;
+ oldRecording= This->isRecordingState;
+ This->isRecordingState = FALSE;
+ This->updateStateBlock = This->stateBlock;
+ IWineD3DStateBlock_Apply((IWineD3DStateBlock *)This->stateBlock);
/* clean up the current rendertargets swapchain (if it belonged to one) */
if (currentSwapchain != NULL) {
@@ -7474,10 +7467,9 @@ #endif
IWineD3DSurface_AddRef(This->renderTarget);
IWineD3DSurface_Release(tmp);
-
-
{
DWORD value;
+
/* The surface must be rendered upside down to cancel the flip produce by glCopyTexImage */
/* Check that the container is not a swapchain member */
@@ -7498,6 +7490,10 @@ #endif
This->proj_valid = FALSE;
}
+ /* Restore recording state */
+ This->isRecordingState = oldRecording;
+ This->updateStateBlock = oldUpdateStateBlock;
+
ret = WINED3D_OK;
if (cfgs != NULL) {