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
15d3155e
Commit
15d3155e
authored
Mar 21, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Always pass a valid source box to texture3d_upload_data().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dc5b2296
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
18 deletions
+26
-18
texture.c
dlls/wined3d/texture.c
+17
-18
wined3d_private.h
dlls/wined3d/wined3d_private.h
+9
-0
No files found.
dlls/wined3d/texture.c
View file @
15d3155e
...
...
@@ -2549,22 +2549,13 @@ static void texture3d_upload_data(struct wined3d_texture *texture, unsigned int
texture
,
sub_resource_idx
,
context
,
debug_d3dformat
(
format
->
id
),
debug_box
(
src_box
),
data
->
buffer_object
,
data
->
addr
,
row_pitch
,
slice_pitch
,
dst_x
,
dst_y
,
dst_z
,
srgb
);
if
(
src_box
)
{
addr
+=
src_box
->
front
*
slice_pitch
;
addr
+=
src_box
->
top
*
row_pitch
;
addr
+=
src_box
->
left
*
format
->
byte_count
;
addr
+=
src_box
->
front
*
slice_pitch
;
addr
+=
src_box
->
top
*
row_pitch
;
addr
+=
src_box
->
left
*
format
->
byte_count
;
update_w
=
src_box
->
right
-
src_box
->
left
;
update_h
=
src_box
->
bottom
-
src_box
->
top
;
update_d
=
src_box
->
back
-
src_box
->
front
;
}
else
{
update_w
=
wined3d_texture_get_level_width
(
texture
,
level
);
update_h
=
wined3d_texture_get_level_height
(
texture
,
level
);
update_d
=
wined3d_texture_get_level_depth
(
texture
,
level
);
}
update_w
=
src_box
->
right
-
src_box
->
left
;
update_h
=
src_box
->
bottom
-
src_box
->
top
;
update_d
=
src_box
->
back
-
src_box
->
front
;
if
(
format
->
conv_byte_count
)
{
...
...
@@ -2646,6 +2637,7 @@ static void texture3d_srgb_transfer(struct wined3d_texture *texture, unsigned in
struct
wined3d_texture_sub_resource
*
sub_resource
=
&
texture
->
sub_resources
[
sub_resource_idx
];
unsigned
int
row_pitch
,
slice_pitch
;
struct
wined3d_bo_address
data
;
struct
wined3d_box
src_box
;
/* Optimisations are possible, but the effort should be put into either
* implementing EXT_SRGB_DECODE in the driver or finding out why we
...
...
@@ -2659,11 +2651,12 @@ static void texture3d_srgb_transfer(struct wined3d_texture *texture, unsigned in
return
;
wined3d_texture_get_pitch
(
texture
,
sub_resource_idx
,
&
row_pitch
,
&
slice_pitch
);
wined3d_texture_get_level_box
(
texture
,
sub_resource_idx
%
texture
->
level_count
,
&
src_box
);
wined3d_texture_bind_and_dirtify
(
texture
,
context
,
!
dest_is_srgb
);
texture3d_download_data
(
texture
,
sub_resource_idx
,
context
,
&
data
);
wined3d_texture_bind_and_dirtify
(
texture
,
context
,
dest_is_srgb
);
texture3d_upload_data
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
format
,
NULL
,
wined3d_const_bo_address
(
&
data
),
row_pitch
,
slice_pitch
,
0
,
0
,
0
,
FALSE
);
&
src_box
,
wined3d_const_bo_address
(
&
data
),
row_pitch
,
slice_pitch
,
0
,
0
,
0
,
FALSE
);
heap_free
(
data
.
addr
);
}
...
...
@@ -2685,21 +2678,27 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
if
(
sub_resource
->
locations
&
WINED3D_LOCATION_SYSMEM
)
{
struct
wined3d_const_bo_address
data
=
{
0
,
texture
->
resource
.
heap_memory
};
struct
wined3d_box
src_box
;
data
.
addr
+=
sub_resource
->
offset
;
wined3d_texture_bind_and_dirtify
(
texture
,
context
,
location
==
WINED3D_LOCATION_TEXTURE_SRGB
);
wined3d_texture_get_pitch
(
texture
,
sub_resource_idx
,
&
row_pitch
,
&
slice_pitch
);
wined3d_texture_get_level_box
(
texture
,
sub_resource_idx
%
texture
->
level_count
,
&
src_box
);
texture3d_upload_data
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
format
,
NULL
,
&
data
,
row_pitch
,
slice_pitch
,
0
,
0
,
0
,
FALSE
);
&
src_box
,
&
data
,
row_pitch
,
slice_pitch
,
0
,
0
,
0
,
FALSE
);
}
else
if
(
sub_resource
->
locations
&
WINED3D_LOCATION_BUFFER
)
{
struct
wined3d_const_bo_address
data
=
{
sub_resource
->
buffer_object
,
NULL
};
struct
wined3d_box
src_box
;
wined3d_texture_bind_and_dirtify
(
texture
,
context
,
location
==
WINED3D_LOCATION_TEXTURE_SRGB
);
wined3d_texture_get_pitch
(
texture
,
sub_resource_idx
,
&
row_pitch
,
&
slice_pitch
);
wined3d_texture_get_level_box
(
texture
,
sub_resource_idx
%
texture
->
level_count
,
&
src_box
);
texture3d_upload_data
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
format
,
NULL
,
&
data
,
row_pitch
,
slice_pitch
,
0
,
0
,
0
,
FALSE
);
&
src_box
,
&
data
,
row_pitch
,
slice_pitch
,
0
,
0
,
0
,
FALSE
);
}
else
if
(
sub_resource
->
locations
&
WINED3D_LOCATION_TEXTURE_RGB
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
15d3155e
...
...
@@ -3241,6 +3241,15 @@ static inline unsigned int wined3d_texture_get_level_pow2_height(const struct wi
return
max
(
1
,
texture
->
pow2_height
>>
level
);
}
static
inline
void
wined3d_texture_get_level_box
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
,
struct
wined3d_box
*
box
)
{
wined3d_box_set
(
box
,
0
,
0
,
wined3d_texture_get_level_width
(
texture
,
level
),
wined3d_texture_get_level_height
(
texture
,
level
),
0
,
wined3d_texture_get_level_depth
(
texture
,
level
));
}
HRESULT
texture2d_blt
(
struct
wined3d_texture
*
dst_texture
,
unsigned
int
dst_sub_resource_idx
,
const
struct
wined3d_box
*
dst_box
,
struct
wined3d_texture
*
src_texture
,
unsigned
int
src_sub_resource_idx
,
const
struct
wined3d_box
*
src_box
,
DWORD
flags
,
...
...
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