wined3d: Pass a resource to context_generate_rt_mask_no_fbo().

Instead of a texture, since rendertarget views operate on resources.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Henri Verbeet 2018-03-14 11:39:13 +03:30 committed by Alexandre Julliard
parent f4f20e48cf
commit 50920453b0
1 changed files with 8 additions and 10 deletions

View File

@ -2717,12 +2717,12 @@ GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context)
}
}
static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, struct wined3d_texture *rt)
static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, struct wined3d_resource *rt)
{
if (!rt || rt->resource.format->id == WINED3DFMT_NULL)
if (!rt || rt->format->id == WINED3DFMT_NULL)
return 0;
else if (rt->swapchain)
return context_generate_rt_mask_from_resource(&rt->resource);
else if (rt->type != WINED3D_RTYPE_BUFFER && texture_from_resource(rt)->swapchain)
return context_generate_rt_mask_from_resource(rt);
else
return context_generate_rt_mask(context_get_offscreen_gl_buffer(context));
}
@ -2760,7 +2760,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
}
else
{
rt_mask = context_generate_rt_mask_no_fbo(context, rt);
rt_mask = context_generate_rt_mask_no_fbo(context, &rt->resource);
}
cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
@ -3043,8 +3043,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
}
else
{
rt_mask = context_generate_rt_mask_no_fbo(context,
rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL);
rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? rts[0]->resource : NULL);
}
}
else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
@ -3058,8 +3057,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
}
else
{
rt_mask = context_generate_rt_mask_no_fbo(context,
rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL);
rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? rts[0]->resource : NULL);
}
cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
@ -3109,7 +3107,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
unsigned int i;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO)
return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])->container);
return context_generate_rt_mask_no_fbo(context, rts[0]->resource);
else if (!context->render_offscreen)
return context_generate_rt_mask_from_resource(rts[0]->resource);