Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3fd04308
Commit
3fd04308
authored
Dec 05, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Dec 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d: Callback infrastructure for implicit depth stencil surface destruction in IWineD3DDevice.
parent
50a0c212
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
12 deletions
+42
-12
d3d8_private.h
dlls/d3d8/d3d8_private.h
+2
-0
device.c
dlls/d3d8/device.c
+1
-1
directx.c
dlls/d3d8/directx.c
+9
-0
d3d9_private.h
dlls/d3d9/d3d9_private.h
+2
-0
device.c
dlls/d3d9/device.c
+1
-1
directx.c
dlls/d3d9/directx.c
+8
-0
ddraw.c
dlls/ddraw/ddraw.c
+10
-1
ddraw_private.h
dlls/ddraw/ddraw_private.h
+3
-0
surface.c
dlls/ddraw/surface.c
+1
-1
device.c
dlls/wined3d/device.c
+3
-6
wined3d_interface.h
include/wine/wined3d_interface.h
+2
-2
No files found.
dlls/d3d8/d3d8_private.h
View file @
3fd04308
...
...
@@ -591,4 +591,6 @@ extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSup
DWORD
MultisampleQuality
,
BOOL
Lockable
,
IWineD3DSurface
**
ppSurface
,
HANDLE
*
pSharedHandle
);
extern
ULONG
WINAPI
D3D8CB_DestroyDepthStencilSurface
(
IWineD3DSurface
*
pSurface
);
#endif
/* __WINE_D3DX8_PRIVATE_H */
dlls/d3d8/device.c
View file @
3fd04308
...
...
@@ -95,7 +95,7 @@ static ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface) {
if
(
ref
==
0
)
{
TRACE
(
"Releasing wined3d device %p
\n
"
,
This
->
WineD3DDevice
);
IWineD3DDevice_Uninit3D
(
This
->
WineD3DDevice
);
IWineD3DDevice_Uninit3D
(
This
->
WineD3DDevice
,
D3D8CB_DestroyDepthStencilSurface
);
IWineD3DDevice_Release
(
This
->
WineD3DDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
shader_handles
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
dlls/d3d8/directx.c
View file @
3fd04308
...
...
@@ -285,6 +285,15 @@ HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSup
return
res
;
}
ULONG
WINAPI
D3D8CB_DestroyDepthStencilSurface
(
IWineD3DSurface
*
pSurface
)
{
IDirect3DSurface8Impl
*
surfaceParent
;
TRACE
(
"(%p) call back
\n
"
,
pSurface
);
IWineD3DSurface_GetParent
(
pSurface
,
(
IUnknown
**
)
&
surfaceParent
);
IDirect3DSurface8_Release
((
IDirect3DSurface8
*
)
surfaceParent
);
return
IDirect3DSurface8_Release
((
IDirect3DSurface8
*
)
surfaceParent
);
}
static
HRESULT
WINAPI
IDirect3D8Impl_CreateDevice
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
HWND
hFocusWindow
,
DWORD
BehaviourFlags
,
D3DPRESENT_PARAMETERS
*
pPresentationParameters
,
IDirect3DDevice8
**
ppReturnedDeviceInterface
)
{
...
...
dlls/d3d9/d3d9_private.h
View file @
3fd04308
...
...
@@ -541,4 +541,6 @@ extern HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, IUnknown *pSup
DWORD
MultisampleQuality
,
BOOL
Lockable
,
IWineD3DSurface
**
ppSurface
,
HANDLE
*
pSharedHandle
);
extern
ULONG
WINAPI
D3D9CB_DestroyDepthStencilSurface
(
IWineD3DSurface
*
pSurface
);
#endif
/* __WINE_D3D9_PRIVATE_H */
dlls/d3d9/device.c
View file @
3fd04308
...
...
@@ -58,7 +58,7 @@ static ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface) {
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
IWineD3DDevice_Uninit3D
(
This
->
WineD3DDevice
);
IWineD3DDevice_Uninit3D
(
This
->
WineD3DDevice
,
D3D9CB_DestroyDepthStencilSurface
);
IWineD3DDevice_Release
(
This
->
WineD3DDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
dlls/d3d9/directx.c
View file @
3fd04308
...
...
@@ -269,6 +269,14 @@ HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSup
return
res
;
}
ULONG
WINAPI
D3D9CB_DestroyDepthStencilSurface
(
IWineD3DSurface
*
pSurface
)
{
IDirect3DSurface9Impl
*
surfaceParent
;
TRACE
(
"(%p) call back
\n
"
,
pSurface
);
IWineD3DSurface_GetParent
(
pSurface
,
(
IUnknown
**
)
&
surfaceParent
);
IDirect3DSurface9_Release
((
IDirect3DSurface9
*
)
surfaceParent
);
return
IDirect3DSurface9_Release
((
IDirect3DSurface9
*
)
surfaceParent
);
}
HRESULT
WINAPI
IDirect3D9Impl_CreateDevice
(
LPDIRECT3D9
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
HWND
hFocusWindow
,
DWORD
BehaviourFlags
,
D3DPRESENT_PARAMETERS
*
pPresentationParameters
,
...
...
dlls/ddraw/ddraw.c
View file @
3fd04308
...
...
@@ -1621,7 +1621,7 @@ IDirectDrawImpl_RecreateAllSurfaces(IDirectDrawImpl *This)
/* Should happen almost never */
FIXME
(
"(%p) Switching to non-opengl surfaces with d3d started. Is this a bug?
\n
"
,
This
);
/* Shutdown d3d */
IWineD3DDevice_Uninit3D
(
This
->
wineD3DDevice
);
IWineD3DDevice_Uninit3D
(
This
->
wineD3DDevice
,
D3D7CB_DestroyDepthStencilSurface
);
}
/* Contrary: D3D starting is handled by the caller, because it knows the render target */
...
...
@@ -1679,6 +1679,15 @@ D3D7CB_CreateSurface(IUnknown *device,
return
D3D_OK
;
}
ULONG
WINAPI
D3D7CB_DestroyDepthStencilSurface
(
IWineD3DSurface
*
pSurface
)
{
IUnknown
*
surfaceParent
;
TRACE
(
"(%p) call back
\n
"
,
pSurface
);
IWineD3DSurface_GetParent
(
pSurface
,
(
IUnknown
**
)
&
surfaceParent
);
IUnknown_Release
(
surfaceParent
);
return
IUnknown_Release
(
surfaceParent
);
}
/*****************************************************************************
* IDirectDrawImpl_CreateNewSurface
*
...
...
dlls/ddraw/ddraw_private.h
View file @
3fd04308
...
...
@@ -75,6 +75,9 @@ typedef struct IDirect3DExecuteBufferImpl IDirect3DExecuteBufferImpl;
typedef
struct
IDirect3DVertexBufferImpl
IDirect3DVertexBufferImpl
;
typedef
struct
IParentImpl
IParentImpl
;
/* Callbacks for implicit object destruction */
extern
ULONG
WINAPI
D3D7CB_DestroyDepthStencilSurface
(
IWineD3DSurface
*
pSurface
);
/*****************************************************************************
* IDirectDraw implementation structure
*****************************************************************************/
...
...
dlls/ddraw/surface.c
View file @
3fd04308
...
...
@@ -311,7 +311,7 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
IWineD3DDevice_SetIndices
(
ddraw
->
wineD3DDevice
,
NULL
,
0
);
IWineD3DDevice_SetDepthStencilSurface
(
ddraw
->
wineD3DDevice
,
NULL
);
if
(
IWineD3DDevice_Uninit3D
(
ddraw
->
wineD3DDevice
)
!=
D3D_OK
)
if
(
IWineD3DDevice_Uninit3D
(
ddraw
->
wineD3DDevice
,
D3D7CB_DestroyDepthStencilSurface
)
!=
D3D_OK
)
{
/* Not good */
ERR
(
"(%p) Failed to uninit 3D
\n
"
,
This
);
...
...
dlls/wined3d/device.c
View file @
3fd04308
...
...
@@ -2148,10 +2148,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_Uninit3D
(
IWineD3DDevice
*
iface
)
{
static
HRESULT
WINAPI
IWineD3DDeviceImpl_Uninit3D
(
IWineD3DDevice
*
iface
,
D3DCB_DESTROYSURFACEFN
D3DCB_DestroyDepthStencilSurface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
int
sampler
;
IUnknown
*
stencilBufferParent
;
IUnknown
*
swapChainParent
;
uint
i
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -2186,10 +2185,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface) {
This
->
renderTarget
=
NULL
;
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
);
if
(
D3DCB_DestroyDepthStencilSurface
>
0
)
{
FIXME
(
"(%p) Something's still holding the depthStencilBuffer
\n
"
,
This
);
}
This
->
depthStencilBuffer
=
NULL
;
}
...
...
include/wine/wined3d_interface.h
View file @
3fd04308
...
...
@@ -359,7 +359,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD
(
CreatePixelShader
)(
THIS_
CONST
DWORD
*
pFunction
,
struct
IWineD3DPixelShader
**
ppShader
,
IUnknown
*
pParent
)
PURE
;
STDMETHOD_
(
HRESULT
,
CreatePalette
)(
THIS_
DWORD
Flags
,
PALETTEENTRY
*
PalEnt
,
struct
IWineD3DPalette
**
Palette
,
IUnknown
*
Parent
);
STDMETHOD
(
Init3D
)(
THIS_
WINED3DPRESENT_PARAMETERS
*
pPresentationParameters
,
D3DCB_CREATEADDITIONALSWAPCHAIN
D3DCB_CreateAdditionalSwapChain
);
STDMETHOD
(
Uninit3D
)(
THIS
);
STDMETHOD
(
Uninit3D
)(
THIS
,
D3DCB_DESTROYSURFACEFN
pFn
);
STDMETHOD_
(
void
,
SetFullscreen
)(
THIS_
BOOL
fullscreen
);
STDMETHOD
(
EnumDisplayModes
)(
THIS_
DWORD
Flags
,
UINT
Width
,
UINT
Height
,
WINED3DFORMAT
Format
,
void
*
context
,
D3DCB_ENUMDISPLAYMODESCALLBACK
cb
)
PURE
;
STDMETHOD
(
EvictManagedResources
)(
THIS
)
PURE
;
...
...
@@ -499,7 +499,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
#define IWineD3DDevice_CreatePixelShader(p,a,b,c) (p)->lpVtbl->CreatePixelShader(p,a,b,c)
#define IWineD3DDevice_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d)
#define IWineD3DDevice_Init3D(p, a, b) (p)->lpVtbl->Init3D(p, a, b)
#define IWineD3DDevice_Uninit3D(p
) (p)->lpVtbl->Uninit3D(p
)
#define IWineD3DDevice_Uninit3D(p
, a) (p)->lpVtbl->Uninit3D(p, a
)
#define IWineD3DDevice_SetFullscreen(p, a) (p)->lpVtbl->SetFullscreen(p, a)
#define IWineD3DDevice_EnumDisplayModes(p,a,b,c,d,e,f) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d,e,f)
#define IWineD3DDevice_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment