wined3d: Move the color masks to wined3d_blend_state.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-12 23:25:02 -05:00 committed by Alexandre Julliard
parent 2da5422bd2
commit f396b49a92
9 changed files with 63 additions and 133 deletions

View File

@ -18163,7 +18163,6 @@ static void test_color_mask(void)
{ {
get_texture_readback(rts[i], 0, &rb); get_texture_readback(rts[i], 0, &rb);
color = get_readback_color(&rb, 320, 240); color = get_readback_color(&rb, 320, 240);
todo_wine_if (i >= 4)
ok(color == expected_colors[i], "%u: Got unexpected color 0x%08x.\n", i, color); ok(color == expected_colors[i], "%u: Got unexpected color 0x%08x.\n", i, color);
release_resource_readback(&rb); release_resource_readback(&rb);

View File

@ -707,7 +707,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface);
static const float default_blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; static const float default_blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f};
struct d3d_blend_state *blend_state_impl; struct d3d_blend_state *blend_state_impl;
const D3D11_BLEND_DESC *desc;
TRACE("iface %p, blend_state %p, blend_factor %s, sample_mask 0x%08x.\n", TRACE("iface %p, blend_state %p, blend_factor %s, sample_mask 0x%08x.\n",
iface, blend_state, debug_float4(blend_factor), sample_mask); iface, blend_state, debug_float4(blend_factor), sample_mask);
@ -718,32 +717,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK, sample_mask); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK, sample_mask);
if (!(blend_state_impl = unsafe_impl_from_ID3D11BlendState(blend_state))) if (!(blend_state_impl = unsafe_impl_from_ID3D11BlendState(blend_state)))
{
wined3d_device_set_blend_state(device->wined3d_device, NULL, wined3d_device_set_blend_state(device->wined3d_device, NULL,
(const struct wined3d_color *)blend_factor); (const struct wined3d_color *)blend_factor);
wined3d_device_set_render_state(device->wined3d_device, else
WINED3D_RS_COLORWRITEENABLE, D3D11_COLOR_WRITE_ENABLE_ALL);
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_COLORWRITEENABLE1, D3D11_COLOR_WRITE_ENABLE_ALL);
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_COLORWRITEENABLE2, D3D11_COLOR_WRITE_ENABLE_ALL);
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_COLORWRITEENABLE3, D3D11_COLOR_WRITE_ENABLE_ALL);
wined3d_mutex_unlock();
return;
}
wined3d_device_set_blend_state(device->wined3d_device, blend_state_impl->wined3d_state, wined3d_device_set_blend_state(device->wined3d_device, blend_state_impl->wined3d_state,
(const struct wined3d_color *)blend_factor); (const struct wined3d_color *)blend_factor);
desc = &blend_state_impl->desc;
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_COLORWRITEENABLE, desc->RenderTarget[0].RenderTargetWriteMask);
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_COLORWRITEENABLE1, desc->RenderTarget[1].RenderTargetWriteMask);
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_COLORWRITEENABLE2, desc->RenderTarget[2].RenderTargetWriteMask);
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_COLORWRITEENABLE3, desc->RenderTarget[3].RenderTargetWriteMask);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
} }

View File

