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
ffae39c3
Commit
ffae39c3
authored
Apr 24, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Update the wined3d depth stencil on device creation, render.
parent
37800544
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
24 deletions
+56
-24
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
device.c
dlls/ddraw/device.c
+48
-1
direct3d.c
dlls/ddraw/direct3d.c
+1
-13
surface.c
dlls/ddraw/surface.c
+6
-10
No files found.
dlls/ddraw/ddraw_private.h
View file @
ffae39c3
...
@@ -360,6 +360,7 @@ const GUID IID_D3DDEVICE_WineD3D;
...
@@ -360,6 +360,7 @@ const GUID IID_D3DDEVICE_WineD3D;
/* Helper functions */
/* Helper functions */
HRESULT
IDirect3DImpl_GetCaps
(
IWineD3D
*
WineD3D
,
D3DDEVICEDESC
*
Desc123
,
D3DDEVICEDESC7
*
Desc7
);
HRESULT
IDirect3DImpl_GetCaps
(
IWineD3D
*
WineD3D
,
D3DDEVICEDESC
*
Desc123
,
D3DDEVICEDESC7
*
Desc7
);
DWORD
IDirect3DDeviceImpl_CreateHandle
(
IDirect3DDeviceImpl
*
This
);
DWORD
IDirect3DDeviceImpl_CreateHandle
(
IDirect3DDeviceImpl
*
This
);
WINED3DZBUFFERTYPE
IDirect3DDeviceImpl_UpdateDepthStencil
(
IDirect3DDeviceImpl
*
This
);
/* Structures */
/* Structures */
struct
EnumTextureFormatsCBS
struct
EnumTextureFormatsCBS
...
...
dlls/ddraw/device.c
View file @
ffae39c3
...
@@ -1742,13 +1742,23 @@ IDirect3DDeviceImpl_7_SetRenderTarget(IDirect3DDevice7 *iface,
...
@@ -1742,13 +1742,23 @@ IDirect3DDeviceImpl_7_SetRenderTarget(IDirect3DDevice7 *iface,
{
{
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
iface
);
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
iface
);
IDirectDrawSurfaceImpl
*
Target
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
NewTarget
);
IDirectDrawSurfaceImpl
*
Target
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
NewTarget
);
HRESULT
hr
;
TRACE
(
"(%p)->(%p,%08x): Relay
\n
"
,
This
,
NewTarget
,
Flags
);
TRACE
(
"(%p)->(%p,%08x): Relay
\n
"
,
This
,
NewTarget
,
Flags
);
/* Flags: Not used */
/* Flags: Not used */
return
IWineD3DDevice_SetRenderTarget
(
This
->
wineD3DDevice
,
hr
=
IWineD3DDevice_SetRenderTarget
(
This
->
wineD3DDevice
,
0
,
0
,
Target
?
Target
->
WineD3DSurface
:
NULL
);
Target
?
Target
->
WineD3DSurface
:
NULL
);
if
(
hr
!=
D3D_OK
)
{
return
hr
;
}
IDirectDrawSurface7_AddRef
(
NewTarget
);
IDirectDrawSurface7_Release
(
ICOM_INTERFACE
(
This
->
target
,
IDirectDrawSurface7
));
This
->
target
=
Target
;
IDirect3DDeviceImpl_UpdateDepthStencil
(
This
);
return
D3D_OK
;
}
}
static
HRESULT
WINAPI
static
HRESULT
WINAPI
...
@@ -5135,3 +5145,40 @@ IDirect3DDeviceImpl_CreateHandle(IDirect3DDeviceImpl *This)
...
@@ -5135,3 +5145,40 @@ IDirect3DDeviceImpl_CreateHandle(IDirect3DDeviceImpl *This)
TRACE
(
"Returning %d
\n
"
,
This
->
numHandles
);
TRACE
(
"Returning %d
\n
"
,
This
->
numHandles
);
return
This
->
numHandles
;
return
This
->
numHandles
;
}
}
/*****************************************************************************
* IDirect3DDeviceImpl_UpdateDepthStencil
*
* Checks the current render target for attached depth stencils and sets the
* WineD3D depth stencil accordingly.
*
* Returns:
* The depth stencil state to set if creating the device
*
*****************************************************************************/
WINED3DZBUFFERTYPE
IDirect3DDeviceImpl_UpdateDepthStencil
(
IDirect3DDeviceImpl
*
This
)
{
IDirectDrawSurface7
*
depthStencil
=
NULL
;
IDirectDrawSurfaceImpl
*
dsi
;
static
DDSCAPS2
depthcaps
=
{
DDSCAPS_ZBUFFER
,
0
,
0
,
0
};
IDirectDrawSurface7_GetAttachedSurface
(
ICOM_INTERFACE
(
This
->
target
,
IDirectDrawSurface7
),
&
depthcaps
,
&
depthStencil
);
if
(
!
depthStencil
)
{
TRACE
(
"Setting wined3d depth stencil to NULL
\n
"
);
IWineD3DDevice_SetDepthStencilSurface
(
This
->
wineD3DDevice
,
NULL
);
return
WINED3DZB_FALSE
;
}
dsi
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
depthStencil
);
TRACE
(
"Setting wined3d depth stencil to %p (wined3d %p)
\n
"
,
dsi
,
dsi
->
WineD3DSurface
);
IWineD3DDevice_SetDepthStencilSurface
(
This
->
wineD3DDevice
,
dsi
->
WineD3DSurface
);
IDirectDrawSurface7_Release
(
depthStencil
);
return
WINED3DZB_TRUE
;
}
dlls/ddraw/direct3d.c
View file @
ffae39c3
...
@@ -735,8 +735,6 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
...
@@ -735,8 +735,6 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
IParentImpl
*
IndexBufferParent
;
IParentImpl
*
IndexBufferParent
;
HRESULT
hr
;
HRESULT
hr
;
IDirectDrawSurfaceImpl
*
target
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
Surface
);
IDirectDrawSurfaceImpl
*
target
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
Surface
);
IDirectDrawSurface7
*
depthbuffer
=
NULL
;
static
DDSCAPS2
depthcaps
=
{
DDSCAPS_ZBUFFER
,
0
,
0
,
0
};
TRACE
(
"(%p)->(%s,%p,%p)
\n
"
,
iface
,
debugstr_guid
(
refiid
),
Surface
,
Device
);
TRACE
(
"(%p)->(%s,%p,%p)
\n
"
,
iface
,
debugstr_guid
(
refiid
),
Surface
,
Device
);
*
Device
=
NULL
;
*
Device
=
NULL
;
...
@@ -876,19 +874,9 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
...
@@ -876,19 +874,9 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
This
->
d3ddevice
=
object
;
This
->
d3ddevice
=
object
;
/* Look for a depth buffer and enable the Z test if one is found */
hr
=
IDirectDrawSurface7_GetAttachedSurface
(
Surface
,
&
depthcaps
,
&
depthbuffer
);
if
(
depthbuffer
)
{
TRACE
(
"(%p) Depth buffer found, enabling Z test
\n
"
,
object
);
IWineD3DDevice_SetRenderState
(
This
->
wineD3DDevice
,
IWineD3DDevice_SetRenderState
(
This
->
wineD3DDevice
,
WINED3DRS_ZENABLE
,
WINED3DRS_ZENABLE
,
TRUE
);
IDirect3DDeviceImpl_UpdateDepthStencil
(
object
));
IDirectDrawSurface7_Release
(
depthbuffer
);
}
return
D3D_OK
;
return
D3D_OK
;
}
}
...
...
dlls/ddraw/surface.c
View file @
ffae39c3
...
@@ -825,12 +825,10 @@ IDirectDrawSurfaceImpl_AddAttachedSurface(IDirectDrawSurface7 *iface,
...
@@ -825,12 +825,10 @@ IDirectDrawSurfaceImpl_AddAttachedSurface(IDirectDrawSurface7 *iface,
Surf
->
first_attached
=
This
->
first_attached
;
Surf
->
first_attached
=
This
->
first_attached
;
This
->
next_attached
=
Surf
;
This
->
next_attached
=
Surf
;
/* Check if we attach a back buffer to the primary */
/* Check if the WineD3D depth stencil needs updating */
if
(
Surf
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_ZBUFFER
&&
if
(
This
->
ddraw
->
d3ddevice
)
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
{
{
IWineD3DDevice_SetDepthStencilSurface
(
This
->
ddraw
->
wineD3DDevice
,
IDirect3DDeviceImpl_UpdateDepthStencil
(
This
->
ddraw
->
d3ddevice
);
Surf
->
WineD3DSurface
);
}
}
/* MSDN:
/* MSDN:
...
@@ -892,12 +890,10 @@ IDirectDrawSurfaceImpl_DeleteAttachedSurface(IDirectDrawSurface7 *iface,
...
@@ -892,12 +890,10 @@ IDirectDrawSurfaceImpl_DeleteAttachedSurface(IDirectDrawSurface7 *iface,
Surf
->
next_attached
=
NULL
;
Surf
->
next_attached
=
NULL
;
Surf
->
first_attached
=
Surf
;
Surf
->
first_attached
=
Surf
;
/* Check if we attach a back buffer to the primary */
/* Check if the WineD3D depth stencil needs updating */
if
(
Surf
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_ZBUFFER
&&
if
(
This
->
ddraw
->
d3ddevice
)
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
{
{
IWineD3DDevice_SetDepthStencilSurface
(
This
->
ddraw
->
wineD3DDevice
,
IDirect3DDeviceImpl_UpdateDepthStencil
(
This
->
ddraw
->
d3ddevice
);
NULL
);
}
}
IDirectDrawSurface7_Release
(
Attach
);
IDirectDrawSurface7_Release
(
Attach
);
...
...
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