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
9cdcc3e1
Commit
9cdcc3e1
authored
Apr 18, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge surface_unload() and volume_unload().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
16ff4e7c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
80 deletions
+50
-80
device.c
dlls/wined3d/device.c
+6
-2
surface.c
dlls/wined3d/surface.c
+1
-43
texture.c
dlls/wined3d/texture.c
+42
-9
volume.c
dlls/wined3d/volume.c
+1
-26
No files found.
dlls/wined3d/device.c
View file @
9cdcc3e1
...
...
@@ -1138,8 +1138,10 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
/* Unload resources */
LIST_FOR_EACH_ENTRY_SAFE
(
resource
,
cursor
,
&
device
->
resources
,
struct
wined3d_resource
,
resource_list_entry
)
{
TRACE
(
"Unloading resource %p.
\n
"
,
resource
);
if
(
resource
->
type
==
WINED3D_RTYPE_SURFACE
||
resource
->
type
==
WINED3D_RTYPE_VOLUME
)
continue
;
TRACE
(
"Unloading resource %p.
\n
"
,
resource
);
resource
->
resource_ops
->
resource_unload
(
resource
);
}
...
...
@@ -4532,8 +4534,10 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
LIST_FOR_EACH_ENTRY_SAFE
(
resource
,
cursor
,
&
device
->
resources
,
struct
wined3d_resource
,
resource_list_entry
)
{
TRACE
(
"Unloading resource %p.
\n
"
,
resource
);
if
(
resource
->
type
==
WINED3D_RTYPE_SURFACE
||
resource
->
type
==
WINED3D_RTYPE_VOLUME
)
continue
;
TRACE
(
"Unloading resource %p.
\n
"
,
resource
);
resource
->
resource_ops
->
resource_unload
(
resource
);
}
...
...
dlls/wined3d/surface.c
View file @
9cdcc3e1
...
...
@@ -845,49 +845,7 @@ static ULONG surface_resource_decref(struct wined3d_resource *resource)
static
void
surface_unload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_surface
*
surface
=
surface_from_resource
(
resource
);
unsigned
int
sub_resource_idx
=
surface_get_sub_resource_idx
(
surface
);
struct
wined3d_texture
*
texture
=
surface
->
container
;
struct
wined3d_renderbuffer_entry
*
entry
,
*
entry2
;
struct
wined3d_device
*
device
=
resource
->
device
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
TRACE
(
"surface %p.
\n
"
,
surface
);
context
=
context_acquire
(
device
,
NULL
);
gl_info
=
context
->
gl_info
;
if
(
resource
->
pool
==
WINED3D_POOL_DEFAULT
)
{
/* We should only get here on device reset/teardown for implicit
* resources. */
wined3d_texture_validate_location
(
texture
,
sub_resource_idx
,
WINED3D_LOCATION_DISCARDED
);
wined3d_texture_invalidate_location
(
texture
,
sub_resource_idx
,
~
WINED3D_LOCATION_DISCARDED
);
}
else
{
surface_load_location
(
surface
,
context
,
texture
->
resource
.
map_binding
);
wined3d_texture_invalidate_location
(
texture
,
sub_resource_idx
,
~
texture
->
resource
.
map_binding
);
}
/* Destroy fbo render buffers. This is needed for implicit render targets, for
* all application-created targets the application has to release the surface
* before calling _Reset
*/
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
surface
->
renderbuffers
,
struct
wined3d_renderbuffer_entry
,
entry
)
{
context_gl_resource_released
(
device
,
entry
->
id
,
TRUE
);
gl_info
->
fbo_ops
.
glDeleteRenderbuffers
(
1
,
&
entry
->
id
);
list_remove
(
&
entry
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
}
list_init
(
&
surface
->
renderbuffers
);
surface
->
current_renderbuffer
=
NULL
;
context_release
(
context
);
resource_unload
(
resource
);
ERR
(
"Not supported on sub-resources.
\n
"
);
}
static
HRESULT
surface_resource_sub_resource_map
(
struct
wined3d_resource
*
resource
,
unsigned
int
sub_resource_idx
,
...
...
dlls/wined3d/texture.c
View file @
9cdcc3e1
...
...
@@ -1358,26 +1358,59 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
{
struct
wined3d_texture
*
texture
=
wined3d_texture_from_resource
(
resource
);
UINT
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
struct
wined3d_context
*
context
=
NULL
;
struct
wined3d_device
*
device
=
resource
->
device
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
UINT
i
;
TRACE
(
"texture %p.
\n
"
,
texture
);
context
=
context_acquire
(
device
,
NULL
);
gl_info
=
context
->
gl_info
;
for
(
i
=
0
;
i
<
sub_count
;
++
i
)
{
struct
wined3d_resource
*
sub_resource
=
texture
->
sub_resources
[
i
].
resource
;
sub_resource
->
resource_ops
->
resource_unload
(
sub_resource
);
struct
wined3d_texture_sub_resource
*
sub_resource
=
&
texture
->
sub_resources
[
i
];
if
(
texture
->
sub_resources
[
i
].
buffer_object
)
if
(
resource
->
pool
!=
WINED3D_POOL_DEFAULT
&&
texture
->
texture_ops
->
texture_load_location
(
texture
,
i
,
context
,
resource
->
map_binding
))
{
if
(
!
context
)
context
=
context_acquire
(
texture
->
resource
.
device
,
NULL
);
wined3d_texture_invalidate_location
(
texture
,
i
,
~
resource
->
map_binding
);
}
else
{
/* We should only get here on device reset/teardown for implicit
* resources. */
if
(
resource
->
pool
!=
WINED3D_POOL_DEFAULT
||
resource
->
type
!=
WINED3D_RTYPE_TEXTURE_2D
)
ERR
(
"Discarding %s %p sub-resource %u in the %s pool.
\n
"
,
debug_d3dresourcetype
(
resource
->
type
),
resource
,
i
,
debug_d3dpool
(
resource
->
pool
));
wined3d_texture_validate_location
(
texture
,
i
,
WINED3D_LOCATION_DISCARDED
);
wined3d_texture_invalidate_location
(
texture
,
i
,
~
WINED3D_LOCATION_DISCARDED
);
}
if
(
sub_resource
->
buffer_object
)
wined3d_texture_remove_buffer_object
(
texture
,
i
,
context
->
gl_info
);
if
(
resource
->
type
==
WINED3D_RTYPE_TEXTURE_2D
)
{
struct
wined3d_surface
*
surface
=
sub_resource
->
u
.
surface
;
struct
wined3d_renderbuffer_entry
*
entry
,
*
entry2
;
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
surface
->
renderbuffers
,
struct
wined3d_renderbuffer_entry
,
entry
)
{
context_gl_resource_released
(
device
,
entry
->
id
,
TRUE
);
gl_info
->
fbo_ops
.
glDeleteRenderbuffers
(
1
,
&
entry
->
id
);
list_remove
(
&
entry
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
}
list_init
(
&
surface
->
renderbuffers
);
surface
->
current_renderbuffer
=
NULL
;
}
resource_unload
(
sub_resource
->
resource
);
}
if
(
context
)
context_release
(
context
);
context_release
(
context
);
wined3d_texture_force_reload
(
texture
);
wined3d_texture_unload_gl_texture
(
texture
);
...
...
dlls/wined3d/volume.c
View file @
9cdcc3e1
...
...
@@ -366,32 +366,7 @@ void wined3d_volume_cleanup(struct wined3d_volume *volume)
static
void
volume_unload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_volume
*
volume
=
volume_from_resource
(
resource
);
struct
wined3d_texture
*
texture
=
volume
->
container
;
struct
wined3d_device
*
device
=
texture
->
resource
.
device
;
struct
wined3d_context
*
context
;
if
(
texture
->
resource
.
pool
==
WINED3D_POOL_DEFAULT
)
ERR
(
"Unloading DEFAULT pool volume.
\n
"
);
TRACE
(
"texture %p.
\n
"
,
resource
);
context
=
context_acquire
(
device
,
NULL
);
if
(
wined3d_volume_load_location
(
volume
,
context
,
WINED3D_LOCATION_SYSMEM
))
{
wined3d_texture_invalidate_location
(
texture
,
volume
->
texture_level
,
~
WINED3D_LOCATION_SYSMEM
);
}
else
{
ERR
(
"Out of memory when unloading volume %p.
\n
"
,
volume
);
wined3d_texture_validate_location
(
texture
,
volume
->
texture_level
,
WINED3D_LOCATION_DISCARDED
);
wined3d_texture_invalidate_location
(
texture
,
volume
->
texture_level
,
~
WINED3D_LOCATION_DISCARDED
);
}
context_release
(
context
);
/* The texture name is managed by the container. */
resource_unload
(
resource
);
ERR
(
"Not supported on sub-resources.
\n
"
);
}
static
ULONG
volume_resource_incref
(
struct
wined3d_resource
*
resource
)
...
...
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