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
fd5fc51b
Commit
fd5fc51b
authored
Oct 01, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send depth stencil binding updates through the command stream.
parent
438b6726
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
32 deletions
+60
-32
cs.c
dlls/wined3d/cs.c
+58
-0
device.c
dlls/wined3d/device.c
+1
-32
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/cs.c
View file @
fd5fc51b
...
...
@@ -31,6 +31,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_VIEWPORT
,
WINED3D_CS_OP_SET_SCISSOR_RECT
,
WINED3D_CS_OP_SET_RENDER_TARGET
,
WINED3D_CS_OP_SET_DEPTH_STENCIL
,
};
struct
wined3d_cs_present
...
...
@@ -84,6 +85,12 @@ struct wined3d_cs_set_render_target
struct
wined3d_surface
*
render_target
;
};
struct
wined3d_cs_set_depth_stencil
{
enum
wined3d_cs_op
opcode
;
struct
wined3d_surface
*
depth_stencil
;
};
static
void
wined3d_cs_exec_present
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_present
*
op
=
data
;
...
...
@@ -227,6 +234,56 @@ void wined3d_cs_emit_set_render_target(struct wined3d_cs *cs, UINT render_target
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_set_depth_stencil
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_set_depth_stencil
*
op
=
data
;
struct
wined3d_device
*
device
=
cs
->
device
;
struct
wined3d_surface
*
prev
;
if
((
prev
=
cs
->
state
.
fb
->
depth_stencil
))
{
if
(
device
->
swapchains
[
0
]
->
desc
.
flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
prev
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
prev
,
SFLAG_DISCARDED
,
prev
->
resource
.
width
,
prev
->
resource
.
height
);
if
(
prev
==
device
->
onscreen_depth_stencil
)
{
wined3d_surface_decref
(
device
->
onscreen_depth_stencil
);
device
->
onscreen_depth_stencil
=
NULL
;
}
}
}
cs
->
fb
.
depth_stencil
=
op
->
depth_stencil
;
if
(
!
prev
!=
!
op
->
depth_stencil
)
{
/* Swapping NULL / non NULL depth stencil affects the depth and tests */
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_ZENABLE
));
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_STENCILENABLE
));
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_STENCILWRITEMASK
));
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_DEPTHBIAS
));
}
else
if
(
prev
&&
prev
->
resource
.
format
->
depth_size
!=
op
->
depth_stencil
->
resource
.
format
->
depth_size
)
{
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_DEPTHBIAS
));
}
device_invalidate_state
(
device
,
STATE_FRAMEBUFFER
);
}
void
wined3d_cs_emit_set_depth_stencil
(
struct
wined3d_cs
*
cs
,
struct
wined3d_surface
*
depth_stencil
)
{
struct
wined3d_cs_set_depth_stencil
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_SET_DEPTH_STENCIL
;
op
->
depth_stencil
=
depth_stencil
;
cs
->
ops
->
submit
(
cs
);
}
static
void
(
*
const
wined3d_cs_op_handlers
[])(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
=
{
/* WINED3D_CS_OP_PRESENT */
wined3d_cs_exec_present
,
...
...
@@ -235,6 +292,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_VIEWPORT */
wined3d_cs_exec_set_viewport
,
/* WINED3D_CS_OP_SET_SCISSOR_RECT */
wined3d_cs_exec_set_scissor_rect
,
/* WINED3D_CS_OP_SET_RENDER_TARGET */
wined3d_cs_exec_set_render_target
,
/* WINED3D_CS_OP_SET_DEPTH_STENCIL */
wined3d_cs_exec_set_depth_stencil
,
};
static
void
*
wined3d_cs_st_require_space
(
struct
wined3d_cs
*
cs
,
size_t
size
)
...
...
dlls/wined3d/device.c
View file @
fd5fc51b
...
...
@@ -4054,43 +4054,12 @@ void CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, struc
return
;
}
if
(
prev
)
{
if
(
device
->
swapchains
[
0
]
->
desc
.
flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
prev
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
prev
,
SFLAG_DISCARDED
,
prev
->
resource
.
width
,
prev
->
resource
.
height
);
if
(
prev
==
device
->
onscreen_depth_stencil
)
{
wined3d_surface_decref
(
device
->
onscreen_depth_stencil
);
device
->
onscreen_depth_stencil
=
NULL
;
}
}
}
device
->
fb
.
depth_stencil
=
depth_stencil
;
if
(
depth_stencil
)
wined3d_surface_incref
(
depth_stencil
);
if
(
!
prev
!=
!
depth_stencil
)
{
/* Swapping NULL / non NULL depth stencil affects the depth and tests */
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_ZENABLE
));
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_STENCILENABLE
));
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_STENCILWRITEMASK
));
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_DEPTHBIAS
));
}
else
if
(
prev
&&
prev
->
resource
.
format
->
depth_size
!=
depth_stencil
->
resource
.
format
->
depth_size
)
{
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_DEPTHBIAS
));
}
wined3d_cs_emit_set_depth_stencil
(
device
->
cs
,
depth_stencil
);
if
(
prev
)
wined3d_surface_decref
(
prev
);
device_invalidate_state
(
device
,
STATE_FRAMEBUFFER
);
return
;
}
HRESULT
CDECL
wined3d_device_set_cursor_properties
(
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/wined3d_private.h
View file @
fd5fc51b
...
...
@@ -2486,6 +2486,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
void
wined3d_cs_emit_present
(
struct
wined3d_cs
*
cs
,
struct
wined3d_swapchain
*
swapchain
,
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
HWND
dst_window_override
,
const
RGNDATA
*
dirty_region
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_depth_stencil
(
struct
wined3d_cs
*
cs
,
struct
wined3d_surface
*
depth_stencil
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_render_target
(
struct
wined3d_cs
*
cs
,
UINT
render_target_idx
,
struct
wined3d_surface
*
render_target
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_scissor_rect
(
struct
wined3d_cs
*
cs
,
const
RECT
*
rect
)
DECLSPEC_HIDDEN
;
...
...
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