Commit 50920453 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a resource to context_generate_rt_mask_no_fbo().

Instead of a texture, since rendertarget views operate on resources. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f4f20e48
...@@ -2717,12 +2717,12 @@ GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context) ...@@ -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; return 0;
else if (rt->swapchain) else if (rt->type != WINED3D_RTYPE_BUFFER && texture_from_resource(rt)->swapchain)
return context_generate_rt_mask_from_resource(&rt->resource); return context_generate_rt_mask_from_resource(rt);
else else
return context_generate_rt_mask(context_get_offscreen_gl_buffer(context)); 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 ...@@ -2760,7 +2760,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
} }
else 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; 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 ...@@ -3043,8 +3043,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
} }
else else
{ {
rt_mask = context_generate_rt_mask_no_fbo(context, rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? rts[0]->resource : NULL);
rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL);
} }
} }
else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO 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 ...@@ -3058,8 +3057,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
} }
else else
{ {
rt_mask = context_generate_rt_mask_no_fbo(context, rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? rts[0]->resource : NULL);
rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL);
} }
cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; 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 ...@@ -3109,7 +3107,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
unsigned int i; unsigned int i;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) 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) else if (!context->render_offscreen)
return context_generate_rt_mask_from_resource(rts[0]->resource); return context_generate_rt_mask_from_resource(rts[0]->resource);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment