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
92008ec4
Commit
92008ec4
authored
Mar 07, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a texture and sub-resource index to surface_load_texture().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
42a9563e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
20 deletions
+17
-20
surface.c
dlls/wined3d/surface.c
+14
-14
texture.c
dlls/wined3d/texture.c
+1
-4
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/surface.c
View file @
92008ec4
...
...
@@ -2153,13 +2153,11 @@ BOOL texture2d_load_drawable(struct wined3d_texture *texture,
return
TRUE
;
}
BOOL
surface_load_texture
(
struct
wined3d_surface
*
surface
,
BOOL
texture2d_load_texture
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
unsigned
int
width
,
height
,
level
,
src_row_pitch
,
src_slice_pitch
,
dst_row_pitch
,
dst_slice_pitch
;
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_device
*
device
=
texture
->
resource
.
device
;
const
struct
wined3d_color_key_conversion
*
conversion
;
struct
wined3d_texture_sub_resource
*
sub_resource
;
...
...
@@ -2171,13 +2169,13 @@ BOOL surface_load_texture(struct wined3d_surface *surface,
BOOL
depth
;
depth
=
texture
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
;
sub_resource
=
surface_get_sub_resource
(
surface
)
;
sub_resource
=
&
texture
->
sub_resources
[
sub_resource_idx
]
;
if
(
!
depth
&&
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
&&
wined3d_resource_is_offscreen
(
&
texture
->
resource
)
&&
(
sub_resource
->
locations
&
WINED3D_LOCATION_DRAWABLE
))
{
surface_load_fb_texture
(
surface
,
srgb
,
context
);
surface_load_fb_texture
(
su
b_resource
->
u
.
su
rface
,
srgb
,
context
);
return
TRUE
;
}
...
...
@@ -2194,11 +2192,13 @@ BOOL surface_load_texture(struct wined3d_surface *surface,
&
texture
->
resource
,
WINED3D_LOCATION_TEXTURE_SRGB
))
{
if
(
srgb
)
surface_blt_fbo
(
device
,
context
,
WINED3D_TEXF_POINT
,
surface
,
WINED3D_LOCATION_TEXTURE_RGB
,
&
src_rect
,
surface
,
WINED3D_LOCATION_TEXTURE_SRGB
,
&
src_rect
);
surface_blt_fbo
(
device
,
context
,
WINED3D_TEXF_POINT
,
sub_resource
->
u
.
surface
,
WINED3D_LOCATION_TEXTURE_RGB
,
&
src_rect
,
sub_resource
->
u
.
surface
,
WINED3D_LOCATION_TEXTURE_SRGB
,
&
src_rect
);
else
surface_blt_fbo
(
device
,
context
,
WINED3D_TEXF_POINT
,
surface
,
WINED3D_LOCATION_TEXTURE_SRGB
,
&
src_rect
,
surface
,
WINED3D_LOCATION_TEXTURE_RGB
,
&
src_rect
);
surface_blt_fbo
(
device
,
context
,
WINED3D_TEXF_POINT
,
sub_resource
->
u
.
surface
,
WINED3D_LOCATION_TEXTURE_SRGB
,
&
src_rect
,
sub_resource
->
u
.
surface
,
WINED3D_LOCATION_TEXTURE_RGB
,
&
src_rect
);
return
TRUE
;
}
...
...
@@ -2212,8 +2212,8 @@ BOOL surface_load_texture(struct wined3d_surface *surface,
if
(
fbo_blitter_supported
(
WINED3D_BLIT_OP_COLOR_BLIT
,
gl_info
,
&
texture
->
resource
,
src_location
,
&
texture
->
resource
,
dst_location
))
surface_blt_fbo
(
device
,
context
,
WINED3D_TEXF_POINT
,
su
rface
,
src_location
,
&
src_rect
,
surface
,
dst_location
,
&
src_rect
);
surface_blt_fbo
(
device
,
context
,
WINED3D_TEXF_POINT
,
su
b_resource
->
u
.
surface
,
src_location
,
&
src_rect
,
sub_resource
->
u
.
surface
,
dst_location
,
&
src_rect
);
return
TRUE
;
}
...
...
@@ -2225,7 +2225,7 @@ BOOL surface_load_texture(struct wined3d_surface *surface,
if
((
sub_resource
->
locations
&
(
WINED3D_LOCATION_TEXTURE_RGB
|
texture
->
resource
.
map_binding
))
==
WINED3D_LOCATION_TEXTURE_RGB
)
{
FIXME_
(
d3d_perf
)(
"Downloading RGB
surface %p to reload it as sRGB.
\n
"
,
surface
);
FIXME_
(
d3d_perf
)(
"Downloading RGB
texture %p, %u to reload it as sRGB.
\n
"
,
texture
,
sub_resource_idx
);
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
map_binding
);
}
}
...
...
@@ -2234,7 +2234,7 @@ BOOL surface_load_texture(struct wined3d_surface *surface,
if
((
sub_resource
->
locations
&
(
WINED3D_LOCATION_TEXTURE_SRGB
|
texture
->
resource
.
map_binding
))
==
WINED3D_LOCATION_TEXTURE_SRGB
)
{
FIXME_
(
d3d_perf
)(
"Downloading sRGB
surface %p to reload it as RGB.
\n
"
,
surface
);
FIXME_
(
d3d_perf
)(
"Downloading sRGB
texture %p, %u to reload it as RGB.
\n
"
,
texture
,
sub_resource_idx
);
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
map_binding
);
}
}
...
...
@@ -2259,7 +2259,7 @@ BOOL surface_load_texture(struct wined3d_surface *surface,
* getting called. */
if
((
format
.
conv_byte_count
||
conversion
)
&&
texture
->
sub_resources
[
sub_resource_idx
].
buffer_object
)
{
TRACE
(
"Removing the pbo attached to
surface %p.
\n
"
,
surface
);
TRACE
(
"Removing the pbo attached to
texture %p, %u.
\n
"
,
texture
,
sub_resource_idx
);
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
WINED3D_LOCATION_SYSMEM
);
wined3d_texture_set_map_binding
(
texture
,
WINED3D_LOCATION_SYSMEM
);
...
...
dlls/wined3d/texture.c
View file @
92008ec4
...
...
@@ -1792,12 +1792,9 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int
static
BOOL
texture2d_load_location
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
,
DWORD
location
)
{
struct
wined3d_surface
*
surface
;
TRACE
(
"texture %p, sub_resource_idx %u, context %p, location %s.
\n
"
,
texture
,
sub_resource_idx
,
context
,
wined3d_debug_location
(
location
));
surface
=
texture
->
sub_resources
[
sub_resource_idx
].
u
.
surface
;
switch
(
location
)
{
case
WINED3D_LOCATION_USER_MEMORY
:
...
...
@@ -1814,7 +1811,7 @@ static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned in
case
WINED3D_LOCATION_TEXTURE_RGB
:
case
WINED3D_LOCATION_TEXTURE_SRGB
:
return
surface_load_texture
(
surface
,
context
,
return
texture2d_load_texture
(
texture
,
sub_resource_idx
,
context
,
location
==
WINED3D_LOCATION_TEXTURE_SRGB
);
default:
...
...
dlls/wined3d/wined3d_private.h
View file @
92008ec4
...
...
@@ -3240,6 +3240,8 @@ BOOL texture2d_load_renderbuffer(struct wined3d_texture *texture, unsigned int s
struct
wined3d_context
*
context
,
DWORD
dst_location
)
DECLSPEC_HIDDEN
;
BOOL
texture2d_load_sysmem
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
,
DWORD
dst_location
)
DECLSPEC_HIDDEN
;
BOOL
texture2d_load_texture
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
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
;
...
...
@@ -3346,8 +3348,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
const
struct
wined3d_blt_fx
*
blt_fx
,
enum
wined3d_texture_filter_type
filter
)
DECLSPEC_HIDDEN
;
void
surface_load_fb_texture
(
struct
wined3d_surface
*
surface
,
BOOL
srgb
,
struct
wined3d_context
*
context
)
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
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_format
*
format
,
const
RECT
*
src_rect
,
unsigned
int
src_pitch
,
const
POINT
*
dst_point
,
BOOL
srgb
,
...
...
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