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
99092e8a
Commit
99092e8a
authored
May 04, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
May 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Simplify reset_enum_callback().
Note that the existing code wouldn't work for volumes, since volumes aren't proper resources in d3d9.
parent
ef5a99d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
47 deletions
+21
-47
device.c
dlls/d3d9/device.c
+21
-47
No files found.
dlls/d3d9/device.c
View file @
99092e8a
...
@@ -540,61 +540,35 @@ static UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(IDirect3DDevice9Ex
...
@@ -540,61 +540,35 @@ static UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(IDirect3DDevice9Ex
static
HRESULT
WINAPI
reset_enum_callback
(
struct
wined3d_resource
*
resource
,
void
*
data
)
static
HRESULT
WINAPI
reset_enum_callback
(
struct
wined3d_resource
*
resource
,
void
*
data
)
{
{
struct
wined3d_resource_desc
desc
;
BOOL
*
resources_ok
=
data
;
BOOL
*
resources_ok
=
data
;
D3DRESOURCETYPE
type
;
HRESULT
ret
=
S_OK
;
D3DSURFACE_DESC
surface_desc
;
D3DVOLUME_DESC
volume_desc
;
D3DINDEXBUFFER_DESC
index_desc
;
D3DVERTEXBUFFER_DESC
vertex_desc
;
WINED3DPOOL
pool
;
IDirect3DResource9
*
parent
;
parent
=
wined3d_resource_get_parent
(
resource
);
type
=
IDirect3DResource9_GetType
(
parent
);
switch
(
type
)
{
case
D3DRTYPE_SURFACE
:
IDirect3DSurface9_GetDesc
((
IDirect3DSurface9
*
)
parent
,
&
surface_desc
);
pool
=
surface_desc
.
Pool
;
break
;
case
D3DRTYPE_VOLUME
:
IDirect3DVolume9_GetDesc
((
IDirect3DVolume9
*
)
parent
,
&
volume_desc
);
pool
=
volume_desc
.
Pool
;
break
;
case
D3DRTYPE_INDEXBUFFER
:
IDirect3DIndexBuffer9_GetDesc
((
IDirect3DIndexBuffer9
*
)
parent
,
&
index_desc
);
pool
=
index_desc
.
Pool
;
break
;
case
D3DRTYPE_VERTEXBUFFER
:
IDirect3DVertexBuffer9_GetDesc
((
IDirect3DVertexBuffer9
*
)
parent
,
&
vertex_desc
);
pool
=
vertex_desc
.
Pool
;
break
;
/* No need to check for textures. If there is a D3DPOOL_DEFAULT texture, there
* is a D3DPOOL_DEFAULT surface or volume as well
*/
default:
pool
=
WINED3DPOOL_SCRATCH
;
/* a harmless pool */
break
;
}
if
(
pool
==
WINED3DPOOL_DEFAULT
)
wined3d_resource_get_desc
(
resource
,
&
desc
);
if
(
desc
.
pool
==
WINED3DPOOL_DEFAULT
)
{
{
IDirect3DResource9_AddRef
(
parent
);
IDirect3DSurface9
*
surface
;
if
(
IUnknown_Release
(
parent
)
==
0
)
if
(
desc
.
resource_type
!=
WINED3DRTYPE_SURFACE
)
{
{
TRACE
(
"Parent %p is an implicit resource with ref 0
\n
"
,
parent
);
WARN
(
"Resource %p in pool D3DPOOL_DEFAULT blocks the Reset call.
\n
"
,
resource
);
}
else
{
WARN
(
"Resource %p(wineD3D %p) with pool D3DPOOL_DEFAULT blocks the Reset call
\n
"
,
parent
,
resource
);
ret
=
S_FALSE
;
*
resources_ok
=
FALSE
;
*
resources_ok
=
FALSE
;
return
S_FALSE
;
}
}
surface
=
wined3d_resource_get_parent
(
resource
);
IDirect3DSurface9_AddRef
(
surface
);
if
(
IDirect3DSurface9_Release
(
surface
))
{
WARN
(
"Surface %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.
\n
"
,
surface
,
resource
);
*
resources_ok
=
FALSE
;
return
S_FALSE
;
}
WARN
(
"Surface %p (resource %p) is an implicit resource with ref 0.
\n
"
,
surface
,
resource
);
}
}
return
ret
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
DECLSPEC_HOTPATCH
IDirect3DDevice9Impl_Reset
(
IDirect3DDevice9Ex
*
iface
,
static
HRESULT
WINAPI
DECLSPEC_HOTPATCH
IDirect3DDevice9Impl_Reset
(
IDirect3DDevice9Ex
*
iface
,
...
...
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