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
40d59088
Commit
40d59088
authored
Mar 08, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a texture and sub-resource index to read_from_framebuffer().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c337a463
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
surface.c
dlls/wined3d/surface.c
+16
-14
No files found.
dlls/wined3d/surface.c
View file @
40d59088
...
...
@@ -1346,18 +1346,16 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr
return
dst_texture
;
}
static
void
read_from_framebuffer
(
struct
wined3d_surface
*
surface
,
struct
wined3d_context
*
old_ctx
,
DWORD
src_location
,
DWORD
dst_location
)
static
void
texture2d_read_from_framebuffer
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
,
DWORD
src_location
,
DWORD
dst_location
)
{
unsigned
int
sub_resource_idx
=
surface_get_sub_resource_idx
(
surface
);
struct
wined3d_texture
*
texture
=
surface
->
container
;
struct
wined3d_device
*
device
=
texture
->
resource
.
device
;
struct
wined3d_context
*
context
=
old_ctx
;
struct
wined3d_surface
*
restore_rt
=
NULL
;
struct
wined3d_texture
*
restore_texture
;
const
struct
wined3d_gl_info
*
gl_info
;
unsigned
int
row_pitch
,
slice_pitch
;
unsigned
int
width
,
height
,
level
;
struct
wined3d_bo_address
data
;
unsigned
int
restore_idx
;
BYTE
*
row
,
*
top
,
*
bottom
;
BOOL
src_is_upside_down
;
unsigned
int
i
;
...
...
@@ -1365,16 +1363,18 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
wined3d_texture_get_memory
(
texture
,
sub_resource_idx
,
&
data
,
dst_location
);
restore_rt
=
context_get_rt_surface
(
old_ctx
);
if
(
restore_rt
!=
surface
)
restore_texture
=
context
->
current_rt
.
texture
;
restore_idx
=
context
->
current_rt
.
sub_resource_idx
;
if
(
restore_texture
!=
texture
||
restore_idx
!=
sub_resource_idx
)
context
=
context_acquire
(
device
,
texture
,
sub_resource_idx
);
else
restore_
rt
=
NULL
;
restore_
texture
=
NULL
;
gl_info
=
context
->
gl_info
;
if
(
src_location
!=
texture
->
resource
.
draw_binding
)
{
context_apply_fbo_state_blit
(
context
,
GL_READ_FRAMEBUFFER
,
surface
,
NULL
,
src_location
);
context_apply_fbo_state_blit
(
context
,
GL_READ_FRAMEBUFFER
,
texture
->
sub_resources
[
sub_resource_idx
].
u
.
surface
,
NULL
,
src_location
);
context_check_fbo_status
(
context
,
GL_READ_FRAMEBUFFER
);
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
);
}
...
...
@@ -1468,8 +1468,8 @@ error:
checkGLcall
(
"glBindBuffer"
);
}
if
(
restore_
rt
)
context_restore
(
context
,
restore_
rt
);
if
(
restore_
texture
)
context_restore
(
context
,
restore_
texture
->
sub_resources
[
restore_idx
].
u
.
surface
);
}
/* Read the framebuffer contents into a texture. Note that this function
...
...
@@ -2080,7 +2080,8 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res
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
(
sub_resource
->
u
.
surface
,
context
,
WINED3D_LOCATION_RB_RESOLVED
,
dst_location
);
texture2d_read_from_framebuffer
(
texture
,
sub_resource_idx
,
context
,
WINED3D_LOCATION_RB_RESOLVED
,
dst_location
);
return
TRUE
;
}
else
...
...
@@ -2103,7 +2104,8 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res
if
(
!
(
texture
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
&&
(
sub_resource
->
locations
&
WINED3D_LOCATION_DRAWABLE
))
{
read_from_framebuffer
(
sub_resource
->
u
.
surface
,
context
,
texture
->
resource
.
draw_binding
,
dst_location
);
texture2d_read_from_framebuffer
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
draw_binding
,
dst_location
);
return
TRUE
;
}
...
...
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