mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 20:50:02 +00:00
wined3d: Store whether a depth/stencil state writes to the depth/stencil buffer in the state itself.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
67b893ac09
commit
fe85514479
|
@ -5172,7 +5172,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
|||
return;
|
||||
}
|
||||
|
||||
if (dsv && (!state->depth_stencil_state || state->depth_stencil_state->desc.depth_write))
|
||||
if (dsv && (!state->depth_stencil_state || state->depth_stencil_state->writes_ds))
|
||||
{
|
||||
DWORD location = context->render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
|
||||
|
||||
|
|
|
@ -3455,7 +3455,7 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
|
|||
wined3d_rendertarget_view_prepare_location(dsv, &context_vk->c, dsv->resource->draw_binding);
|
||||
}
|
||||
|
||||
if (!state->depth_stencil_state || state->depth_stencil_state->desc.depth_write)
|
||||
if (!state->depth_stencil_state || state->depth_stencil_state->writes_ds)
|
||||
invalidate_ds = true;
|
||||
|
||||
sample_count = max(1, wined3d_resource_get_sample_count(dsv->resource));
|
||||
|
|
|
@ -146,6 +146,11 @@ void * CDECL wined3d_depth_stencil_state_get_parent(const struct wined3d_depth_s
|
|||
return state->parent;
|
||||
}
|
||||
|
||||
static bool depth_stencil_state_desc_writes_ds(const struct wined3d_depth_stencil_state_desc *desc)
|
||||
{
|
||||
return desc->depth_write;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_depth_stencil_state_create(struct wined3d_device *device,
|
||||
const struct wined3d_depth_stencil_state_desc *desc, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_depth_stencil_state **state)
|
||||
|
@ -164,6 +169,8 @@ HRESULT CDECL wined3d_depth_stencil_state_create(struct wined3d_device *device,
|
|||
object->parent_ops = parent_ops;
|
||||
object->device = device;
|
||||
|
||||
object->writes_ds = depth_stencil_state_desc_writes_ds(desc);
|
||||
|
||||
TRACE("Created depth/stencil state %p.\n", object);
|
||||
*state = object;
|
||||
|
||||
|
|
|
@ -3778,6 +3778,8 @@ struct wined3d_depth_stencil_state
|
|||
LONG refcount;
|
||||
struct wined3d_depth_stencil_state_desc desc;
|
||||
|
||||
bool writes_ds;
|
||||
|
||||
void *parent;
|
||||
const struct wined3d_parent_ops *parent_ops;
|
||||
|
||||
|
|
Loading…
Reference in a new issue