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
cbf641e9
Commit
cbf641e9
authored
Jan 12, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Jan 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Modify depth-stencil location flags only after allocating the new location.
parent
add5916c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
device.c
dlls/wined3d/device.c
+9
-7
drawprim.c
dlls/wined3d/drawprim.c
+8
-5
No files found.
dlls/wined3d/device.c
View file @
cbf641e9
...
...
@@ -600,7 +600,7 @@ static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw
}
static
void
prepare_ds_clear
(
struct
wined3d_surface
*
ds
,
struct
wined3d_context
*
context
,
DWORD
location
,
const
RECT
*
draw_rect
,
UINT
rect_count
,
const
RECT
*
clear_rect
)
DWORD
location
,
const
RECT
*
draw_rect
,
UINT
rect_count
,
const
RECT
*
clear_rect
,
RECT
*
out_rect
)
{
RECT
current_rect
,
r
;
...
...
@@ -615,7 +615,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
if
(
EqualRect
(
&
r
,
draw_rect
))
{
/* current_rect ⊇ draw_rect, modify only. */
surface_modify_ds_location
(
ds
,
location
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
SetRect
(
out_rect
,
0
,
0
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
return
;
}
...
...
@@ -626,7 +626,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
if
(
!
clear_rect
)
{
/* Full clear, modify only. */
surface_modify_ds_location
(
ds
,
location
,
draw_rect
->
right
,
draw_rect
->
bottom
)
;
*
out_rect
=
*
draw_rect
;
return
;
}
...
...
@@ -634,14 +634,14 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
if
(
EqualRect
(
&
r
,
draw_rect
))
{
/* clear_rect ⊇ draw_rect, modify only. */
surface_modify_ds_location
(
ds
,
location
,
draw_rect
->
right
,
draw_rect
->
bottom
)
;
*
out_rect
=
*
draw_rect
;
return
;
}
}
/* Full load. */
surface_load_ds_location
(
ds
,
context
,
location
);
surface_modify_ds_location
(
ds
,
location
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
SetRect
(
out_rect
,
0
,
0
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
}
/* Do not call while under the GL lock. */
...
...
@@ -656,6 +656,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
GLbitfield
clear_mask
=
0
;
BOOL
render_offscreen
;
unsigned
int
i
;
RECT
ds_rect
;
/* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the
* drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true
...
...
@@ -701,7 +702,8 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
if
(
!
render_offscreen
&&
fb
->
depth_stencil
!=
device
->
onscreen_depth_stencil
)
device_switch_onscreen_ds
(
device
,
context
,
fb
->
depth_stencil
);
prepare_ds_clear
(
fb
->
depth_stencil
,
context
,
location
,
draw_rect
,
rect_count
,
clear_rect
);
prepare_ds_clear
(
fb
->
depth_stencil
,
context
,
location
,
draw_rect
,
rect_count
,
clear_rect
,
&
ds_rect
);
}
if
(
!
context_apply_clear_state
(
context
,
device
,
rt_count
,
fb
))
...
...
@@ -732,7 +734,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
{
DWORD
location
=
render_offscreen
?
fb
->
depth_stencil
->
draw_binding
:
SFLAG_INDRAWABLE
;
surface_modify_
location
(
fb
->
depth_stencil
,
location
,
TRUE
);
surface_modify_
ds_location
(
fb
->
depth_stencil
,
location
,
ds_rect
.
right
,
ds_rect
.
bottom
);
glDepthMask
(
GL_TRUE
);
context_invalidate_state
(
context
,
STATE_RENDER
(
WINED3D_RS_ZWRITEENABLE
));
...
...
dlls/wined3d/drawprim.c
View file @
cbf641e9
...
...
@@ -634,11 +634,6 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
IntersectRect
(
&
r
,
&
draw_rect
,
&
current_rect
);
if
(
!
EqualRect
(
&
r
,
&
draw_rect
))
surface_load_ds_location
(
ds
,
context
,
location
);
if
(
state
->
render_states
[
WINED3D_RS_ZWRITEENABLE
])
{
surface_modify_ds_location
(
ds
,
location
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
}
}
}
...
...
@@ -649,6 +644,14 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
return
;
}
if
(
device
->
fb
.
depth_stencil
&&
state
->
render_states
[
WINED3D_RS_ZWRITEENABLE
])
{
struct
wined3d_surface
*
ds
=
device
->
fb
.
depth_stencil
;
DWORD
location
=
context
->
render_offscreen
?
ds
->
draw_binding
:
SFLAG_INDRAWABLE
;
surface_modify_ds_location
(
ds
,
location
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
}
if
((
!
context
->
gl_info
->
supported
[
WINED3D_GL_VERSION_2_0
]
||
(
!
glPointParameteri
&&
!
context
->
gl_info
->
supported
[
NV_POINT_SPRITE
]))
&&
context
->
render_offscreen
...
...
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