Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
95b4207c
Commit
95b4207c
authored
Oct 01, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Just return the surface from wined3d_device_get_depth_stencil().
parent
972217fd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
40 deletions
+20
-40
device.c
dlls/d3d8/device.c
+9
-17
device.c
dlls/d3d9/device.c
+3
-6
ddraw.c
dlls/ddraw/ddraw.c
+3
-2
device.c
dlls/wined3d/device.c
+3
-12
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d.h
include/wine/wined3d.h
+1
-2
No files found.
dlls/d3d8/device.c
View file @
95b4207c
...
...
@@ -1122,19 +1122,14 @@ static HRESULT WINAPI d3d8_device_SetRenderTarget(IDirect3DDevice8 *iface,
}
}
hr
=
wined3d_device_get_depth_stencil
(
device
->
wined3d_device
,
&
original_ds
);
if
(
hr
==
WINED3D_OK
||
hr
==
WINED3DERR_NOTFOUND
)
original_ds
=
wined3d_device_get_depth_stencil
(
device
->
wined3d_device
);
hr
=
wined3d_device_set_depth_stencil
(
device
->
wined3d_device
,
ds_impl
?
ds_impl
->
wined3d_surface
:
NULL
);
if
(
SUCCEEDED
(
hr
)
&&
render_target
)
{
hr
=
wined3d_device_set_depth_stencil
(
device
->
wined3d_device
,
ds_impl
?
ds_impl
->
wined3d_surface
:
NULL
);
if
(
SUCCEEDED
(
hr
)
&&
render_target
)
{
hr
=
wined3d_device_set_render_target
(
device
->
wined3d_device
,
0
,
rt_impl
->
wined3d_surface
,
TRUE
);
if
(
FAILED
(
hr
))
wined3d_device_set_depth_stencil
(
device
->
wined3d_device
,
original_ds
);
}
hr
=
wined3d_device_set_render_target
(
device
->
wined3d_device
,
0
,
rt_impl
->
wined3d_surface
,
TRUE
);
if
(
FAILED
(
hr
))
wined3d_device_set_depth_stencil
(
device
->
wined3d_device
,
original_ds
);
}
if
(
original_ds
)
wined3d_surface_decref
(
original_ds
);
wined3d_mutex_unlock
();
...
...
@@ -1177,7 +1172,7 @@ static HRESULT WINAPI d3d8_device_GetDepthStencilSurface(IDirect3DDevice8 *iface
struct
d3d8_device
*
device
=
impl_from_IDirect3DDevice8
(
iface
);
struct
wined3d_surface
*
wined3d_surface
;
struct
d3d8_surface
*
surface_impl
;
HRESULT
hr
;
HRESULT
hr
=
D3D_OK
;
TRACE
(
"iface %p, depth_stencil %p.
\n
"
,
iface
,
depth_stencil
);
...
...
@@ -1185,18 +1180,15 @@ static HRESULT WINAPI d3d8_device_GetDepthStencilSurface(IDirect3DDevice8 *iface
return
D3DERR_INVALIDCALL
;
wined3d_mutex_lock
();
hr
=
wined3d_device_get_depth_stencil
(
device
->
wined3d_device
,
&
wined3d_surface
);
if
(
SUCCEEDED
(
hr
))
if
((
wined3d_surface
=
wined3d_device_get_depth_stencil
(
device
->
wined3d_device
)))
{
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
depth_stencil
=
&
surface_impl
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
depth_stencil
);
wined3d_surface_decref
(
wined3d_surface
);
}
else
{
if
(
hr
!=
WINED3DERR_NOTFOUND
)
ERR
(
"Failed to get wined3d depth stencil, hr %#x.
\n
"
,
hr
);
hr
=
WINED3DERR_NOTFOUND
;
*
depth_stencil
=
NULL
;
}
wined3d_mutex_unlock
();
...
...
dlls/d3d9/device.c
View file @
95b4207c
...
...
@@ -1240,7 +1240,7 @@ static HRESULT WINAPI d3d9_device_GetDepthStencilSurface(IDirect3DDevice9Ex *ifa
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_surface
*
wined3d_surface
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
HRESULT
hr
=
D3D_OK
;
TRACE
(
"iface %p, depth_stencil %p.
\n
"
,
iface
,
depth_stencil
);
...
...
@@ -1248,18 +1248,15 @@ static HRESULT WINAPI d3d9_device_GetDepthStencilSurface(IDirect3DDevice9Ex *ifa
return
D3DERR_INVALIDCALL
;
wined3d_mutex_lock
();
hr
=
wined3d_device_get_depth_stencil
(
device
->
wined3d_device
,
&
wined3d_surface
);
if
(
SUCCEEDED
(
hr
))
if
((
wined3d_surface
=
wined3d_device_get_depth_stencil
(
device
->
wined3d_device
)))
{
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
depth_stencil
=
&
surface_impl
->
IDirect3DSurface9_iface
;
IDirect3DSurface9_AddRef
(
*
depth_stencil
);
wined3d_surface_decref
(
wined3d_surface
);
}
else
{
if
(
hr
!=
WINED3DERR_NOTFOUND
)
WARN
(
"Call to IWineD3DDevice_GetDepthStencilSurface failed with 0x%08x
\n
"
,
hr
);
hr
=
WINED3DERR_NOTFOUND
;
*
depth_stencil
=
NULL
;
}
wined3d_mutex_unlock
();
...
...
dlls/ddraw/ddraw.c
View file @
95b4207c
...
...
@@ -754,7 +754,7 @@ static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL win
static
HRESULT
WINAPI
ddraw7_SetCooperativeLevel
(
IDirectDraw7
*
iface
,
HWND
hwnd
,
DWORD
cooplevel
)
{
struct
ddraw
*
This
=
impl_from_IDirectDraw7
(
iface
);
struct
wined3d_surface
*
rt
=
NULL
,
*
ds
;
struct
wined3d_surface
*
rt
=
NULL
,
*
ds
=
NULL
;
struct
wined3d_stateblock
*
stateblock
;
BOOL
restore_state
=
FALSE
;
HWND
window
;
...
...
@@ -938,7 +938,8 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
else
if
(
rt
)
wined3d_surface_incref
(
rt
);
wined3d_device_get_depth_stencil
(
This
->
wined3d_device
,
&
ds
);
if
((
ds
=
wined3d_device_get_depth_stencil
(
This
->
wined3d_device
)))
wined3d_surface_incref
(
ds
);
}
ddraw_destroy_swapchain
(
This
);
...
...
dlls/wined3d/device.c
View file @
95b4207c
...
...
@@ -4493,20 +4493,11 @@ struct wined3d_surface * CDECL wined3d_device_get_render_target(const struct win
return
device
->
fb
.
render_targets
[
render_target_idx
];
}
HRESULT
CDECL
wined3d_device_get_depth_stencil
(
const
struct
wined3d_device
*
device
,
struct
wined3d_surface
**
depth_stencil
)
struct
wined3d_surface
*
CDECL
wined3d_device_get_depth_stencil
(
const
struct
wined3d_device
*
device
)
{
TRACE
(
"device %p, depth_stencil %p.
\n
"
,
device
,
depth_stencil
);
*
depth_stencil
=
device
->
fb
.
depth_stencil
;
TRACE
(
"Returning depth/stencil surface %p.
\n
"
,
*
depth_stencil
);
if
(
!*
depth_stencil
)
return
WINED3DERR_NOTFOUND
;
wined3d_surface_incref
(
*
depth_stencil
);
TRACE
(
"device %p.
\n
"
,
device
);
return
WINED3D_OK
;
return
device
->
fb
.
depth_stencil
;
}
HRESULT
CDECL
wined3d_device_set_render_target
(
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/wined3d.spec
View file @
95b4207c
...
...
@@ -59,7 +59,7 @@
@ cdecl wined3d_device_get_clip_plane(ptr long ptr)
@ cdecl wined3d_device_get_clip_status(ptr ptr)
@ cdecl wined3d_device_get_creation_parameters(ptr ptr)
@ cdecl wined3d_device_get_depth_stencil(ptr
ptr
)
@ cdecl wined3d_device_get_depth_stencil(ptr)
@ cdecl wined3d_device_get_device_caps(ptr ptr)
@ cdecl wined3d_device_get_display_mode(ptr long ptr ptr)
@ cdecl wined3d_device_get_front_buffer_data(ptr long ptr)
...
...
include/wine/wined3d.h
View file @
95b4207c
...
...
@@ -2116,8 +2116,7 @@ HRESULT __cdecl wined3d_device_get_clip_status(const struct wined3d_device *devi
struct
wined3d_clip_status
*
clip_status
);
HRESULT
__cdecl
wined3d_device_get_creation_parameters
(
const
struct
wined3d_device
*
device
,
struct
wined3d_device_creation_parameters
*
creation_parameters
);
HRESULT
__cdecl
wined3d_device_get_depth_stencil
(
const
struct
wined3d_device
*
device
,
struct
wined3d_surface
**
depth_stencil
);
struct
wined3d_surface
*
__cdecl
wined3d_device_get_depth_stencil
(
const
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_get_device_caps
(
const
struct
wined3d_device
*
device
,
WINED3DCAPS
*
caps
);
HRESULT
__cdecl
wined3d_device_get_display_mode
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
struct
wined3d_display_mode
*
mode
,
enum
wined3d_display_rotation
*
rotation
);
...
...
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