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
972217fd
Commit
972217fd
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_render_target().
parent
93418213
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
36 deletions
+21
-36
device.c
dlls/d3d8/device.c
+6
-8
device.c
dlls/d3d9/device.c
+3
-6
ddraw.c
dlls/ddraw/ddraw.c
+4
-5
device.c
dlls/wined3d/device.c
+5
-14
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d.h
include/wine/wined3d.h
+2
-2
No files found.
dlls/d3d8/device.c
View file @
972217fd
...
...
@@ -1100,14 +1100,12 @@ static HRESULT WINAPI d3d8_device_SetRenderTarget(IDirect3DDevice8 *iface,
/* If no render target is passed in check the size against the current RT */
if
(
!
render_target
)
{
hr
=
wined3d_device_get_render_target
(
device
->
wined3d_device
,
0
,
&
original_rt
);
if
(
FAILED
(
hr
)
||
!
original_rt
)
if
(
!
(
original_rt
=
wined3d_device_get_render_target
(
device
->
wined3d_device
,
0
)))
{
wined3d_mutex_unlock
();
return
hr
;
return
D3DERR_NOTFOUND
;
}
wined3d_resource
=
wined3d_surface_get_resource
(
original_rt
);
wined3d_surface_decref
(
original_rt
);
}
else
wined3d_resource
=
wined3d_surface_get_resource
(
rt_impl
->
wined3d_surface
);
...
...
@@ -1156,18 +1154,18 @@ static HRESULT WINAPI d3d8_device_GetRenderTarget(IDirect3DDevice8 *iface, IDire
return
D3DERR_INVALIDCALL
;
wined3d_mutex_lock
();
hr
=
wined3d_device_get_render_target
(
device
->
wined3d_device
,
0
,
&
wined3d_surface
);
if
(
SUCCEEDED
(
hr
)
&&
wined3d_surface
)
if
((
wined3d_surface
=
wined3d_device_get_render_target
(
device
->
wined3d_device
,
0
)))
{
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
render_target
=
&
surface_impl
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
render_target
);
wined3d_surface_decref
(
wined3d_surface
)
;
hr
=
D3D_OK
;
}
else
{
ERR
(
"Failed to get wined3d render target
, hr %#x.
\n
"
,
hr
);
ERR
(
"Failed to get wined3d render target
.
\n
"
);
*
render_target
=
NULL
;
hr
=
D3DERR_NOTFOUND
;
}
wined3d_mutex_unlock
();
...
...
dlls/d3d9/device.c
View file @
972217fd
...
...
@@ -1190,7 +1190,7 @@ static HRESULT WINAPI d3d9_device_GetRenderTarget(IDirect3DDevice9Ex *iface, DWO
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, idx %u, surface %p.
\n
"
,
iface
,
idx
,
surface
);
...
...
@@ -1204,18 +1204,15 @@ static HRESULT WINAPI d3d9_device_GetRenderTarget(IDirect3DDevice9Ex *iface, DWO
}
wined3d_mutex_lock
();
hr
=
wined3d_device_get_render_target
(
device
->
wined3d_device
,
idx
,
&
wined3d_surface
);
if
(
SUCCEEDED
(
hr
))
if
((
wined3d_surface
=
wined3d_device_get_render_target
(
device
->
wined3d_device
,
idx
)))
{
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
surface
=
&
surface_impl
->
IDirect3DSurface9_iface
;
IDirect3DSurface9_AddRef
(
*
surface
);
wined3d_surface_decref
(
wined3d_surface
);
}
else
{
if
(
hr
!=
WINED3DERR_NOTFOUND
)
WARN
(
"Failed to get render target %u, hr %#x.
\n
"
,
idx
,
hr
);
hr
=
WINED3DERR_NOTFOUND
;
*
surface
=
NULL
;
}
wined3d_mutex_unlock
();
...
...
dlls/ddraw/ddraw.c
View file @
972217fd
...
...
@@ -754,8 +754,8 @@ 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_stateblock
*
stateblock
;
struct
wined3d_surface
*
rt
,
*
ds
;
BOOL
restore_state
=
FALSE
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -932,12 +932,11 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
return
hr
;
}
wined3d_device_get_render_target
(
This
->
wined3d_device
,
0
,
&
rt
);
rt
=
wined3d_device_get_render_target
(
This
->
wined3d_device
,
0
);
if
(
rt
==
This
->
wined3d_frontbuffer
)
{
wined3d_surface_decref
(
rt
);
rt
=
NULL
;
}
else
if
(
rt
)
wined3d_surface_incref
(
rt
);
wined3d_device_get_depth_stencil
(
This
->
wined3d_device
,
&
ds
);
}
...
...
dlls/wined3d/device.c
View file @
972217fd
...
...
@@ -4479,27 +4479,18 @@ void CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
if
(
FAILED
(
hr
))
ERR
(
"Color fill failed, hr %#x.
\n
"
,
hr
);
}
HRESULT
CDECL
wined3d_device_get_render_target
(
const
struct
wined3d_device
*
device
,
UINT
render_target_idx
,
struct
wined3d_surface
**
render_target
)
struct
wined3d_surface
*
CDECL
wined3d_device_get_render_target
(
const
struct
wined3d_device
*
device
,
UINT
render_target_idx
)
{
TRACE
(
"device %p, render_target_idx %u, render_target %p.
\n
"
,
device
,
render_target_idx
,
render_target
);
TRACE
(
"device %p, render_target_idx %u.
\n
"
,
device
,
render_target_idx
);
if
(
render_target_idx
>=
device
->
adapter
->
gl_info
.
limits
.
buffers
)
{
WARN
(
"Only %u render targets are supported.
\n
"
,
device
->
adapter
->
gl_info
.
limits
.
buffers
);
return
WINED3DERR_INVALIDCA
LL
;
return
NU
LL
;
}
*
render_target
=
device
->
fb
.
render_targets
[
render_target_idx
];
TRACE
(
"Returning render target %p.
\n
"
,
*
render_target
);
if
(
!*
render_target
)
return
WINED3DERR_NOTFOUND
;
wined3d_surface_incref
(
*
render_target
);
return
WINED3D_OK
;
return
device
->
fb
.
render_targets
[
render_target_idx
];
}
HRESULT
CDECL
wined3d_device_get_depth_stencil
(
const
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/wined3d.spec
View file @
972217fd
...
...
@@ -76,7 +76,7 @@
@ cdecl wined3d_device_get_ps_consts_i(ptr long ptr long)
@ cdecl wined3d_device_get_raster_status(ptr long ptr)
@ cdecl wined3d_device_get_render_state(ptr long)
@ cdecl wined3d_device_get_render_target(ptr long
ptr
)
@ cdecl wined3d_device_get_render_target(ptr long)
@ cdecl wined3d_device_get_sampler_state(ptr long long)
@ cdecl wined3d_device_get_scissor_rect(ptr ptr)
@ cdecl wined3d_device_get_software_vertex_processing(ptr)
...
...
include/wine/wined3d.h
View file @
972217fd
...
...
@@ -2143,8 +2143,8 @@ HRESULT __cdecl wined3d_device_get_ps_consts_i(const struct wined3d_device *devi
HRESULT
__cdecl
wined3d_device_get_raster_status
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
struct
wined3d_raster_status
*
raster_status
);
DWORD
__cdecl
wined3d_device_get_render_state
(
const
struct
wined3d_device
*
device
,
enum
wined3d_render_state
state
);
HRESULT
__cdecl
wined3d_device_get_render_target
(
const
struct
wined3d_device
*
device
,
UINT
render_target_idx
,
struct
wined3d_surface
**
render_target
);
struct
wined3d_surface
*
__cdecl
wined3d_device_get_render_target
(
const
struct
wined3d_device
*
device
,
UINT
render_target_idx
);
DWORD
__cdecl
wined3d_device_get_sampler_state
(
const
struct
wined3d_device
*
device
,
UINT
sampler_idx
,
enum
wined3d_sampler_state
state
);
void
__cdecl
wined3d_device_get_scissor_rect
(
const
struct
wined3d_device
*
device
,
RECT
*
rect
);
...
...
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