Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
73560971
Commit
73560971
authored
Sep 30, 2018
by
Andrew Wesie
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use glReadPixels for RT texture download.
Signed-off-by:
Andrew Wesie
<
awesie@gmail.com
>
parent
2c852f69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
texture.c
dlls/wined3d/texture.c
+19
-0
No files found.
dlls/wined3d/texture.c
View file @
73560971
...
...
@@ -2928,6 +2928,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context,
struct
wined3d_bo
*
dst_bo
;
BOOL
srgb
=
FALSE
;
GLenum
target
;
struct
wined3d_texture_sub_resource
*
sub_resource
;
TRACE
(
"context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_box %s, dst_bo_addr %s, "
"dst_format %s, dst_x %u, dst_y %u, dst_z %u, dst_row_pitch %u, dst_slice_pitch %u.
\n
"
,
...
...
@@ -2982,6 +2983,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context,
format_gl
=
wined3d_format_gl
(
src_texture
->
resource
.
format
);
target
=
wined3d_texture_gl_get_sub_resource_target
(
src_texture_gl
,
src_sub_resource_idx
);
sub_resource
=
&
src_texture
->
sub_resources
[
src_sub_resource_idx
];
if
((
src_texture
->
resource
.
type
==
WINED3D_RTYPE_TEXTURE_2D
&&
(
target
==
GL_TEXTURE_2D_ARRAY
||
format_gl
->
f
.
conv_byte_count
...
...
@@ -3020,6 +3022,23 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context,
GL_EXTCALL
(
glGetCompressedTexImage
(
target
,
src_level
,
offset
));
checkGLcall
(
"glGetCompressedTexImage"
);
}
else
if
(
dst_bo_addr
->
buffer_object
&&
src_texture
->
resource
.
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
{
/* PBO texture download is not accelerated on Mesa. Use glReadPixels if possible. */
TRACE
(
"Downloading (glReadPixels) texture %p, %u, level %u, format %#x, type %#x, data %p.
\n
"
,
src_texture
,
src_sub_resource_idx
,
src_level
,
format_gl
->
format
,
format_gl
->
type
,
dst_bo_addr
->
addr
);
wined3d_context_gl_apply_fbo_state_blit
(
context_gl
,
GL_READ_FRAMEBUFFER
,
&
src_texture
->
resource
,
src_sub_resource_idx
,
NULL
,
0
,
sub_resource
->
locations
&
(
WINED3D_LOCATION_TEXTURE_RGB
|
WINED3D_LOCATION_TEXTURE_SRGB
));
wined3d_context_gl_check_fbo_status
(
context_gl
,
GL_READ_FRAMEBUFFER
);
context_invalidate_state
(
context
,
STATE_FRAMEBUFFER
);
gl_info
->
gl_ops
.
gl
.
p_glReadBuffer
(
GL_COLOR_ATTACHMENT0
);
checkGLcall
(
"glReadBuffer()"
);
gl_info
->
gl_ops
.
gl
.
p_glReadPixels
(
0
,
0
,
wined3d_texture_get_level_width
(
src_texture
,
src_level
),
wined3d_texture_get_level_height
(
src_texture
,
src_level
),
format_gl
->
format
,
format_gl
->
type
,
dst_bo_addr
->
addr
);
checkGLcall
(
"glReadPixels"
);
}
else
{
TRACE
(
"Downloading texture %p, %u, level %u, format %#x, type %#x, data %p.
\n
"
,
...
...
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