Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/wined3d/device.c | 2 +- dlls/wined3d/wined3d_private.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8405643741..7473b3118e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3942,7 +3942,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
for (i = 0; i < ARRAY_SIZE(state->rs); ++i) { - if (stateblock->changed.renderState[i >> 5] & (1u << (i & 0x1f))) + if (wined3d_stateblock_rs_changed(stateblock, i)) { if (i == WINED3D_RS_BLENDFACTOR) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0e1e55d52b..d0564eecbd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5327,6 +5327,11 @@ static inline void wined3d_viewport_get_z_range(const struct wined3d_viewport *v *max_z = max(vp->max_z, vp->min_z + 0.001f); }
+static inline BOOL wined3d_stateblock_rs_changed(const struct wined3d_stateblock *stateblock, DWORD state_id) +{ + return stateblock->changed.renderState[state_id >> 5] & (1u << (state_id & 0x1f)); +} + /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */ #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
Signed-off-by: Paul Gofman gofmanp@gmail.com --- v4: - fix blend_state_atoc_enabled reference leak on error path in wined3d_device_init(); - do refcounting on blend_state in state block; - rearrange blend state and _RS_BLENDFACTOR application code (mostly to simplify the next patch); - copy blend_state from stateblock to device state in wined3d_stateblock_apply().
dlls/d3d9/tests/visual.c | 2 +- dlls/wined3d/device.c | 38 +++++++++++++++--- dlls/wined3d/stateblock.c | 73 +++++++++++++++++++++++++++++++--- dlls/wined3d/wined3d_private.h | 7 +++- include/wine/wined3d.h | 1 + 5 files changed, 109 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 366862a05a..336d08513d 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26680,7 +26680,7 @@ static void test_alpha_to_coverage(void) colour = get_readback_color(&rb, 64, 64);
/* Nvidia is probably using some proprietary algorithm for averaging sample colour values. */ - todo_wine ok(color_match(colour, 0x9f404080, 1) || color_match(colour, 0x9f485cbc, 1) /* Nvidia */, + ok(color_match(colour, 0x9f404080, 1) || color_match(colour, 0x9f485cbc, 1) /* Nvidia */, "Got unexpected colour %08x.\n", colour); release_surface_readback(&rb);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 7473b3118e..6f236cd8bf 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -529,6 +529,8 @@ void wined3d_device_cleanup(struct wined3d_device *device) if (device->swapchain_count) wined3d_device_uninit_3d(device);
+ wined3d_blend_state_decref(device->blend_state_atoc_enabled); + wined3d_cs_destroy(device->cs);
for (i = 0; i < ARRAY_SIZE(device->multistate_funcs); ++i) @@ -3837,6 +3839,8 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info; const struct wined3d_stateblock_state *state = &stateblock->stateblock_state; unsigned int i, j, count; + struct wined3d_blend_state *blend_state; + struct wined3d_color color;
TRACE("device %p, stateblock %p.\n", device, stateblock);
@@ -3940,18 +3944,30 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, } }
+ if (stateblock->changed.blend_state) + { + if (wined3d_stateblock_rs_changed(stateblock, WINED3D_RS_BLENDFACTOR)) + wined3d_color_from_d3dcolor(&color, stateblock->stateblock_state.rs[WINED3D_RS_BLENDFACTOR]); + else + wined3d_device_get_blend_state(device, &color); + + wined3d_device_set_blend_state(device, state->blend_state, &color); + } + for (i = 0; i < ARRAY_SIZE(state->rs); ++i) { if (wined3d_stateblock_rs_changed(stateblock, i)) { - if (i == WINED3D_RS_BLENDFACTOR) + if (i != WINED3D_RS_BLENDFACTOR) + { + wined3d_device_set_render_state(device, i, state->rs[i]); + } + else if (!stateblock->changed.blend_state) { - struct wined3d_color color; + blend_state = wined3d_device_get_blend_state(device, &color); wined3d_color_from_d3dcolor(&color, state->rs[i]); - wined3d_device_set_blend_state(device, NULL, &color); + wined3d_device_set_blend_state(device, blend_state, &color); } - else - wined3d_device_set_render_state(device, i, state->rs[i]); } }
@@ -5759,6 +5775,7 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined struct wined3d_adapter *adapter = wined3d->adapters[adapter_idx]; const struct wined3d_fragment_pipe_ops *fragment_pipeline; const struct wined3d_vertex_pipe_ops *vertex_pipeline; + struct wined3d_blend_state_desc blend_state_desc; unsigned int i; HRESULT hr;
@@ -5813,6 +5830,17 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined goto err; }
+ memset(&blend_state_desc, 0, sizeof(blend_state_desc)); + blend_state_desc.alpha_to_coverage = TRUE; + + if (FAILED(hr = wined3d_blend_state_create(device, &blend_state_desc, + NULL, &wined3d_null_parent_ops, &device->blend_state_atoc_enabled))) + { + ERR("Could not create blend state object.\n"); + state_cleanup(&device->state); + goto err; + } + return WINED3D_OK;
err: diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 499d23fbbd..a65b3bbeee 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -209,6 +209,7 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states, states->pixelShader = 1; states->vertexShader = 1; states->scissorRect = 1; + states->blend_state = 1;
/* Fixed size arrays */ states->streamSource = 0xffff; @@ -263,6 +264,7 @@ static void stateblock_savedstates_set_vertex(struct wined3d_saved_states *state
states->vertexDecl = 1; states->vertexShader = 1; + states->blend_state = 1;
for (i = 0; i < ARRAY_SIZE(vertex_states_render); ++i) { @@ -426,6 +428,7 @@ void state_unbind_resources(struct wined3d_state *state) struct wined3d_unordered_access_view *uav; struct wined3d_shader_resource_view *srv; struct wined3d_vertex_declaration *decl; + struct wined3d_blend_state *blend_state; struct wined3d_sampler *sampler; struct wined3d_texture *texture; struct wined3d_buffer *buffer; @@ -519,12 +522,19 @@ void state_unbind_resources(struct wined3d_state *state) } } } + + if ((blend_state = state->blend_state)) + { + state->blend_state = NULL; + wined3d_blend_state_decref(blend_state); + } }
void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) { struct wined3d_light_info *light, *cursor; struct wined3d_vertex_declaration *decl; + struct wined3d_blend_state *blend_state; struct wined3d_texture *texture; struct wined3d_buffer *buffer; struct wined3d_shader *shader; @@ -580,6 +590,12 @@ void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) heap_free(light); } } + + if ((blend_state = state->blend_state)) + { + state->blend_state = NULL; + wined3d_blend_state_decref(blend_state); + } }
void state_cleanup(struct wined3d_state *state) @@ -1017,6 +1033,15 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
wined3d_state_record_lights(stateblock->stateblock_state.light_state, state->light_state);
+ if (stateblock->changed.blend_state && stateblock->stateblock_state.blend_state != state->blend_state) + { + if (state->blend_state) + wined3d_blend_state_incref(state->blend_state); + if (stateblock->stateblock_state.blend_state) + wined3d_blend_state_decref(stateblock->stateblock_state.blend_state); + stateblock->stateblock_state.blend_state = state->blend_state; + } + TRACE("Capture done.\n"); }
@@ -1025,6 +1050,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, { struct wined3d_stateblock_state *state = &device_state->stateblock_state; struct wined3d_device *device = stateblock->device; + struct wined3d_blend_state *blend_state; + struct wined3d_color color; unsigned int i; DWORD map;
@@ -1113,20 +1140,39 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, wined3d_device_set_ps_consts_b(device, idx, 1, &stateblock->stateblock_state.ps_consts_b[idx]); }
+ if (stateblock->changed.blend_state) + { + if (stateblock->stateblock_state.blend_state) + wined3d_blend_state_incref(stateblock->stateblock_state.blend_state); + if (state->blend_state) + wined3d_blend_state_decref(state->blend_state); + + state->blend_state = stateblock->stateblock_state.blend_state; + + if (wined3d_stateblock_rs_changed(stateblock, WINED3D_RS_BLENDFACTOR)) + wined3d_color_from_d3dcolor(&color, stateblock->stateblock_state.rs[WINED3D_RS_BLENDFACTOR]); + else + wined3d_device_get_blend_state(device, &color); + + wined3d_device_set_blend_state(device, stateblock->stateblock_state.blend_state, &color); + } + /* Render states. */ for (i = 0; i < stateblock->num_contained_render_states; ++i) { enum wined3d_render_state rs = stateblock->contained_render_states[i];
state->rs[rs] = stateblock->stateblock_state.rs[rs]; - if (rs == WINED3D_RS_BLENDFACTOR) + if (rs != WINED3D_RS_BLENDFACTOR) + { + wined3d_device_set_render_state(device, rs, stateblock->stateblock_state.rs[rs]); + } + else if (!stateblock->changed.blend_state) { - struct wined3d_color color; + blend_state = wined3d_device_get_blend_state(device, &color); wined3d_color_from_d3dcolor(&color, stateblock->stateblock_state.rs[rs]); - wined3d_device_set_blend_state(device, NULL, &color); + wined3d_device_set_blend_state(device, blend_state, &color); } - else - wined3d_device_set_render_state(device, rs, stateblock->stateblock_state.rs[rs]); }
/* Texture states. */ @@ -1426,6 +1472,23 @@ void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateb
stateblock->stateblock_state.rs[state] = value; stateblock->changed.renderState[state >> 5] |= 1u << (state & 0x1f); + + if (state == WINED3D_RS_POINTSIZE + && (value == WINED3D_ALPHA_TO_COVERAGE_ENABLE || value == WINED3D_ALPHA_TO_COVERAGE_DISABLE)) + { + stateblock->changed.blend_state = 1; + + if (value == WINED3D_ALPHA_TO_COVERAGE_ENABLE && !stateblock->stateblock_state.blend_state) + { + wined3d_blend_state_incref(stateblock->device->blend_state_atoc_enabled); + stateblock->stateblock_state.blend_state = stateblock->device->blend_state_atoc_enabled; + } + else if (value == WINED3D_ALPHA_TO_COVERAGE_DISABLE && stateblock->stateblock_state.blend_state) + { + wined3d_blend_state_decref(stateblock->stateblock_state.blend_state); + stateblock->stateblock_state.blend_state = NULL; + } + } }
void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d0564eecbd..378eecec32 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -76,6 +76,9 @@
#define WINED3D_MAX_DIRTY_REGION_COUNT 7
+#define WINED3D_ALPHA_TO_COVERAGE_ENABLE MAKEFOURCC('A','2','M','1') +#define WINED3D_ALPHA_TO_COVERAGE_DISABLE MAKEFOURCC('A','2','M','0') + struct wined3d_fragment_pipe_ops; struct wined3d_adapter; struct wined3d_context; @@ -3314,6 +3317,7 @@ struct wined3d_device /* Context management */ struct wined3d_context **contexts; UINT context_count; + struct wined3d_blend_state *blend_state_atoc_enabled; };
void wined3d_device_cleanup(struct wined3d_device *device) DECLSPEC_HIDDEN; @@ -3932,7 +3936,8 @@ struct wined3d_saved_states DWORD vertexShader : 1; DWORD scissorRect : 1; DWORD store_stream_offset : 1; - DWORD padding : 4; + DWORD blend_state : 1; + DWORD padding : 3; };
struct StageState { diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d313c7aec8..d783e64a26 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2168,6 +2168,7 @@ struct wined3d_stateblock_state RECT scissor_rect;
struct wined3d_light_state *light_state; + struct wined3d_blend_state *blend_state; };
struct wined3d_parent_ops
Hi,
While running your changed tests, 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=65161
Your paranoid android.
=== w8adm (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
=== w1064v1809_ja (32 bit report) ===
=== w1064v1809_zh_CN (32 bit report) ===
=== w1064v1809 (64 bit report) ===
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Signed-off-by: Paul Gofman gofmanp@gmail.com --- v4: - move the logic to stateblock application.
dlls/d3d9/tests/visual.c | 2 +- dlls/wined3d/device.c | 11 ++++++++--- dlls/wined3d/stateblock.c | 17 +++++++++++------ dlls/wined3d/utils.c | 10 ++++++++++ include/wine/wined3d.h | 1 + 5 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 336d08513d..d90f59a498 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26604,7 +26604,7 @@ static void test_alpha_to_coverage(void) ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); if (!adapter_is_amd(&identifier)) { - skip("Alpha to coverage is not supported.\n"); + win_skip("Alpha to coverage is not supported.\n"); refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D9_Release(d3d); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6f236cd8bf..d03fd20637 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3841,6 +3841,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, unsigned int i, j, count; struct wined3d_blend_state *blend_state; struct wined3d_color color; + BOOL set_blend_state;
TRACE("device %p, stateblock %p.\n", device, stateblock);
@@ -3944,14 +3945,18 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, } }
- if (stateblock->changed.blend_state) + if ((set_blend_state = stateblock->changed.blend_state + || wined3d_stateblock_rs_changed(stateblock, WINED3D_RS_ADAPTIVETESS_Y))) { + blend_state = state->rs[WINED3D_RS_ADAPTIVETESS_Y] == WINED3DFMT_ATOC + ? device->blend_state_atoc_enabled : state->blend_state; + if (wined3d_stateblock_rs_changed(stateblock, WINED3D_RS_BLENDFACTOR)) wined3d_color_from_d3dcolor(&color, stateblock->stateblock_state.rs[WINED3D_RS_BLENDFACTOR]); else wined3d_device_get_blend_state(device, &color);
- wined3d_device_set_blend_state(device, state->blend_state, &color); + wined3d_device_set_blend_state(device, blend_state, &color); }
for (i = 0; i < ARRAY_SIZE(state->rs); ++i) @@ -3962,7 +3967,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, { wined3d_device_set_render_state(device, i, state->rs[i]); } - else if (!stateblock->changed.blend_state) + else if (!set_blend_state) { blend_state = wined3d_device_get_blend_state(device, &color); wined3d_color_from_d3dcolor(&color, state->rs[i]); diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index a65b3bbeee..c15616aa73 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1052,6 +1052,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, struct wined3d_device *device = stateblock->device; struct wined3d_blend_state *blend_state; struct wined3d_color color; + BOOL set_blend_state; unsigned int i; DWORD map;
@@ -1140,21 +1141,25 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, wined3d_device_set_ps_consts_b(device, idx, 1, &stateblock->stateblock_state.ps_consts_b[idx]); }
- if (stateblock->changed.blend_state) + if ((set_blend_state = stateblock->changed.blend_state + || wined3d_stateblock_rs_changed(stateblock, WINED3D_RS_ADAPTIVETESS_Y))) { - if (stateblock->stateblock_state.blend_state) - wined3d_blend_state_incref(stateblock->stateblock_state.blend_state); + blend_state = stateblock->stateblock_state.rs[WINED3D_RS_ADAPTIVETESS_Y] == WINED3DFMT_ATOC + ? device->blend_state_atoc_enabled : stateblock->stateblock_state.blend_state; + + if (blend_state) + wined3d_blend_state_incref(blend_state); if (state->blend_state) wined3d_blend_state_decref(state->blend_state);
- state->blend_state = stateblock->stateblock_state.blend_state; + state->blend_state = blend_state;
if (wined3d_stateblock_rs_changed(stateblock, WINED3D_RS_BLENDFACTOR)) wined3d_color_from_d3dcolor(&color, stateblock->stateblock_state.rs[WINED3D_RS_BLENDFACTOR]); else wined3d_device_get_blend_state(device, &color);
- wined3d_device_set_blend_state(device, stateblock->stateblock_state.blend_state, &color); + wined3d_device_set_blend_state(device, blend_state, &color); }
/* Render states. */ @@ -1167,7 +1172,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, { wined3d_device_set_render_state(device, rs, stateblock->stateblock_state.rs[rs]); } - else if (!stateblock->changed.blend_state) + else if (!set_blend_state) { blend_state = wined3d_device_get_blend_state(device, &color); wined3d_color_from_d3dcolor(&color, stateblock->stateblock_state.rs[rs]); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index bd239d7659..f696b92214 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -65,6 +65,7 @@ format_index_remap[] = {WINED3DFMT_R16, WINED3D_FORMAT_FOURCC_BASE + 20}, {WINED3DFMT_AL16, WINED3D_FORMAT_FOURCC_BASE + 21}, {WINED3DFMT_NV12, WINED3D_FORMAT_FOURCC_BASE + 22}, + {WINED3DFMT_ATOC, WINED3D_FORMAT_FOURCC_BASE + 23}, };
#define WINED3D_FORMAT_COUNT (WINED3D_FORMAT_FOURCC_BASE + ARRAY_SIZE(format_index_remap)) @@ -135,6 +136,7 @@ static const struct wined3d_format_channels formats[] = {WINED3DFMT_ATI1N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_ATI2N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_NVDB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {WINED3DFMT_ATOC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {WINED3DFMT_INST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {WINED3DFMT_INTZ, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 8}, {WINED3DFMT_RESZ, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, @@ -339,6 +341,7 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_INST, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_NULL, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_NVDB, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_ATOC, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_RESZ, WINED3DFMT_FLAG_EXTENSION}, };
@@ -3673,6 +3676,12 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); }
+ if (gl_info->supported[ARB_MULTISAMPLE]) + { + format = get_format_gl_internal(adapter, WINED3DFMT_ATOC); + format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + } + /* RESZ aka AMD DX9-level hack for multisampled depth buffer resolve. You query for RESZ * support by checking for availability of MAKEFOURCC('R','E','S','Z') surfaces with * RENDERTARGET usage. */ @@ -4591,6 +4600,7 @@ const char *debug_d3dformat(enum wined3d_format_id format_id) FMT_TO_STR(WINED3DFMT_R16); FMT_TO_STR(WINED3DFMT_AL16); FMT_TO_STR(WINED3DFMT_NV12); + FMT_TO_STR(WINED3DFMT_ATOC); #undef FMT_TO_STR default: { diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d783e64a26..734380b0ad 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -269,6 +269,7 @@ enum wined3d_format_id WINED3DFMT_NV12 = WINEMAKEFOURCC('N','V','1','2'), WINED3DFMT_DF16 = WINEMAKEFOURCC('D','F','1','6'), WINED3DFMT_DF24 = WINEMAKEFOURCC('D','F','2','4'), + WINED3DFMT_ATOC = WINEMAKEFOURCC('A','T','O','C'),
WINED3DFMT_FORCE_DWORD = 0xffffffff };
Hi,
While running your changed tests, 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=65162
Your paranoid android.
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
=== w1064v1809_ja (32 bit report) ===
=== w1064v1809_zh_CN (32 bit report) ===
=== w1064v1809 (64 bit report) ===
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/d3d9/tests/visual.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index d90f59a498..ccbea1d50a 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26560,6 +26560,7 @@ static void test_alpha_to_coverage(void) D3DADAPTER_IDENTIFIER9 identifier; struct surface_readback rb; IDirect3DTexture9 *texture; + IDirect3DStateBlock9 *sb; IDirect3DDevice9 *device; DWORD quality_levels; BOOL nvidia_mode; @@ -26669,6 +26670,9 @@ static void test_alpha_to_coverage(void) ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); }
+ hr = IDirect3DDevice9_CreateStateBlock(device, D3DSBT_VERTEXSTATE, &sb); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + fill_surface(surface, 0x40608000, 0);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); @@ -26705,6 +26709,23 @@ static void test_alpha_to_coverage(void) ok(colour == 0x40608000, "Got unexpected colour %08x.\n", colour); release_surface_readback(&rb);
+ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff2000ff, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + IDirect3DStateBlock9_Apply(sb); + IDirect3DStateBlock9_Release(sb); + + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_StretchRect(device, ms_rt, NULL, rt, NULL, D3DTEXF_POINT); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + get_rt_readback(rt, &rb); + colour = get_readback_color(&rb, 64, 64); + ok(color_match(colour, 0x9f404080, 1) || color_match(colour, 0x9f485cbc, 1) /* Nvidia */, + "Got unexpected colour %08x.\n", colour); + release_surface_readback(&rb); + hr = IDirect3DDevice9_EndScene(device); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
Hi,
While running your changed tests, 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=65163
Your paranoid android.
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
=== w1064v1809_ja (32 bit report) ===
=== w1064v1809_zh_CN (32 bit report) ===
=== w1064v1809 (64 bit report) ===
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Otherwise if Wine exposes ATOC format the test will always trigger Nvidia path regardless of reported GPU.
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/d3d9/tests/visual.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index ccbea1d50a..cc14f54155 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26591,19 +26591,20 @@ static void test_alpha_to_coverage(void) return; }
- if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_SURFACE, MAKEFOURCC('A','T','O','C')) == D3D_OK) + + hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + if (adapter_is_amd(&identifier)) { - /* ATOC pseudo format is introduced by Nvidia. Some Intel GPUs support - * alpha to coverage the same way as Nvidia. */ - nvidia_mode = TRUE; + nvidia_mode = FALSE; } else { - nvidia_mode = FALSE; - hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - if (!adapter_is_amd(&identifier)) + /* ATOC pseudo format is introduced by Nvidia. Some Intel GPUs support + * alpha to coverage the same way as Nvidia. */ + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, + D3DRTYPE_SURFACE, MAKEFOURCC('A','T','O','C')) != D3D_OK) { win_skip("Alpha to coverage is not supported.\n"); refcount = IDirect3DDevice9_Release(device); @@ -26612,6 +26613,7 @@ static void test_alpha_to_coverage(void) DestroyWindow(window); return; } + nvidia_mode = TRUE; }
hr = IDirect3DDevice9_CreateRenderTarget(device, 128, 128,
Hi,
While running your changed tests, 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=65164
Your paranoid android.
=== w864 (32 bit report) ===
d3d9: visual.c:8805: Test failed: Input test: Quad 3(2crd-wrongidx) returned color 0x00ff00ff, expected 0x00ff0080
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
=== w1064v1809_ja (32 bit report) ===
=== w1064v1809_zh_CN (32 bit report) ===
=== w1064v1809 (64 bit report) ===
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===