Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/context.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 0761dd6379..d9e3dfaa50 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -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);