wined3d: Get resource info from the rendertarget view in draw_primitive().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-03-06 20:59:48 +01:00 committed by Alexandre Julliard
parent 2d8a1034fa
commit 9083addc6a
1 changed files with 7 additions and 5 deletions

View File

@ -622,17 +622,19 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
if (target && target->resource.format->id != WINED3DFMT_NULL)
struct wined3d_rendertarget_view *rtv = device->fb.render_targets[i];
struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(rtv);
if (target && rtv->format->id != WINED3DFMT_NULL)
{
if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
{
surface_load_location(target, context, target->container->resource.draw_binding);
surface_invalidate_location(target, ~target->container->resource.draw_binding);
surface_load_location(target, context, rtv->resource->draw_binding);
surface_invalidate_location(target, ~rtv->resource->draw_binding);
}
else
{
wined3d_surface_prepare(target, context, target->container->resource.draw_binding);
wined3d_surface_prepare(target, context, rtv->resource->draw_binding);
}
}
}