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
e2c0bc63
Commit
e2c0bc63
authored
Jan 13, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Start to split up surface_prepare_system_memory.
parent
676a7f21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
11 deletions
+28
-11
surface.c
dlls/wined3d/surface.c
+26
-9
texture.c
dlls/wined3d/texture.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/surface.c
View file @
e2c0bc63
...
...
@@ -589,7 +589,7 @@ static void surface_create_pbo(struct wined3d_surface *surface, const struct win
context_release
(
context
);
}
void
surface_prepare_system_memory
(
struct
wined3d_surface
*
surface
)
static
void
surface_prepare_system_memory
(
struct
wined3d_surface
*
surface
)
{
const
struct
wined3d_gl_info
*
gl_info
=
&
surface
->
resource
.
device
->
adapter
->
gl_info
;
...
...
@@ -597,8 +597,7 @@ void surface_prepare_system_memory(struct wined3d_surface *surface)
if
(
!
(
surface
->
flags
&
SFLAG_PBO
)
&&
surface_need_pbo
(
surface
,
gl_info
))
surface_create_pbo
(
surface
,
gl_info
);
else
if
(
!
(
surface
->
resource
.
allocatedMemory
||
surface
->
flags
&
SFLAG_PBO
||
surface
->
user_memory
))
else
if
(
!
(
surface
->
resource
.
allocatedMemory
||
surface
->
flags
&
SFLAG_PBO
))
{
/* Whatever surface we have, make sure that there is memory allocated
* for the downloaded copy, or a PBO to map. */
...
...
@@ -611,6 +610,24 @@ void surface_prepare_system_memory(struct wined3d_surface *surface)
}
}
void
surface_prepare_map_memory
(
struct
wined3d_surface
*
surface
)
{
switch
(
surface
->
map_binding
)
{
case
SFLAG_INUSERMEM
:
if
(
!
surface
->
user_memory
)
ERR
(
"Map binding is set to SFLAG_INUSERMEM but surface->user_memory is NULL.
\n
"
);
break
;
case
SFLAG_INSYSMEM
:
surface_prepare_system_memory
(
surface
);
break
;
default:
ERR
(
"Unexpected map binding %s.
\n
"
,
debug_surflocation
(
surface
->
map_binding
));
}
}
static
void
surface_evict_sysmem
(
struct
wined3d_surface
*
surface
)
{
if
(
surface
->
resource
.
map_count
||
(
surface
->
flags
&
SFLAG_DONOTFREE
)
...
...
@@ -767,7 +784,7 @@ static void surface_realize_palette(struct wined3d_surface *surface)
if
(
!
(
surface
->
flags
&
surface
->
map_binding
))
{
TRACE
(
"Palette changed with surface that does not have an up to date system memory copy.
\n
"
);
surface_prepare_
system
_memory
(
surface
);
surface_prepare_
map
_memory
(
surface
);
surface_load_location
(
surface
,
surface
->
map_binding
);
}
surface_invalidate_location
(
surface
,
~
surface
->
map_binding
);
...
...
@@ -803,7 +820,7 @@ static BYTE *surface_map(struct wined3d_surface *surface, const RECT *rect, DWOR
TRACE
(
"surface %p, rect %s, flags %#x.
\n
"
,
surface
,
wine_dbgstr_rect
(
rect
),
flags
);
surface_prepare_
system
_memory
(
surface
);
surface_prepare_
map
_memory
(
surface
);
if
(
flags
&
WINED3D_MAP_DISCARD
)
{
TRACE
(
"WINED3D_MAP_DISCARD flag passed, marking SYSMEM as up to date.
\n
"
);
...
...
@@ -1392,7 +1409,7 @@ static void surface_unload(struct wined3d_resource *resource)
}
else
{
surface_prepare_
system
_memory
(
surface
);
surface_prepare_
map
_memory
(
surface
);
surface_load_location
(
surface
,
surface
->
map_binding
);
}
surface_invalidate_location
(
surface
,
~
surface
->
map_binding
);
...
...
@@ -2323,7 +2340,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb)
/* To perform the color key conversion we need a sysmem copy of
* the surface. Make sure we have it. */
surface_prepare_
system
_memory
(
surface
);
surface_prepare_
map
_memory
(
surface
);
surface_load_location
(
surface
,
surface
->
map_binding
);
surface_invalidate_location
(
surface
,
~
surface
->
map_binding
);
/* Switching color keying on / off may change the internal format. */
...
...
@@ -5024,7 +5041,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
{
/* Performance warning... */
FIXME
(
"Downloading RGB surface %p to reload it as sRGB.
\n
"
,
surface
);
surface_prepare_
system
_memory
(
surface
);
surface_prepare_
map
_memory
(
surface
);
surface_load_location
(
surface
,
surface
->
map_binding
);
}
}
...
...
@@ -5034,7 +5051,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
{
/* Performance warning... */
FIXME
(
"Downloading sRGB surface %p to reload it as RGB.
\n
"
,
surface
);
surface_prepare_
system
_memory
(
surface
);
surface_prepare_
map
_memory
(
surface
);
surface_load_location
(
surface
,
surface
->
map_binding
);
}
}
...
...
dlls/wined3d/texture.c
View file @
e2c0bc63
...
...
@@ -735,7 +735,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
{
struct
wined3d_surface
*
surface
=
surface_from_resource
(
sub_resource
);
surface_prepare_
system
_memory
(
surface
);
surface_prepare_
map
_memory
(
surface
);
surface_load_location
(
surface
,
surface
->
map_binding
);
surface_invalidate_location
(
surface
,
~
surface
->
map_binding
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
e2c0bc63
...
...
@@ -2273,7 +2273,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void
surface_validate_location
(
struct
wined3d_surface
*
surface
,
DWORD
location
)
DECLSPEC_HIDDEN
;
HRESULT
CDECL
wined3d_surface_create
(
struct
wined3d_texture
*
container
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
flags
,
struct
wined3d_surface
**
surface
)
DECLSPEC_HIDDEN
;
void
surface_prepare_
system
_memory
(
struct
wined3d_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
surface_prepare_
map
_memory
(
struct
wined3d_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
get_drawable_size_swapchain
(
const
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
void
get_drawable_size_backbuffer
(
const
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
...
...
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