Commit 998d901f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Check the writemask for the correct render target in draw_primitive().

parent 980a0609
......@@ -5105,6 +5105,15 @@ static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primiti
}
}
static unsigned int get_render_target_writemask(const struct wined3d_blend_state *state, unsigned int index)
{
if (!state)
return 0xf;
if (!state->desc.independent)
index = 0;
return state->desc.rt[index].writemask;
}
/* Routine common to the draw primitive and draw indexed primitive routines */
void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state,
const struct wined3d_draw_parameters *parameters)
......@@ -5154,7 +5163,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL)
continue;
if (!state->blend_state || state->blend_state->desc.rt[0].writemask)
if (get_render_target_writemask(state->blend_state, i))
{
wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding);
wined3d_rendertarget_view_invalidate_location(rtv, ~rtv->resource->draw_binding);
......
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