@ -344,10 +344,6 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
tmp_desc.RenderTarget[i].BlendOpAlpha = D3D11_BLEND_OP_ADD; tmp_desc.RenderTarget[i].BlendOpAlpha = D3D11_BLEND_OP_ADD;
} }
tmp_desc.RenderTarget[i].RenderTargetWriteMask = desc->RenderTarget[j].RenderTargetWriteMask; tmp_desc.RenderTarget[i].RenderTargetWriteMask = desc->RenderTarget[j].RenderTargetWriteMask;
if (i > 3 && tmp_desc.RenderTarget[i].RenderTargetWriteMask != D3D11_COLOR_WRITE_ENABLE_ALL)
FIXME("Color mask %#x not supported for render target %u.\n",
tmp_desc.RenderTarget[i].RenderTargetWriteMask, i);
} }
wined3d_mutex_lock(); wined3d_mutex_lock();
@ -395,6 +391,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
wined3d_desc.rt[i].src_alpha = desc->RenderTarget[i].SrcBlendAlpha; wined3d_desc.rt[i].src_alpha = desc->RenderTarget[i].SrcBlendAlpha;
wined3d_desc.rt[i].dst_alpha = desc->RenderTarget[i].DestBlendAlpha; wined3d_desc.rt[i].dst_alpha = desc->RenderTarget[i].DestBlendAlpha;
wined3d_desc.rt[i].op_alpha = desc->RenderTarget[i].BlendOpAlpha; wined3d_desc.rt[i].op_alpha = desc->RenderTarget[i].BlendOpAlpha;
wined3d_desc.rt[i].writemask = desc->RenderTarget[i].RenderTargetWriteMask;
} }
/* We cannot fail after creating a wined3d_blend_state object. It /* We cannot fail after creating a wined3d_blend_state object. It

View File

@ -29819,7 +29819,6 @@ static void test_color_mask(void)
{ {
get_texture_readback(rts[i], 0, &rb); get_texture_readback(rts[i], 0, &rb);
color = get_readback_color(&rb, 320, 240, 0); color = get_readback_color(&rb, 320, 240, 0);
todo_wine_if (i >= 4)
ok(color == expected_colors[i], "%u: Got unexpected color 0x%08x.\n", i, color); ok(color == expected_colors[i], "%u: Got unexpected color 0x%08x.\n", i, color);
release_resource_readback(&rb); release_resource_readback(&rb);
} }
@ -29838,7 +29837,6 @@ static void test_color_mask(void)
{ {
get_texture_readback(rts[i], 0, &rb); get_texture_readback(rts[i], 0, &rb);
color = get_readback_color(&rb, 320, 240, 0); color = get_readback_color(&rb, 320, 240, 0);
todo_wine_if (i >= 4)
ok(color == expected_colors[0], "%u: Got unexpected color 0x%08x.\n", i, color); ok(color == expected_colors[0], "%u: Got unexpected color 0x%08x.\n", i, color);
release_resource_readback(&rb); release_resource_readback(&rb);

View File

@ -3148,6 +3148,7 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
gl_info->gl_ops.gl.p_glDisable(GL_DEPTH_TEST); gl_info->gl_ops.gl.p_glDisable(GL_DEPTH_TEST);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ZENABLE)); context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ZENABLE));
gl_info->gl_ops.gl.p_glDisable(GL_BLEND); gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
context_invalidate_state(context, STATE_BLEND); context_invalidate_state(context, STATE_BLEND);
gl_info->gl_ops.gl.p_glDisable(GL_CULL_FACE); gl_info->gl_ops.gl.p_glDisable(GL_CULL_FACE);
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST); gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
@ -3164,11 +3165,6 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB); gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE)); context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE));
} }
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
context->last_was_rhw = TRUE; context->last_was_rhw = TRUE;
context_invalidate_state(context, STATE_VDECL); /* because of last_was_rhw = TRUE */ context_invalidate_state(context, STATE_VDECL); /* because of last_was_rhw = TRUE */
@ -5158,7 +5154,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL) if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL)
continue; continue;
if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) if (!state->blend_state || state->blend_state->desc.rt[0].writemask)
{ {
wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding); wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding);
wined3d_rendertarget_view_invalidate_location(rtv, ~rtv->resource->draw_binding); wined3d_rendertarget_view_invalidate_location(rtv, ~rtv->resource->draw_binding);

View File

