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
c5459881
Commit
c5459881
authored
Oct 09, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Track SFLAG_DYNLOCK per-texture.
parent
d6a511e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
surface.c
dlls/wined3d/surface.c
+11
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/surface.c
View file @
c5459881
...
...
@@ -589,11 +589,11 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
{
/* In some conditions the surface memory must not be freed:
* WINED3D_TEXTURE_CONVERTED: Converting the data back would take too long
*
SFLAG_DYNLOCK
: Avoid freeing the data for performance
*
WINED3D_TEXTURE_DYNAMIC_MAP
: Avoid freeing the data for performance
* SFLAG_CLIENT: OpenGL uses our memory as backup */
if
(
surface
->
resource
.
map_count
||
surface
->
flags
&
(
SFLAG_DYNLOCK
|
SFLAG_CLIENT
)
|
|
surface
->
container
->
flags
&
(
WINED3D_TEXTURE_CONVERTED
|
WINED3D_TEXTURE_PIN_SYSMEM
))
if
(
surface
->
resource
.
map_count
||
surface
->
flags
&
SFLAG_CLIENT
||
surface
->
container
->
flags
&
(
WINED3D_TEXTURE_CONVERTED
|
WINED3D_TEXTURE_PIN_SYSMEM
|
WINED3D_TEXTURE_DYNAMIC_MAP
))
return
;
wined3d_resource_free_sysmem
(
&
surface
->
resource
);
...
...
@@ -1450,8 +1450,8 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
* get a boxed texture with width pow2width and not a texture of width resource.width.
*
* Performance should not be an issue, because applications normally do not lock the surfaces when
* rendering. If an app does, the
SFLAG_DYNLOCK flag will kick in and the memory copy won't be released,
* and doesn't have to be re-read. */
* rendering. If an app does, the
WINED3D_TEXTURE_DYNAMIC_MAP flag will kick in and the memory copy
*
won't be released,
and doesn't have to be re-read. */
src_data
=
mem
;
dst_data
=
data
.
addr
;
TRACE
(
"(%p) : Repacking the surface data from pitch %d to pitch %d
\n
"
,
surface
,
src_pitch
,
dst_pitch
);
...
...
@@ -2617,13 +2617,15 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
/* Performance optimization: Count how often a surface is mapped, if it is
* mapped regularly do not throw away the system memory copy. This avoids
* the need to download the surface from OpenGL all the time. The surface
* is still downloaded if the OpenGL texture is changed. */
if
(
!
(
surface
->
flags
&
SFLAG_DYNLOCK
)
&&
surface
->
resource
.
map_binding
==
WINED3D_LOCATION_SYSMEM
)
* is still downloaded if the OpenGL texture is changed. Note that this
* only really makes sense for managed textures.*/
if
(
!
(
surface
->
container
->
flags
&
WINED3D_TEXTURE_DYNAMIC_MAP
)
&&
surface
->
resource
.
map_binding
==
WINED3D_LOCATION_SYSMEM
)
{
if
(
++
surface
->
lockCount
>
MAXLOCKCOUNT
)
{
TRACE
(
"Surface is mapped regularly, not freeing the system memory copy any more.
\n
"
);
surface
->
flags
|=
SFLAG_DYNLOCK
;
surface
->
container
->
flags
|=
WINED3D_TEXTURE_DYNAMIC_MAP
;
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
c5459881
...
...
@@ -2130,6 +2130,7 @@ struct wined3d_texture_ops
#define WINED3D_TEXTURE_SRGB_VALID 0x00000040
#define WINED3D_TEXTURE_CONVERTED 0x00000080
#define WINED3D_TEXTURE_PIN_SYSMEM 0x00000100
#define WINED3D_TEXTURE_DYNAMIC_MAP 0x00000200
struct
wined3d_texture
{
...
...
@@ -2351,11 +2352,10 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#define SFLAG_DISCARD 0x00000002
/* ??? */
#define SFLAG_NONPOW2 0x00000004
/* Surface sizes are not a power of 2 */
#define SFLAG_NORMCOORD 0x00000008
/* Set if GL texture coordinates are normalized (non-texture rectangle). */
#define SFLAG_
DYNLOCK 0x00000010
/* Surface is often locked by the application
. */
#define SFLAG_
GLCKEY 0x00000010
/* The GL texture was created with a color key
. */
#define SFLAG_CLIENT 0x00000020
/* GL_APPLE_client_storage is used with this surface. */
#define SFLAG_DCINUSE 0x00000040
/* Set between GetDC and ReleaseDC calls. */
#define SFLAG_LOST 0x00000080
/* Surface lost flag for ddraw. */
#define SFLAG_GLCKEY 0x00000100
/* The GL texture was created with a color key. */
struct
wined3d_sampler
{
...
...
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