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
5ff12375
Commit
5ff12375
authored
Aug 22, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Free volume sysmem after upload.
parent
a89f2e63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
volume.c
dlls/wined3d/volume.c
+30
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/volume.c
View file @
5ff12375
...
...
@@ -113,6 +113,26 @@ static void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DW
}
/* Context activation is done by the caller. */
static
void
wined3d_volume_download_data
(
struct
wined3d_volume
*
volume
,
const
struct
wined3d_context
*
context
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_format
*
format
=
volume
->
resource
.
format
;
gl_info
->
gl_ops
.
gl
.
p_glGetTexImage
(
GL_TEXTURE_3D
,
volume
->
texture_level
,
format
->
glFormat
,
format
->
glType
,
volume
->
resource
.
allocatedMemory
);
checkGLcall
(
"glGetTexImage"
);
}
static
void
wined3d_volume_evict_sysmem
(
struct
wined3d_volume
*
volume
)
{
wined3d_resource_free_sysmem
(
volume
->
resource
.
heap_memory
);
volume
->
resource
.
heap_memory
=
NULL
;
volume
->
resource
.
allocatedMemory
=
NULL
;
wined3d_volume_invalidate_location
(
volume
,
WINED3D_LOCATION_SYSMEM
);
}
/* Context activation is done by the caller. */
static
void
wined3d_volume_load_location
(
struct
wined3d_volume
*
volume
,
struct
wined3d_context
*
context
,
DWORD
location
)
{
...
...
@@ -160,6 +180,10 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
return
;
}
wined3d_volume_validate_location
(
volume
,
WINED3D_LOCATION_TEXTURE_RGB
);
if
(
volume
->
resource
.
pool
==
WINED3D_POOL_MANAGED
&&
volume
->
download_count
<
10
)
wined3d_volume_evict_sysmem
(
volume
);
break
;
case
WINED3D_LOCATION_SYSMEM
:
...
...
@@ -174,6 +198,12 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
TRACE
(
"Volume previously discarded, nothing to do.
\n
"
);
wined3d_volume_invalidate_location
(
volume
,
WINED3D_LOCATION_DISCARDED
);
}
else
if
(
volume
->
locations
&
WINED3D_LOCATION_TEXTURE_RGB
)
{
volume_bind_and_dirtify
(
volume
,
context
);
volume
->
download_count
++
;
wined3d_volume_download_data
(
volume
,
context
);
}
else
{
FIXME
(
"Implement WINED3D_LOCATION_SYSMEM loading from %s.
\n
"
,
...
...
dlls/wined3d/wined3d_private.h
View file @
5ff12375
...
...
@@ -2067,6 +2067,7 @@ struct wined3d_volume
DWORD
flags
,
locations
;
GLint
texture_level
;
DWORD
download_count
;
};
static
inline
struct
wined3d_volume
*
volume_from_resource
(
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