@ -437,10 +437,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
} }
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE)); context_invalidate_state(context, STATE_BLEND);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
gl_info->gl_ops.gl.p_glClearColor(color->r, color->g, color->b, color->a); gl_info->gl_ops.gl.p_glClearColor(color->r, color->g, color->b, color->a);
checkGLcall("glClearColor"); checkGLcall("glClearColor");
clear_mask = clear_mask | GL_COLOR_BUFFER_BIT; clear_mask = clear_mask | GL_COLOR_BUFFER_BIT;
@ -3589,6 +3586,10 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
case WINED3D_RS_SRCBLENDALPHA: case WINED3D_RS_SRCBLENDALPHA:
case WINED3D_RS_DESTBLENDALPHA: case WINED3D_RS_DESTBLENDALPHA:
case WINED3D_RS_BLENDOPALPHA: case WINED3D_RS_BLENDOPALPHA:
case WINED3D_RS_COLORWRITEENABLE:
case WINED3D_RS_COLORWRITEENABLE1:
case WINED3D_RS_COLORWRITEENABLE2:
case WINED3D_RS_COLORWRITEENABLE3:
set_blend_state = TRUE; set_blend_state = TRUE;
break; break;
@ -3676,6 +3677,26 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
desc.rt[0].dst_alpha = state->rs[WINED3D_RS_DESTBLEND]; desc.rt[0].dst_alpha = state->rs[WINED3D_RS_DESTBLEND];
desc.rt[0].op_alpha = state->rs[WINED3D_RS_BLENDOP]; desc.rt[0].op_alpha = state->rs[WINED3D_RS_BLENDOP];
} }
desc.rt[0].writemask = state->rs[WINED3D_RS_COLORWRITEENABLE];
desc.rt[1].writemask = state->rs[WINED3D_RS_COLORWRITEENABLE1];
desc.rt[2].writemask = state->rs[WINED3D_RS_COLORWRITEENABLE2];
desc.rt[3].writemask = state->rs[WINED3D_RS_COLORWRITEENABLE3];
if (desc.rt[1].writemask != desc.rt[0].writemask
|| desc.rt[2].writemask != desc.rt[0].writemask
|| desc.rt[3].writemask != desc.rt[0].writemask)
{
desc.independent = TRUE;
for (i = 1; i < 4; ++i)
{
desc.rt[i].enable = desc.rt[0].enable;
desc.rt[i].src = desc.rt[0].src;
desc.rt[i].dst = desc.rt[0].dst;
desc.rt[i].op = desc.rt[0].op;
desc.rt[i].src_alpha = desc.rt[0].src_alpha;
desc.rt[i].dst_alpha = desc.rt[0].dst_alpha;
desc.rt[i].op_alpha = desc.rt[0].op_alpha;
}
}
if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR)) if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR))
wined3d_color_from_d3dcolor(&colour, state->rs[WINED3D_RS_BLENDFACTOR]); wined3d_color_from_d3dcolor(&colour, state->rs[WINED3D_RS_BLENDFACTOR]);

View File

