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
3b47e108
Commit
3b47e108
authored
Mar 06, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a texture and sub-resource index to surface_load_sysmem().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c1f5b9ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
surface.c
dlls/wined3d/surface.c
+7
-9
texture.c
dlls/wined3d/texture.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-2
No files found.
dlls/wined3d/surface.c
View file @
3b47e108
...
...
@@ -2060,12 +2060,10 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
}
/* Context activation is done by the caller. */
BOOL
surface_load_sysmem
(
struct
wined3d_surface
*
surface
,
BOOL
texture2d_load_sysmem
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
,
DWORD
dst_location
)
{
unsigned
int
sub_resource_idx
=
surface_get_sub_resource_idx
(
surface
);
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
wined3d_texture
*
texture
=
surface
->
container
;
struct
wined3d_texture_sub_resource
*
sub_resource
;
sub_resource
=
&
texture
->
sub_resources
[
sub_resource_idx
];
...
...
@@ -2075,7 +2073,7 @@ BOOL surface_load_sysmem(struct wined3d_surface *surface,
if
(
is_multisample_location
(
texture
,
WINED3D_LOCATION_TEXTURE_RGB
))
{
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
WINED3D_LOCATION_RB_RESOLVED
);
read_from_framebuffer
(
surface
,
context
,
WINED3D_LOCATION_RB_RESOLVED
,
dst_location
);
read_from_framebuffer
(
su
b_resource
->
u
.
su
rface
,
context
,
WINED3D_LOCATION_RB_RESOLVED
,
dst_location
);
return
TRUE
;
}
else
...
...
@@ -2083,12 +2081,12 @@ BOOL surface_load_sysmem(struct wined3d_surface *surface,
if
(
sub_resource
->
locations
&
(
WINED3D_LOCATION_RB_MULTISAMPLE
|
WINED3D_LOCATION_RB_RESOLVED
))
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
WINED3D_LOCATION_TEXTURE_RGB
);
/* Download the su
rfa
ce to system memory. */
/* Download the su
b-resour
ce to system memory. */
if
(
sub_resource
->
locations
&
(
WINED3D_LOCATION_TEXTURE_RGB
|
WINED3D_LOCATION_TEXTURE_SRGB
))
{
wined3d_texture_bind_and_dirtify
(
texture
,
context
,
!
(
sub_resource
->
locations
&
WINED3D_LOCATION_TEXTURE_RGB
));
surface_download_data
(
surface
,
gl_info
,
dst_location
);
surface_download_data
(
su
b_resource
->
u
.
su
rface
,
gl_info
,
dst_location
);
++
texture
->
download_count
;
return
TRUE
;
...
...
@@ -2098,12 +2096,12 @@ BOOL surface_load_sysmem(struct wined3d_surface *surface,
if
(
!
(
texture
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
&&
(
sub_resource
->
locations
&
WINED3D_LOCATION_DRAWABLE
))
{
read_from_framebuffer
(
surface
,
context
,
texture
->
resource
.
draw_binding
,
dst_location
);
read_from_framebuffer
(
su
b_resource
->
u
.
su
rface
,
context
,
texture
->
resource
.
draw_binding
,
dst_location
);
return
TRUE
;
}
FIXME
(
"Can't load
surface %p
with location flags %s into sysmem.
\n
"
,
surface
,
wined3d_debug_location
(
sub_resource
->
locations
));
FIXME
(
"Can't load
texture %p, %u
with location flags %s into sysmem.
\n
"
,
texture
,
sub_resource_idx
,
wined3d_debug_location
(
sub_resource
->
locations
));
return
FALSE
;
}
...
...
dlls/wined3d/texture.c
View file @
3b47e108
...
...
@@ -1803,7 +1803,7 @@ static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned in
case
WINED3D_LOCATION_USER_MEMORY
:
case
WINED3D_LOCATION_SYSMEM
:
case
WINED3D_LOCATION_BUFFER
:
return
surface_load_sysmem
(
surface
,
context
,
location
);
return
texture2d_load_sysmem
(
texture
,
sub_resource_idx
,
context
,
location
);
case
WINED3D_LOCATION_DRAWABLE
:
return
surface_load_drawable
(
surface
,
context
);
...
...
dlls/wined3d/wined3d_private.h
View file @
3b47e108
...
...
@@ -3234,6 +3234,9 @@ static inline unsigned int wined3d_texture_get_level_pow2_height(const struct wi
return
max
(
1
,
texture
->
pow2_height
>>
level
);
}
BOOL
texture2d_load_sysmem
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
,
DWORD
dst_location
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_apply_sampler_desc
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_sampler_desc
*
sampler_desc
,
const
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_bind
(
struct
wined3d_texture
*
texture
,
...
...
@@ -3343,8 +3346,6 @@ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
BOOL
surface_load_renderbuffer
(
struct
wined3d_surface
*
surface
,
struct
wined3d_context
*
context
,
DWORD
dst_location
)
DECLSPEC_HIDDEN
;
BOOL
surface_load_sysmem
(
struct
wined3d_surface
*
surface
,
struct
wined3d_context
*
context
,
DWORD
dst_location
)
DECLSPEC_HIDDEN
;
BOOL
surface_load_texture
(
struct
wined3d_surface
*
surface
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_surface_upload_data
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
...
...
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