wined3d: Acquire references to cleared render-target views for command lists by inspecting CS packets.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jan Sikorski 2022-01-24 13:59:02 +01:00 committed by Alexandre Julliard
parent 4f7837a584
commit 18a6d9ab0e
1 changed files with 28 additions and 0 deletions

View File

@ -3616,6 +3616,20 @@ static void wined3d_cs_packet_decref_objects(const struct wined3d_cs_packet *pac
break;
}
case WINED3D_CS_OP_CLEAR:
{
struct wined3d_cs_clear *op = (struct wined3d_cs_clear *)packet->data;
for (i = 0; i < op->rt_count; ++i)
{
if (op->fb.render_targets[i])
wined3d_rendertarget_view_decref(op->fb.render_targets[i]);
}
if (op->fb.depth_stencil)
wined3d_rendertarget_view_decref(op->fb.depth_stencil);
break;
}
default:
break;
}
@ -3750,6 +3764,20 @@ static void wined3d_cs_packet_incref_objects(struct wined3d_cs_packet *packet)
break;
}
case WINED3D_CS_OP_CLEAR:
{
struct wined3d_cs_clear *op = (struct wined3d_cs_clear *)packet->data;
for (i = 0; i < op->rt_count; ++i)
{
if (op->fb.render_targets[i])
wined3d_rendertarget_view_incref(op->fb.render_targets[i]);
}
if (op->fb.depth_stencil)
wined3d_rendertarget_view_incref(op->fb.depth_stencil);
break;
}
default:
break;
}