Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/d2d1/device.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index ff5caac5d8..2593413661 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -131,8 +131,6 @@ static void d2d_device_context_draw(struct d2d_device_context *render_target, en D3D10_VIEWPORT vp; HRESULT hr;
- static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; - vp.TopLeftX = 0; vp.TopLeftY = 0; vp.Width = render_target->pixel_size.width; @@ -180,7 +178,7 @@ static void d2d_device_context_draw(struct d2d_device_context *render_target, en ID3D10Device_OMSetRenderTargets(device, 1, &render_target->target->rtv, NULL); if (brush) { - ID3D10Device_OMSetBlendState(device, render_target->bs, blend_factor, D3D10_DEFAULT_SAMPLE_MASK); + ID3D10Device_OMSetBlendState(device, render_target->bs, NULL, D3D10_DEFAULT_SAMPLE_MASK); d2d_brush_bind_resources(brush, device, 0); } if (opacity_brush)
* This is a temporary patch, where the d3d9/d3d11 are still not unified
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/d3d11/device.c | 14 +++++--------- dlls/wined3d/cs.c | 6 +++++- dlls/wined3d/device.c | 17 +++++++++++++---- dlls/wined3d/state.c | 10 ++++++++++ dlls/wined3d/stateblock.c | 5 +++++ dlls/wined3d/wined3d.spec | 3 ++- dlls/wined3d/wined3d_private.h | 4 +++- include/wine/wined3d.h | 4 +++- 8 files changed, 46 insertions(+), 17 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 157ff0341a..527a2f97b6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -714,7 +714,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK, sample_mask); 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); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ALPHABLENDENABLE, FALSE); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_COLORWRITEENABLE, D3D11_COLOR_WRITE_ENABLE_ALL); @@ -728,7 +729,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi 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); desc = &blend_state_impl->desc; wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ALPHABLENDENABLE, desc->RenderTarget[0].BlendEnable); @@ -743,13 +745,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLENDALPHA, d->SrcBlendAlpha); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLENDALPHA, d->DestBlendAlpha); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOPALPHA, d->BlendOpAlpha); - - if (memcmp(blend_factor, default_blend_factor, sizeof(default_blend_factor)) - && (d->SrcBlend == D3D11_BLEND_BLEND_FACTOR || d->SrcBlend == D3D11_BLEND_INV_BLEND_FACTOR - || d->DestBlend == D3D11_BLEND_BLEND_FACTOR || d->DestBlend == D3D11_BLEND_INV_BLEND_FACTOR - || d->SrcBlendAlpha == D3D11_BLEND_BLEND_FACTOR || d->SrcBlendAlpha == D3D11_BLEND_INV_BLEND_FACTOR - || d->DestBlendAlpha == D3D11_BLEND_BLEND_FACTOR || d->DestBlendAlpha == D3D11_BLEND_INV_BLEND_FACTOR)) - FIXME("Ignoring blend factor %s.\n", debug_float4(blend_factor)); } wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_COLORWRITEENABLE, desc->RenderTarget[0].RenderTargetWriteMask); @@ -1952,6 +1947,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetBlendState(ID3D11Devi *blend_state = NULL; } memcpy(blend_factor, device->blend_factor, 4 * sizeof(*blend_factor)); + wined3d_device_get_blend_factor(device->wined3d_device, (struct wined3d_color *)blend_factor); *sample_mask = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK); wined3d_mutex_unlock(); } diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index af1dbef84c..48f043335d 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -264,6 +264,7 @@ struct wined3d_cs_set_blend_state { enum wined3d_cs_op opcode; struct wined3d_blend_state *state; + struct wined3d_color factor; };
struct wined3d_cs_set_rasterizer_state @@ -1541,16 +1542,19 @@ static void wined3d_cs_exec_set_blend_state(struct wined3d_cs *cs, const void *d const struct wined3d_cs_set_blend_state *op = data;
cs->state.blend_state = op->state; + cs->state.blend_factor = op->factor; device_invalidate_state(cs->device, STATE_BLEND); }
-void wined3d_cs_emit_set_blend_state(struct wined3d_cs *cs, struct wined3d_blend_state *state) +void wined3d_cs_emit_set_blend_state(struct wined3d_cs *cs, struct wined3d_blend_state *state, + const struct wined3d_color *blend_factor) { struct wined3d_cs_set_blend_state *op;
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_SET_BLEND_STATE; op->state = state; + op->factor = *blend_factor;
cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index abb2a89363..365a46e9d6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1968,20 +1968,29 @@ static void resolve_depth_buffer(struct wined3d_device *device) src_view->resource, src_view->sub_resource_idx, dst_resource->format->id); }
-void CDECL wined3d_device_set_blend_state(struct wined3d_device *device, struct wined3d_blend_state *blend_state) +void CDECL wined3d_device_get_blend_factor(const struct wined3d_device *device, struct wined3d_color *blend_factor) +{ + TRACE("device %p, blend_factor %s.\n", device, debug_color(&device->state.blend_factor)); + + memcpy(blend_factor, &device->state.blend_factor, sizeof(*blend_factor)); +} + +void CDECL wined3d_device_set_blend_state(struct wined3d_device *device, struct wined3d_blend_state *blend_state, + const struct wined3d_color *blend_factor) { struct wined3d_blend_state *prev;
- TRACE("device %p, blend_state %p.\n", device, blend_state); + TRACE("device %p, blend_state %p, blend_factor %s.\n", device, blend_state, debug_color(blend_factor));
prev = device->update_state->blend_state; - if (prev == blend_state) + if (prev == blend_state && !memcmp(blend_factor, &device->update_state->blend_factor, sizeof(*blend_factor))) return;
if (blend_state) wined3d_blend_state_incref(blend_state); device->update_state->blend_state = blend_state; - wined3d_cs_emit_set_blend_state(device->cs, blend_state); + device->update_state->blend_factor = *blend_factor; + wined3d_cs_emit_set_blend_state(device->cs, blend_state, blend_factor); if (prev) wined3d_blend_state_decref(prev); } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 375bc6562a..bbc2ddc9e1 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -619,6 +619,16 @@ static void state_blend_object(struct wined3d_context *context, const struct win const struct wined3d_gl_info *gl_info = context->gl_info; BOOL alpha_to_coverage = FALSE;
+ if(gl_info->supported[EXT_BLEND_COLOR]) + { + TRACE("Setting blend factor to %s.\n", debug_color(&state->blend_factor)); + + GL_EXTCALL(glBlendColor(state->blend_factor.r, state->blend_factor.g, state->blend_factor.b, state->blend_factor.a)); + checkGLcall("glBlendColor"); + } + else + WARN("Unsupported in local OpenGL implementation: glBlendColor.\n"); + if (!gl_info->supported[ARB_MULTISAMPLE]) return;
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 45a4008ac4..213b120752 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1314,6 +1314,11 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d /* TODO: Vertex offset in the presampled displacement map. */ state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0; } + + state->blend_factor.r = 1.0f; + state->blend_factor.g = 1.0f; + state->blend_factor.b = 1.0f; + state->blend_factor.a = 1.0f; }
void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 7944387bca..d958cd41c8 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -57,6 +57,7 @@ @ cdecl wined3d_device_evict_managed_resources(ptr) @ cdecl wined3d_device_get_available_texture_mem(ptr) @ cdecl wined3d_device_get_base_vertex_index(ptr) +@ cdecl wined3d_device_get_blend_factor(ptr ptr) @ cdecl wined3d_device_get_blend_state(ptr) @ cdecl wined3d_device_get_clip_plane(ptr long ptr) @ cdecl wined3d_device_get_clip_status(ptr ptr) @@ -129,7 +130,7 @@ @ cdecl wined3d_device_resolve_sub_resource(ptr ptr long ptr long long) @ cdecl wined3d_device_restore_fullscreen_window(ptr ptr ptr) @ cdecl wined3d_device_set_base_vertex_index(ptr long) -@ cdecl wined3d_device_set_blend_state(ptr ptr) +@ cdecl wined3d_device_set_blend_state(ptr ptr ptr) @ cdecl wined3d_device_set_clip_plane(ptr long ptr) @ cdecl wined3d_device_set_clip_status(ptr ptr) @ cdecl wined3d_device_set_compute_shader(ptr ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c3761860b0..afa711f033 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2934,6 +2934,7 @@ struct wined3d_state
DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; struct wined3d_blend_state *blend_state; + struct wined3d_color blend_factor; struct wined3d_rasterizer_state *rasterizer_state; };
@@ -3646,7 +3647,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; -void wined3d_cs_emit_set_blend_state(struct wined3d_cs *cs, struct wined3d_blend_state *state) DECLSPEC_HIDDEN; +void wined3d_cs_emit_set_blend_state(struct wined3d_cs *cs, struct wined3d_blend_state *state, + const struct wined3d_color *blend_factor) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index c62d3640e5..286df47c77 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2264,6 +2264,7 @@ HRESULT __cdecl wined3d_device_end_stateblock(struct wined3d_device *device, str void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device); UINT __cdecl wined3d_device_get_available_texture_mem(const struct wined3d_device *device); INT __cdecl wined3d_device_get_base_vertex_index(const struct wined3d_device *device); +void __cdecl wined3d_device_get_blend_factor(const struct wined3d_device *device, struct wined3d_color *factor); struct wined3d_blend_state * __cdecl wined3d_device_get_blend_state(const struct wined3d_device *device); HRESULT __cdecl wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, struct wined3d_vec4 *plane); @@ -2379,7 +2380,8 @@ void __cdecl wined3d_device_resolve_sub_resource(struct wined3d_device *device, void __cdecl wined3d_device_restore_fullscreen_window(struct wined3d_device *device, HWND window, const RECT *window_rect); void __cdecl wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index); -void __cdecl wined3d_device_set_blend_state(struct wined3d_device *device, struct wined3d_blend_state *blend_state); +void __cdecl wined3d_device_set_blend_state(struct wined3d_device *device, struct wined3d_blend_state *blend_state, + const struct wined3d_color *blend_factor); HRESULT __cdecl wined3d_device_set_clip_plane(struct wined3d_device *device, UINT plane_idx, const struct wined3d_vec4 *plane); HRESULT __cdecl wined3d_device_set_clip_status(struct wined3d_device *device,
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/d3d11/d3d11_private.h | 1 - dlls/d3d11/device.c | 7 ------- 2 files changed, 8 deletions(-)
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index e26554afab..771e923a5c 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -539,7 +539,6 @@ struct d3d_device struct wine_rb_tree rasterizer_states; struct wine_rb_tree sampler_states;
- float blend_factor[4]; struct d3d_depthstencil_state *depth_stencil_state; UINT stencil_ref; }; diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 527a2f97b6..fd8389f8e0 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -710,7 +710,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi blend_factor = default_blend_factor;
wined3d_mutex_lock(); - memcpy(device->blend_factor, blend_factor, 4 * sizeof(*blend_factor)); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK, sample_mask); if (!(blend_state_impl = unsafe_impl_from_ID3D11BlendState(blend_state))) { @@ -1946,7 +1945,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetBlendState(ID3D11Devi { *blend_state = NULL; } - memcpy(blend_factor, device->blend_factor, 4 * sizeof(*blend_factor)); wined3d_device_get_blend_factor(device->wined3d_device, (struct wined3d_color *)blend_factor); *sample_mask = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK); wined3d_mutex_unlock(); @@ -6186,11 +6184,6 @@ void d3d_device_init(struct d3d_device *device, void *outer_unknown) d3d11_immediate_context_init(&device->immediate_context, device); ID3D11DeviceContext1_Release(&device->immediate_context.ID3D11DeviceContext1_iface);
- device->blend_factor[0] = 1.0f; - device->blend_factor[1] = 1.0f; - device->blend_factor[2] = 1.0f; - device->blend_factor[3] = 1.0f; - wine_rb_init(&device->blend_states, d3d_blend_state_compare); wine_rb_init(&device->depthstencil_states, d3d_depthstencil_state_compare); wine_rb_init(&device->rasterizer_states, d3d_rasterizer_state_compare);
* This is to allow conversion calls to be used in d3d9
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/wined3d/wined3d_private.h | 13 ------------- include/wine/wined3d.h | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index afa711f033..dbcf17e26c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1428,19 +1428,6 @@ extern const struct wined3d_shader_backend_ops none_shader_backend DECLSPEC_HIDD
#define GL_EXTCALL(f) (gl_info->gl_ops.ext.p_##f)
-#define D3DCOLOR_B_R(dw) (((dw) >> 16) & 0xff) -#define D3DCOLOR_B_G(dw) (((dw) >> 8) & 0xff) -#define D3DCOLOR_B_B(dw) (((dw) >> 0) & 0xff) -#define D3DCOLOR_B_A(dw) (((dw) >> 24) & 0xff) - -static inline void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_color, DWORD d3d_color) -{ - wined3d_color->r = D3DCOLOR_B_R(d3d_color) / 255.0f; - wined3d_color->g = D3DCOLOR_B_G(d3d_color) / 255.0f; - wined3d_color->b = D3DCOLOR_B_B(d3d_color) / 255.0f; - wined3d_color->a = D3DCOLOR_B_A(d3d_color) / 255.0f; -} - #define HIGHEST_TRANSFORMSTATE WINED3D_TS_WORLD_MATRIX(255) /* Highest value in wined3d_transform_state. */
void wined3d_check_gl_call(const struct wined3d_gl_info *gl_info, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 286df47c77..3441fee16a 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2793,4 +2793,27 @@ static inline void wined3d_box_set(struct wined3d_box *box, unsigned int left, u box->back = back; }
+#define D3DCOLOR_B_R(dw) (((dw) >> 16) & 0xff) +#define D3DCOLOR_B_G(dw) (((dw) >> 8) & 0xff) +#define D3DCOLOR_B_B(dw) (((dw) >> 0) & 0xff) +#define D3DCOLOR_B_A(dw) (((dw) >> 24) & 0xff) + +static inline void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_color, DWORD d3d_color) +{ + wined3d_color->r = D3DCOLOR_B_R(d3d_color) / 255.0f; + wined3d_color->g = D3DCOLOR_B_G(d3d_color) / 255.0f; + wined3d_color->b = D3DCOLOR_B_B(d3d_color) / 255.0f; + wined3d_color->a = D3DCOLOR_B_A(d3d_color) / 255.0f; +} + +static inline DWORD d3dcolor_from_wined3d_color(struct wined3d_color wined3d_color) +{ + DWORD d3d_color; + d3d_color = ((DWORD)(wined3d_color.a * 255.0f + 0.5f) & 0xff) << 24; + d3d_color += ((DWORD)(wined3d_color.r * 255.0f + 0.5f) & 0xff) << 16; + d3d_color += ((DWORD)(wined3d_color.g * 255.0f + 0.5f) & 0xff) << 8; + d3d_color += ((DWORD)(wined3d_color.b * 255.0f + 0.5f) & 0xff) << 0; + return d3d_color; +} + #endif /* __WINE_WINED3D_H */
* This patch is unifying the d3d 9/10/11 blend_factors Adding blend factor to savedstate so it passes all d3d9 tests
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/d3d9/device.c | 26 ++++++++++++++++++++++++-- dlls/wined3d/device.c | 6 +++++- dlls/wined3d/state.c | 20 +------------------- dlls/wined3d/stateblock.c | 24 ++++++++++++++++++++++-- dlls/wined3d/utils.c | 1 - dlls/wined3d/wined3d_private.h | 1 + include/wine/wined3d.h | 1 - 7 files changed, 53 insertions(+), 26 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index a31360886b..3e3e643c1f 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2221,7 +2221,18 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevi TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); - wined3d_device_set_render_state(device->wined3d_device, state, value); + switch (state) + { + case D3DRS_BLENDFACTOR: + { + struct wined3d_color factor; + wined3d_color_from_d3dcolor(&factor, value); + wined3d_device_set_blend_state(device->wined3d_device, NULL, &factor); + break; + } + default: + wined3d_device_set_render_state(device->wined3d_device, state, value); + } wined3d_mutex_unlock();
return D3D_OK; @@ -2235,7 +2246,18 @@ static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface, TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
wined3d_mutex_lock(); - *value = wined3d_device_get_render_state(device->wined3d_device, state); + switch (state) + { + case D3DRS_BLENDFACTOR: + { + struct wined3d_color factor; + wined3d_device_get_blend_factor(device->wined3d_device, &factor); + *value = d3dcolor_from_wined3d_color(factor); + break; + } + default: + *value = wined3d_device_get_render_state(device->wined3d_device, state); + } wined3d_mutex_unlock();
return D3D_OK; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 365a46e9d6..9970078ac7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1982,6 +1982,9 @@ void CDECL wined3d_device_set_blend_state(struct wined3d_device *device, struct
TRACE("device %p, blend_state %p, blend_factor %s.\n", device, blend_state, debug_color(blend_factor));
+ if (device->recording) + device->recording->changed.blendState = TRUE; + prev = device->update_state->blend_state; if (prev == blend_state && !memcmp(blend_factor, &device->update_state->blend_factor, sizeof(*blend_factor))) return; @@ -1990,7 +1993,8 @@ void CDECL wined3d_device_set_blend_state(struct wined3d_device *device, struct wined3d_blend_state_incref(blend_state); device->update_state->blend_state = blend_state; device->update_state->blend_factor = *blend_factor; - wined3d_cs_emit_set_blend_state(device->cs, blend_state, blend_factor); + if (!device->recording) + wined3d_cs_emit_set_blend_state(device->cs, blend_state, blend_factor); if (prev) wined3d_blend_state_decref(prev); } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index bbc2ddc9e1..38331a0df4 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -597,23 +597,6 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st context_apply_state(context, state, STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP)); }
-static void state_blendfactor_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - WARN("Unsupported in local OpenGL implementation: glBlendColor.\n"); -} - -static void state_blendfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - const struct wined3d_gl_info *gl_info = context->gl_info; - struct wined3d_color color; - - TRACE("Setting blend factor to %#x.\n", state->render_states[WINED3D_RS_BLENDFACTOR]); - - wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_BLENDFACTOR]); - GL_EXTCALL(glBlendColor(color.r, color.g, color.b, color.a)); - checkGLcall("glBlendColor"); -} - static void state_blend_object(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -4699,8 +4682,6 @@ const struct StateEntryTemplate misc_state_template[] = { 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_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor }, EXT_BLEND_COLOR }, - { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE }, /* Samplers */ @@ -5463,6 +5444,7 @@ static void validate_state_table(struct StateEntry *state_table) {149, 150}, {169, 169}, {177, 177}, + {193, 193}, {196, 197}, { 0, 0}, }; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 213b120752..f9f55249f6 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -35,7 +35,6 @@ static const DWORD pixel_states_render[] = WINED3D_RS_ALPHAREF, WINED3D_RS_ALPHATESTENABLE, WINED3D_RS_ANTIALIASEDLINEENABLE, - WINED3D_RS_BLENDFACTOR, WINED3D_RS_BLENDOP, WINED3D_RS_BLENDOPALPHA, WINED3D_RS_BACK_STENCILFAIL, @@ -209,6 +208,7 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states, states->pixelShader = 1; states->vertexShader = 1; states->scissorRect = 1; + states->blendState = 1;
/* Fixed size arrays */ states->streamSource = 0xffff; @@ -236,6 +236,7 @@ static void stateblock_savedstates_set_pixel(struct wined3d_saved_states *states unsigned int i;
states->pixelShader = 1; + states->blendState = 1;
for (i = 0; i < ARRAY_SIZE(pixel_states_render); ++i) { @@ -839,6 +840,21 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) SetRectEmpty(stateblock->state.scissor_rects); }
+ if (stateblock->changed.blendState + && (src_state->blend_state != stateblock->state.blend_state + || memcmp(&src_state->blend_factor, &stateblock->state.blend_factor, + sizeof(stateblock->state.blend_factor)))) + { + TRACE("Updating blend state.\n"); + + if (src_state->blend_state) + wined3d_blend_state_incref(src_state->blend_state); + if (stateblock->state.blend_state) + wined3d_blend_state_decref(stateblock->state.blend_state); + stateblock->state.blend_state = src_state->blend_state; + stateblock->state.blend_factor = src_state->blend_factor; + } + map = stateblock->changed.streamSource; for (i = 0; map; map >>= 1, ++i) { @@ -1074,6 +1090,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) wined3d_device_set_scissor_rects(device, stateblock->state.scissor_rect_count, stateblock->state.scissor_rects);
+ if (stateblock->changed.blendState){ + wined3d_device_set_blend_state(device, stateblock->state.blend_state, + &stateblock->state.blend_factor); + } + map = stateblock->changed.streamSource; for (i = 0; map; map >>= 1, ++i) { @@ -1255,7 +1276,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->render_states[WINED3D_RS_COLORWRITEENABLE1] = 0x0000000f; state->render_states[WINED3D_RS_COLORWRITEENABLE2] = 0x0000000f; state->render_states[WINED3D_RS_COLORWRITEENABLE3] = 0x0000000f; - state->render_states[WINED3D_RS_BLENDFACTOR] = 0xffffffff; state->render_states[WINED3D_RS_SRGBWRITEENABLE] = 0; state->render_states[WINED3D_RS_DEPTHBIAS] = 0; state->render_states[WINED3D_RS_WRAP8] = 0; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index da01bbb0b6..3bae059a88 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4762,7 +4762,6 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE1); D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE2); D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE3); - D3DSTATE_TO_STR(WINED3D_RS_BLENDFACTOR); D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE); D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS); D3DSTATE_TO_STR(WINED3D_RS_WRAP8); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dbcf17e26c..64ae6f57e7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3492,6 +3492,7 @@ struct wined3d_saved_states DWORD pixelShader : 1; DWORD vertexShader : 1; DWORD scissorRect : 1; + DWORD blendState : 1; DWORD padding : 5; };
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 3441fee16a..e8901a9568 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -388,7 +388,6 @@ enum wined3d_render_state WINED3D_RS_COLORWRITEENABLE1 = 190, WINED3D_RS_COLORWRITEENABLE2 = 191, WINED3D_RS_COLORWRITEENABLE3 = 192, - WINED3D_RS_BLENDFACTOR = 193, WINED3D_RS_SRGBWRITEENABLE = 194, WINED3D_RS_DEPTHBIAS = 195, WINED3D_RS_WRAP8 = 198,
Am 15.10.2018 um 12:17 schrieb Daniel Ansorregui mailszeros@gmail.com:
- DWORD blendState : 1; DWORD padding : 5;
You'll have to decrease the padding size by one bit here.
* This patch is unifying the d3d 9/10/11 blend_factors Adding blend factor to savedstate so it passes all d3d9 tests
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/d3d9/device.c | 26 ++++++++++++++++++++++++-- dlls/wined3d/device.c | 6 +++++- dlls/wined3d/state.c | 20 +------------------- dlls/wined3d/stateblock.c | 24 ++++++++++++++++++++++-- dlls/wined3d/utils.c | 1 - dlls/wined3d/wined3d_private.h | 3 ++- include/wine/wined3d.h | 1 - 7 files changed, 54 insertions(+), 27 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index a31360886b..3e3e643c1f 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2221,7 +2221,18 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevi TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); - wined3d_device_set_render_state(device->wined3d_device, state, value); + switch (state) + { + case D3DRS_BLENDFACTOR: + { + struct wined3d_color factor; + wined3d_color_from_d3dcolor(&factor, value); + wined3d_device_set_blend_state(device->wined3d_device, NULL, &factor); + break; + } + default: + wined3d_device_set_render_state(device->wined3d_device, state, value); + } wined3d_mutex_unlock();
return D3D_OK; @@ -2235,7 +2246,18 @@ static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface, TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
wined3d_mutex_lock(); - *value = wined3d_device_get_render_state(device->wined3d_device, state); + switch (state) + { + case D3DRS_BLENDFACTOR: + { + struct wined3d_color factor; + wined3d_device_get_blend_factor(device->wined3d_device, &factor); + *value = d3dcolor_from_wined3d_color(factor); + break; + } + default: + *value = wined3d_device_get_render_state(device->wined3d_device, state); + } wined3d_mutex_unlock();
return D3D_OK; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 365a46e9d6..9970078ac7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1982,6 +1982,9 @@ void CDECL wined3d_device_set_blend_state(struct wined3d_device *device, struct
TRACE("device %p, blend_state %p, blend_factor %s.\n", device, blend_state, debug_color(blend_factor));
+ if (device->recording) + device->recording->changed.blendState = TRUE; + prev = device->update_state->blend_state; if (prev == blend_state && !memcmp(blend_factor, &device->update_state->blend_factor, sizeof(*blend_factor))) return; @@ -1990,7 +1993,8 @@ void CDECL wined3d_device_set_blend_state(struct wined3d_device *device, struct wined3d_blend_state_incref(blend_state); device->update_state->blend_state = blend_state; device->update_state->blend_factor = *blend_factor; - wined3d_cs_emit_set_blend_state(device->cs, blend_state, blend_factor); + if (!device->recording) + wined3d_cs_emit_set_blend_state(device->cs, blend_state, blend_factor); if (prev) wined3d_blend_state_decref(prev); } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index bbc2ddc9e1..38331a0df4 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -597,23 +597,6 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st context_apply_state(context, state, STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP)); }
-static void state_blendfactor_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - WARN("Unsupported in local OpenGL implementation: glBlendColor.\n"); -} - -static void state_blendfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - const struct wined3d_gl_info *gl_info = context->gl_info; - struct wined3d_color color; - - TRACE("Setting blend factor to %#x.\n", state->render_states[WINED3D_RS_BLENDFACTOR]); - - wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_BLENDFACTOR]); - GL_EXTCALL(glBlendColor(color.r, color.g, color.b, color.a)); - checkGLcall("glBlendColor"); -} - static void state_blend_object(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -4699,8 +4682,6 @@ const struct StateEntryTemplate misc_state_template[] = { 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_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor }, EXT_BLEND_COLOR }, - { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE }, /* Samplers */ @@ -5463,6 +5444,7 @@ static void validate_state_table(struct StateEntry *state_table) {149, 150}, {169, 169}, {177, 177}, + {193, 193}, {196, 197}, { 0, 0}, }; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 213b120752..f9f55249f6 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -35,7 +35,6 @@ static const DWORD pixel_states_render[] = WINED3D_RS_ALPHAREF, WINED3D_RS_ALPHATESTENABLE, WINED3D_RS_ANTIALIASEDLINEENABLE, - WINED3D_RS_BLENDFACTOR, WINED3D_RS_BLENDOP, WINED3D_RS_BLENDOPALPHA, WINED3D_RS_BACK_STENCILFAIL, @@ -209,6 +208,7 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states, states->pixelShader = 1; states->vertexShader = 1; states->scissorRect = 1; + states->blendState = 1;
/* Fixed size arrays */ states->streamSource = 0xffff; @@ -236,6 +236,7 @@ static void stateblock_savedstates_set_pixel(struct wined3d_saved_states *states unsigned int i;
states->pixelShader = 1; + states->blendState = 1;
for (i = 0; i < ARRAY_SIZE(pixel_states_render); ++i) { @@ -839,6 +840,21 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) SetRectEmpty(stateblock->state.scissor_rects); }
+ if (stateblock->changed.blendState + && (src_state->blend_state != stateblock->state.blend_state + || memcmp(&src_state->blend_factor, &stateblock->state.blend_factor, + sizeof(stateblock->state.blend_factor)))) + { + TRACE("Updating blend state.\n"); + + if (src_state->blend_state) + wined3d_blend_state_incref(src_state->blend_state); + if (stateblock->state.blend_state) + wined3d_blend_state_decref(stateblock->state.blend_state); + stateblock->state.blend_state = src_state->blend_state; + stateblock->state.blend_factor = src_state->blend_factor; + } + map = stateblock->changed.streamSource; for (i = 0; map; map >>= 1, ++i) { @@ -1074,6 +1090,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) wined3d_device_set_scissor_rects(device, stateblock->state.scissor_rect_count, stateblock->state.scissor_rects);
+ if (stateblock->changed.blendState){ + wined3d_device_set_blend_state(device, stateblock->state.blend_state, + &stateblock->state.blend_factor); + } + map = stateblock->changed.streamSource; for (i = 0; map; map >>= 1, ++i) { @@ -1255,7 +1276,6 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->render_states[WINED3D_RS_COLORWRITEENABLE1] = 0x0000000f; state->render_states[WINED3D_RS_COLORWRITEENABLE2] = 0x0000000f; state->render_states[WINED3D_RS_COLORWRITEENABLE3] = 0x0000000f; - state->render_states[WINED3D_RS_BLENDFACTOR] = 0xffffffff; state->render_states[WINED3D_RS_SRGBWRITEENABLE] = 0; state->render_states[WINED3D_RS_DEPTHBIAS] = 0; state->render_states[WINED3D_RS_WRAP8] = 0; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index da01bbb0b6..3bae059a88 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4762,7 +4762,6 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE1); D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE2); D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE3); - D3DSTATE_TO_STR(WINED3D_RS_BLENDFACTOR); D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE); D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS); D3DSTATE_TO_STR(WINED3D_RS_WRAP8); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dbcf17e26c..7bd7681666 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3492,7 +3492,8 @@ struct wined3d_saved_states DWORD pixelShader : 1; DWORD vertexShader : 1; DWORD scissorRect : 1; - DWORD padding : 5; + DWORD blendState : 1; + DWORD padding : 4; };
struct StageState { diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 3441fee16a..e8901a9568 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -388,7 +388,6 @@ enum wined3d_render_state WINED3D_RS_COLORWRITEENABLE1 = 190, WINED3D_RS_COLORWRITEENABLE2 = 191, WINED3D_RS_COLORWRITEENABLE3 = 192, - WINED3D_RS_BLENDFACTOR = 193, WINED3D_RS_SRGBWRITEENABLE = 194, WINED3D_RS_DEPTHBIAS = 195, WINED3D_RS_WRAP8 = 198,
Signed-off-by: Daniel Ansorregui mailszeros@gmail.com --- dlls/d3d11/tests/d3d11.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 0939990e20..74b429f6e3 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6241,7 +6241,7 @@ static void test_device_context_state(void)
static void test_blend(void) { - ID3D11BlendState *src_blend, *dst_blend; + ID3D11BlendState *src_blend, *dst_blend, *dst_blend_factor; struct d3d11_test_context test_context; ID3D11RenderTargetView *offscreen_rtv; D3D11_TEXTURE2D_DESC texture_desc; @@ -6333,7 +6333,7 @@ static void test_blend(void) {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, {"COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, }; - static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; + static const float blend_factor[] = {0.3f, 0.4f, 0.8f, 0.9f}; static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f};
if (!init_test_context(&test_context, NULL)) @@ -6374,6 +6374,14 @@ static void test_blend(void) hr = ID3D11Device_CreateBlendState(device, &blend_desc, &dst_blend); ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr);
+ blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_BLEND_FACTOR; + blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_BLEND_FACTOR; + blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_DEST_ALPHA; + blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_DEST_ALPHA; + + hr = ID3D11Device_CreateBlendState(device, &blend_desc, &dst_blend_factor); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + ID3D11DeviceContext_IASetInputLayout(context, input_layout); ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); stride = sizeof(*quads); @@ -6384,9 +6392,9 @@ static void test_blend(void)
ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
- ID3D11DeviceContext_OMSetBlendState(context, src_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_OMSetBlendState(context, src_blend, NULL, D3D11_DEFAULT_SAMPLE_MASK); ID3D11DeviceContext_Draw(context, 4, 0); - ID3D11DeviceContext_OMSetBlendState(context, dst_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_OMSetBlendState(context, dst_blend, NULL, D3D11_DEFAULT_SAMPLE_MASK); ID3D11DeviceContext_Draw(context, 4, 4);
color = get_texture_color(test_context.backbuffer, 320, 360); @@ -6394,6 +6402,17 @@ static void test_blend(void) color = get_texture_color(test_context.backbuffer, 320, 120); ok(compare_color(color, 0xa080007f, 1), "Got unexpected color 0x%08x.\n", color);
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red); + + ID3D11DeviceContext_OMSetBlendState(context, dst_blend_factor, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_Draw(context, 4, 0); + ID3D11DeviceContext_Draw(context, 4, 4); + + color = get_texture_color(test_context.backbuffer, 320, 360); + ok(compare_color(color, 0x600066b3, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 320, 120); + ok(compare_color(color, 0xa0cc00b3, 1), "Got unexpected color 0x%08x.\n", color); + texture_desc.Width = 128; texture_desc.Height = 128; texture_desc.MipLevels = 1; @@ -6422,9 +6441,9 @@ static void test_blend(void)
ID3D11DeviceContext_ClearRenderTargetView(context, offscreen_rtv, red);
- ID3D11DeviceContext_OMSetBlendState(context, src_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_OMSetBlendState(context, src_blend, NULL, D3D11_DEFAULT_SAMPLE_MASK); ID3D11DeviceContext_Draw(context, 4, 0); - ID3D11DeviceContext_OMSetBlendState(context, dst_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_OMSetBlendState(context, dst_blend, NULL, D3D11_DEFAULT_SAMPLE_MASK); ID3D11DeviceContext_Draw(context, 4, 4);
color = get_texture_color(offscreen, 64, 96) & 0x00ffffff; @@ -6435,6 +6454,7 @@ static void test_blend(void) ID3D11RenderTargetView_Release(offscreen_rtv); ID3D11Texture2D_Release(offscreen); done: + ID3D11BlendState_Release(dst_blend_factor); ID3D11BlendState_Release(dst_blend); ID3D11BlendState_Release(src_blend); ID3D11PixelShader_Release(ps);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=43167
Your paranoid android.
=== w2008s64 (64 bit Windows report) ===
d3d11: d3d11.c:5744: Test failed: Got unexpected hr 0x1.
=== debian9 (32 bit Wine report) ===
d3d11: d3d11.c:5339: Test failed: Got unexpected hr 0x8876086a for query type 4. d3d11.c:5586: Test failed: Got unexpected hr 0x8876086a.
=== debian9 (build log) ===