@ -567,6 +567,7 @@ static void blend(struct wined3d_context *context, const struct wined3d_state *s
const struct wined3d_blend_state *b = state->blend_state; const struct wined3d_blend_state *b = state->blend_state;
const struct wined3d_format *rt_format; const struct wined3d_format *rt_format;
GLenum src_blend, dst_blend; GLenum src_blend, dst_blend;
unsigned int mask;
if (gl_info->supported[ARB_MULTISAMPLE]) if (gl_info->supported[ARB_MULTISAMPLE])
{ {
@ -580,6 +581,14 @@ static void blend(struct wined3d_context *context, const struct wined3d_state *s
if (b && b->desc.independent) if (b && b->desc.independent)
WARN("Independent blend is not supported by this GL implementation.\n"); WARN("Independent blend is not supported by this GL implementation.\n");
mask = b ? b->desc.rt[0].writemask : 0xf;
gl_info->gl_ops.gl.p_glColorMask(mask & WINED3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_BLUE ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE);
checkGLcall("glColorMask");
if (!b || !is_blend_enabled(context, state, 0)) if (!b || !is_blend_enabled(context, state, 0))
{ {
gl_info->gl_ops.gl.p_glDisable(GL_BLEND); gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
@ -625,6 +634,16 @@ static void blend(struct wined3d_context *context, const struct wined3d_state *s
context_apply_state(context, state, STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP)); context_apply_state(context, state, STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP));
} }
static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DWORD mask)
{
GL_EXTCALL(glColorMaski(index,
mask & WINED3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_BLUE ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE));
checkGLcall("glColorMaski");
}
static void blend_db2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) static void blend_db2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{ {
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
@ -639,14 +658,7 @@ static void blend_db2(struct wined3d_context *context, const struct wined3d_stat
gl_info->gl_ops.gl.p_glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); gl_info->gl_ops.gl.p_glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
checkGLcall("glEnable GL_SAMPLE_ALPHA_TO_COVERAGE"); checkGLcall("glEnable GL_SAMPLE_ALPHA_TO_COVERAGE");
if (!b) if (!b || !b->desc.independent)
{
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
checkGLcall("glDisable GL_BLEND");
return;
}
if (!b->desc.independent)
{ {
blend(context, state, state_id); blend(context, state, state_id);
return; return;
@ -665,6 +677,8 @@ static void blend_db2(struct wined3d_context *context, const struct wined3d_stat
for (i = 0; i < WINED3D_MAX_RENDER_TARGETS; ++i) for (i = 0; i < WINED3D_MAX_RENDER_TARGETS; ++i)
{ {
set_color_mask(gl_info, i, b->desc.rt[i].writemask);
if (!is_blend_enabled(context, state, i)) if (!is_blend_enabled(context, state, i))
{ {
GL_EXTCALL(glDisablei(GL_BLEND, i)); GL_EXTCALL(glDisablei(GL_BLEND, i));
@ -702,14 +716,7 @@ static void blend_dbb(struct wined3d_context *context, const struct wined3d_stat
gl_info->gl_ops.gl.p_glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); gl_info->gl_ops.gl.p_glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
checkGLcall("glEnable GL_SAMPLE_ALPHA_TO_COVERAGE"); checkGLcall("glEnable GL_SAMPLE_ALPHA_TO_COVERAGE");
if (!b) if (!b || !b->desc.independent)
{
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
checkGLcall("glDisable GL_BLEND");
return;
}
if (!b->desc.independent)
{ {
blend(context, state, state_id); blend(context, state, state_id);
return; return;
@ -720,6 +727,8 @@ static void blend_dbb(struct wined3d_context *context, const struct wined3d_stat
GLenum src_blend, dst_blend, src_blend_alpha, dst_blend_alpha; GLenum src_blend, dst_blend, src_blend_alpha, dst_blend_alpha;
const struct wined3d_format *rt_format; const struct wined3d_format *rt_format;
set_color_mask(gl_info, i, b->desc.rt[i].writemask);
if (!is_blend_enabled(context, state, i)) if (!is_blend_enabled(context, state, i))
{ {
GL_EXTCALL(glDisablei(GL_BLEND, i)); GL_EXTCALL(glDisablei(GL_BLEND, i));
@ -1653,64 +1662,6 @@ static void state_debug_monitor(struct wined3d_context *context, const struct wi
WARN("token: %#x.\n", state->render_states[WINED3D_RS_DEBUGMONITORTOKEN]); WARN("token: %#x.\n", state->render_states[WINED3D_RS_DEBUGMONITORTOKEN]);
} }
static void state_colorwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
DWORD mask0 = state->render_states[WINED3D_RS_COLORWRITEENABLE];
DWORD mask1 = state->render_states[WINED3D_RS_COLORWRITEENABLE1];
DWORD mask2 = state->render_states[WINED3D_RS_COLORWRITEENABLE2];
DWORD mask3 = state->render_states[WINED3D_RS_COLORWRITEENABLE3];
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
mask0 & WINED3DCOLORWRITEENABLE_RED ? 1 : 0,
mask0 & WINED3DCOLORWRITEENABLE_GREEN ? 1 : 0,
mask0 & WINED3DCOLORWRITEENABLE_BLUE ? 1 : 0,
mask0 & WINED3DCOLORWRITEENABLE_ALPHA ? 1 : 0);
gl_info->gl_ops.gl.p_glColorMask(mask0 & WINED3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE,
mask0 & WINED3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE,
mask0 & WINED3DCOLORWRITEENABLE_BLUE ? GL_TRUE : GL_FALSE,
mask0 & WINED3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE);
checkGLcall("glColorMask(...)");
if (!((mask1 == mask0 && mask2 == mask0 && mask3 == mask0)
|| (mask1 == 0xf && mask2 == 0xf && mask3 == 0xf)))
{
FIXME("WINED3D_RS_COLORWRITEENABLE/1/2/3, %#x/%#x/%#x/%#x not yet implemented.\n",
mask0, mask1, mask2, mask3);
FIXME("Missing of cap D3DPMISCCAPS_INDEPENDENTWRITEMASKS wasn't honored?\n");
}
}
static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DWORD mask)
{
GL_EXTCALL(glColorMaski(index,
mask & WINED3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_BLUE ? GL_TRUE : GL_FALSE,
mask & WINED3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE));
checkGLcall("glColorMaski");
}
static void state_colorwrite0(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
set_color_mask(wined3d_context_gl(context)->gl_info, 0, state->render_states[WINED3D_RS_COLORWRITEENABLE]);
}
static void state_colorwrite1(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
set_color_mask(wined3d_context_gl(context)->gl_info, 1, state->render_states[WINED3D_RS_COLORWRITEENABLE1]);
}
static void state_colorwrite2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
set_color_mask(wined3d_context_gl(context)->gl_info, 2, state->render_states[WINED3D_RS_COLORWRITEENABLE2]);
}
static void state_colorwrite3(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
set_color_mask(wined3d_context_gl(context)->gl_info, 3, state->render_states[WINED3D_RS_COLORWRITEENABLE3]);
}
static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{ {
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
@ -4766,14 +4717,6 @@ const struct wined3d_state_entry_template misc_state_template[] =
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite0 }, EXT_DRAW_BUFFERS2 },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), state_colorwrite3 }, EXT_DRAW_BUFFERS2 },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE },
/* Samplers */ /* Samplers */
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE },
@ -5538,10 +5481,10 @@ static void validate_state_table(struct wined3d_state_entry *state_table)
{ 47, 47}, { 47, 47},
{ 61, 127}, { 61, 127},
{149, 150}, {149, 150},
{169, 169}, {168, 169},
{171, 171}, {171, 171},
{174, 177}, {174, 177},
{193, 193}, {190, 193},
{195, 197}, {195, 197},
{206, 209}, {206, 209},
{ 0, 0}, { 0, 0},

View File

@ -259,10 +259,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
context_invalidate_state(context, STATE_FRAMEBUFFER); context_invalidate_state(context, STATE_FRAMEBUFFER);
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE)); context_invalidate_state(context, STATE_BLEND);
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST); gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
context_invalidate_state(context, STATE_RASTERIZER); context_invalidate_state(context, STATE_RASTERIZER);

View File

@ -2040,6 +2040,7 @@ struct wined3d_blend_state_desc
enum wined3d_blend src_alpha; enum wined3d_blend src_alpha;
enum wined3d_blend dst_alpha; enum wined3d_blend dst_alpha;
enum wined3d_blend_op op_alpha; enum wined3d_blend_op op_alpha;
unsigned int writemask;
} rt[WINED3D_MAX_RENDER_TARGETS]; } rt[WINED3D_MAX_RENDER_TARGETS];
}; };