wined3d: Do not crash when attempting to issue draw call with no attachments.

The is broken since by 2641c5c28f.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-02-26 18:48:04 +01:00 committed by Alexandre Julliard
parent fedabd7dd7
commit f4f2d4052b
1 changed files with 4 additions and 1 deletions

View File

@ -427,7 +427,10 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (!(rtv = fb->render_targets[0])) if (!(rtv = fb->render_targets[0]))
rtv = fb->depth_stencil; rtv = fb->depth_stencil;
if (rtv)
context = context_acquire(device, wined3d_texture_from_resource(rtv->resource), rtv->sub_resource_idx); context = context_acquire(device, wined3d_texture_from_resource(rtv->resource), rtv->sub_resource_idx);
else
context = context_acquire(device, NULL, 0);
if (!context->valid) if (!context->valid)
{ {
context_release(context); context_release(context);