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
c6c5c690
Commit
c6c5c690
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: Handle discarded depth-stencil surfaces with SFLAG_LOST.
SFLAG_INSYSMEM is already set by surface_add_dirty_rect() for all surfaces anyway.
parent
cbf641e9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
22 deletions
+30
-22
device.c
dlls/wined3d/device.c
+1
-1
surface.c
dlls/wined3d/surface.c
+28
-15
swapchain.c
dlls/wined3d/swapchain.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-5
No files found.
dlls/wined3d/device.c
View file @
c6c5c690
...
...
@@ -4937,7 +4937,7 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
if
(
device
->
swapchains
[
0
]
->
desc
.
flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
prev
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
prev
,
SFLAG_
DS_DISCARDED
,
surface_modify_ds_location
(
prev
,
SFLAG_
LOST
,
prev
->
resource
.
width
,
prev
->
resource
.
height
);
if
(
prev
==
device
->
onscreen_depth_stencil
)
{
...
...
dlls/wined3d/surface.c
View file @
c6c5c690
...
...
@@ -764,7 +764,8 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
return
WINED3DERR_INVALIDCALL
;
}
surface
->
flags
|=
SFLAG_INSYSMEM
;
if
(
surface
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
surface
->
flags
|=
SFLAG_LOST
;
return
WINED3D_OK
;
}
...
...
@@ -5568,16 +5569,9 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
{
TRACE
(
"surface %p, new location %#x, w %u, h %u.
\n
"
,
surface
,
location
,
w
,
h
);
if
(
location
&
~
SFLAG_LOCATIONS
)
if
(
location
&
~
(
SFLAG_LOCATIONS
|
SFLAG_LOST
)
)
FIXME
(
"Invalid location (%#x) specified.
\n
"
,
location
);
if
(
!
(
surface
->
flags
&
SFLAG_ALLOCATED
))
location
&=
~
SFLAG_INTEXTURE
;
if
(
!
(
surface
->
rb_resolved
))
location
&=
~
SFLAG_INRB_RESOLVED
;
if
(
!
(
surface
->
rb_multisample
))
location
&=
~
SFLAG_INRB_MULTISAMPLE
;
if
(((
surface
->
flags
&
SFLAG_INTEXTURE
)
&&
!
(
location
&
SFLAG_INTEXTURE
))
||
(
!
(
surface
->
flags
&
SFLAG_INTEXTURE
)
&&
(
location
&
SFLAG_INTEXTURE
)))
{
...
...
@@ -5590,7 +5584,7 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
surface
->
ds_current_size
.
cx
=
w
;
surface
->
ds_current_size
.
cy
=
h
;
surface
->
flags
&=
~
SFLAG_LOCATIONS
;
surface
->
flags
&=
~
(
SFLAG_LOCATIONS
|
SFLAG_LOST
)
;
surface
->
flags
|=
location
;
}
...
...
@@ -5631,13 +5625,32 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return
;
}
if
(
surface
->
flags
&
SFLAG_LOST
)
{
TRACE
(
"Surface was discarded, no need copy data.
\n
"
);
switch
(
location
)
{
case
SFLAG_INTEXTURE
:
surface_prepare_texture
(
surface
,
context
,
FALSE
);
break
;
case
SFLAG_INRB_MULTISAMPLE
:
surface_prepare_rb
(
surface
,
context
->
gl_info
,
TRUE
);
break
;
case
SFLAG_INDRAWABLE
:
/* Nothing to do */
break
;
default:
FIXME
(
"Unhandled location %#x"
,
location
);
}
surface
->
flags
&=
~
SFLAG_LOST
;
surface
->
flags
|=
location
;
surface
->
ds_current_size
.
cx
=
surface
->
resource
.
width
;
surface
->
ds_current_size
.
cy
=
surface
->
resource
.
height
;
return
;
}
if
(
!
(
surface
->
flags
&
SFLAG_LOCATIONS
))
{
/* This mostly happens when a depth / stencil is used without being
* cleared first. In principle we could upload from sysmem, or
* explicitly clear before first usage. For the moment there don't
* appear to be a lot of applications depending on this, so a FIXME
* should do. */
FIXME
(
"No up to date depth stencil location.
\n
"
);
surface
->
flags
|=
location
;
surface
->
ds_current_size
.
cx
=
surface
->
resource
.
width
;
...
...
dlls/wined3d/swapchain.c
View file @
c6c5c690
...
...
@@ -641,7 +641,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
if
(
swapchain
->
desc
.
flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
fb
->
depth_stencil
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
fb
->
depth_stencil
,
SFLAG_
DS_DISCARDED
,
surface_modify_ds_location
(
fb
->
depth_stencil
,
SFLAG_
LOST
,
fb
->
depth_stencil
->
resource
.
width
,
fb
->
depth_stencil
->
resource
.
height
);
if
(
fb
->
depth_stencil
==
swapchain
->
device
->
onscreen_depth_stencil
)
...
...
dlls/wined3d/wined3d_private.h
View file @
c6c5c690
...
...
@@ -2179,11 +2179,6 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
SFLAG_INRB_MULTISAMPLE | \
SFLAG_INRB_RESOLVED)
#define SFLAG_DS_DISCARDED (SFLAG_INTEXTURE | \
SFLAG_INDRAWABLE | \
SFLAG_INRB_MULTISAMPLE | \
SFLAG_INRB_RESOLVED)
typedef
enum
{
NO_CONVERSION
,
CONVERT_PALETTED
,
...
...
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