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
6e160625
Commit
6e160625
authored
Feb 26, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly calculate the sub-resource level in is_full_clear().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9678a1a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
device.c
dlls/wined3d/device.c
+10
-5
No files found.
dlls/wined3d/device.c
View file @
6e160625
...
@@ -200,10 +200,14 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context
...
@@ -200,10 +200,14 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context
device
->
contexts
=
new_array
;
device
->
contexts
=
new_array
;
}
}
static
BOOL
is_full_clear
(
const
struct
wined3d_surface
*
target
,
const
RECT
*
draw_rect
,
const
RECT
*
clear_rect
)
static
BOOL
is_full_clear
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
RECT
*
draw_rect
,
const
RECT
*
clear_rect
)
{
{
unsigned
int
height
=
wined3d_texture_get_level_height
(
target
->
container
,
target
->
texture_level
);
unsigned
int
width
,
height
,
level
;
unsigned
int
width
=
wined3d_texture_get_level_width
(
target
->
container
,
target
->
texture_level
);
level
=
sub_resource_idx
%
texture
->
level_count
;
width
=
wined3d_texture_get_level_width
(
texture
,
level
);
height
=
wined3d_texture_get_level_height
(
texture
,
level
);
/* partial draw rect */
/* partial draw rect */
if
(
draw_rect
->
left
||
draw_rect
->
top
||
draw_rect
->
right
<
width
||
draw_rect
->
bottom
<
height
)
if
(
draw_rect
->
left
||
draw_rect
->
top
||
draw_rect
->
right
<
width
||
draw_rect
->
bottom
<
height
)
...
@@ -262,7 +266,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
...
@@ -262,7 +266,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
{
{
struct
wined3d_texture
*
rt
=
wined3d_texture_from_resource
(
rtv
->
resource
);
struct
wined3d_texture
*
rt
=
wined3d_texture_from_resource
(
rtv
->
resource
);
if
(
flags
&
WINED3DCLEAR_TARGET
&&
!
is_full_clear
(
target
,
draw_rect
,
rect_count
?
clear_rect
:
NULL
))
if
(
flags
&
WINED3DCLEAR_TARGET
&&
!
is_full_clear
(
rt
,
rtv
->
sub_resource_idx
,
draw_rect
,
rect_count
?
clear_rect
:
NULL
))
wined3d_texture_load_location
(
rt
,
rtv
->
sub_resource_idx
,
context
,
rtv
->
resource
->
draw_binding
);
wined3d_texture_load_location
(
rt
,
rtv
->
sub_resource_idx
,
context
,
rtv
->
resource
->
draw_binding
);
else
else
wined3d_texture_prepare_location
(
rt
,
rtv
->
sub_resource_idx
,
context
,
rtv
->
resource
->
draw_binding
);
wined3d_texture_prepare_location
(
rt
,
rtv
->
sub_resource_idx
,
context
,
rtv
->
resource
->
draw_binding
);
...
@@ -289,7 +294,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
...
@@ -289,7 +294,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
struct
wined3d_texture
*
ds
=
wined3d_texture_from_resource
(
dsv
->
resource
);
struct
wined3d_texture
*
ds
=
wined3d_texture_from_resource
(
dsv
->
resource
);
if
(
flags
&
(
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
)
if
(
flags
&
(
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
)
&&
!
is_full_clear
(
d
epth_stencil
,
draw_rect
,
rect_count
?
clear_rect
:
NULL
))
&&
!
is_full_clear
(
d
s
,
dsv
->
sub_resource_idx
,
draw_rect
,
rect_count
?
clear_rect
:
NULL
))
wined3d_texture_load_location
(
ds
,
dsv
->
sub_resource_idx
,
context
,
ds_location
);
wined3d_texture_load_location
(
ds
,
dsv
->
sub_resource_idx
,
context
,
ds_location
);
else
else
wined3d_texture_prepare_location
(
ds
,
dsv
->
sub_resource_idx
,
context
,
ds_location
);
wined3d_texture_prepare_location
(
ds
,
dsv
->
sub_resource_idx
,
context
,
ds_location
);
...
...
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