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
a8141ef0
Commit
a8141ef0
authored
May 29, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
May 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move swapchain buffer discarding to wined3d_cs_exec_present().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
859514a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
24 deletions
+18
-24
cs.c
dlls/wined3d/cs.c
+18
-2
swapchain.c
dlls/wined3d/swapchain.c
+0
-22
No files found.
dlls/wined3d/cs.c
View file @
a8141ef0
...
...
@@ -522,11 +522,14 @@ static void wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data)
static
void
wined3d_cs_exec_present
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
struct
wined3d_texture
*
logo_texture
,
*
cursor_texture
,
*
back_buffer
;
struct
wined3d_rendertarget_view
*
dsv
=
cs
->
state
.
fb
.
depth_stencil
;
const
struct
wined3d_cs_present
*
op
=
data
;
const
struct
wined3d_swapchain_desc
*
desc
;
struct
wined3d_swapchain
*
swapchain
;
unsigned
int
i
;
swapchain
=
op
->
swapchain
;
desc
=
&
swapchain
->
state
.
desc
;
back_buffer
=
swapchain
->
back_buffers
[
0
];
wined3d_swapchain_set_window
(
swapchain
,
op
->
dst_window_override
);
...
...
@@ -557,7 +560,7 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
TRACE
(
"Rendering the software cursor.
\n
"
);
if
(
swapchain
->
state
.
desc
.
windowed
)
if
(
desc
->
windowed
)
MapWindowPoints
(
NULL
,
swapchain
->
win_handle
,
(
POINT
*
)
&
dst_rect
,
2
);
if
(
wined3d_clip_blit
(
&
clip_rect
,
&
dst_rect
,
&
src_rect
))
wined3d_texture_blt
(
back_buffer
,
0
,
&
dst_rect
,
cursor_texture
,
0
,
...
...
@@ -566,6 +569,19 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
swapchain
->
swapchain_ops
->
swapchain_present
(
swapchain
,
&
op
->
src_rect
,
&
op
->
dst_rect
,
op
->
swap_interval
,
op
->
flags
);
/* Discard buffers if the swap effect allows it. */
back_buffer
=
swapchain
->
back_buffers
[
desc
->
backbuffer_count
-
1
];
if
(
desc
->
swap_effect
==
WINED3D_SWAP_EFFECT_DISCARD
||
desc
->
swap_effect
==
WINED3D_SWAP_EFFECT_FLIP_DISCARD
)
wined3d_texture_validate_location
(
back_buffer
,
0
,
WINED3D_LOCATION_DISCARDED
);
if
(
dsv
&&
dsv
->
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
{
struct
wined3d_texture
*
ds
=
texture_from_resource
(
dsv
->
resource
);
if
((
desc
->
flags
&
WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
||
ds
->
flags
&
WINED3D_TEXTURE_DISCARD
))
wined3d_rendertarget_view_validate_location
(
dsv
,
WINED3D_LOCATION_DISCARDED
);
}
if
(
TRACE_ON
(
fps
))
{
DWORD
time
=
GetTickCount
();
...
...
@@ -582,7 +598,7 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
}
wined3d_resource_release
(
&
swapchain
->
front_buffer
->
resource
);
for
(
i
=
0
;
i
<
swapchain
->
state
.
desc
.
backbuffer_count
;
++
i
)
for
(
i
=
0
;
i
<
desc
->
backbuffer_count
;
++
i
)
{
wined3d_resource_release
(
&
swapchain
->
back_buffers
[
i
]
->
resource
);
}
...
...
dlls/wined3d/swapchain.c
View file @
a8141ef0
...
...
@@ -467,8 +467,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
struct
wined3d_swapchain_gl
*
swapchain_gl
=
wined3d_swapchain_gl
(
swapchain
);
const
struct
wined3d_swapchain_desc
*
desc
=
&
swapchain
->
state
.
desc
;
struct
wined3d_texture
*
back_buffer
=
swapchain
->
back_buffers
[
0
];
const
struct
wined3d_fb_state
*
fb
=
&
swapchain
->
device
->
cs
->
state
.
fb
;
struct
wined3d_rendertarget_view
*
dsv
=
fb
->
depth_stencil
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context_gl
*
context_gl
;
struct
wined3d_context
*
context
;
...
...
@@ -532,26 +530,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
wined3d_texture_validate_location
(
swapchain
->
front_buffer
,
0
,
WINED3D_LOCATION_DRAWABLE
);
wined3d_texture_invalidate_location
(
swapchain
->
front_buffer
,
0
,
~
WINED3D_LOCATION_DRAWABLE
);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same.
*
* The FLIP swap effect is not implemented yet. We could mark WINED3D_LOCATION_DRAWABLE
* up to date and hope WGL flipped front and back buffers and read this data into
* the FBO. Don't bother about this for now. */
if
(
desc
->
swap_effect
==
WINED3D_SWAP_EFFECT_DISCARD
||
desc
->
swap_effect
==
WINED3D_SWAP_EFFECT_FLIP_DISCARD
)
wined3d_texture_validate_location
(
swapchain
->
back_buffers
[
desc
->
backbuffer_count
-
1
],
0
,
WINED3D_LOCATION_DISCARDED
);
if
(
dsv
&&
dsv
->
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
{
struct
wined3d_texture
*
ds
=
texture_from_resource
(
dsv
->
resource
);
if
((
desc
->
flags
&
WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
||
ds
->
flags
&
WINED3D_TEXTURE_DISCARD
))
wined3d_texture_validate_location
(
ds
,
dsv
->
sub_resource_idx
,
WINED3D_LOCATION_DISCARDED
);
}
context_release
(
context
);
}
...
...
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