This fixes stray lines in GameFace GUIs, e.g. in World of Tanks.
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
The ddraw tests started succeeding in the todo block for a few of the tested pixels. I looked at the output results and I don't think it happened because the Z values are more precise now. I think a few bits flipped (in the random readback we get) and now a few of those tests were inside the expected diff. --- dlls/d3d11/tests/d3d11.c | 1 - dlls/ddraw/tests/ddraw4.c | 6 +- dlls/ddraw/tests/ddraw7.c | 6 +- dlls/wined3d/adapter_gl.c | 40 +++++++++++ dlls/wined3d/state.c | 3 +- dlls/wined3d/utils.c | 127 +++++++++++++++++++++++++++++---- dlls/wined3d/wined3d_private.h | 13 +++- 7 files changed, 176 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ae3020e130d..e08408b4884 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -28155,7 +28155,6 @@ static void test_fractional_viewports(void) ok(compare_float(v->x, expected.x, 0) && compare_float(v->y, expected.y, 0), "Got fragcoord {%.8e, %.8e}, expected {%.8e, %.8e} at (%u, %u), offset %.8e.\n", v->x, v->y, expected.x, expected.y, x, y, viewport_offsets[i]); - todo_wine ok(compare_float(v->z, expected.z, 2) && compare_float(v->w, expected.w, 2), "Got texcoord {%.8e, %.8e}, expected {%.8e, %.8e} at (%u, %u), offset %.8e.\n", v->z, v->w, expected.z, expected.w, x, y, viewport_offsets[i]); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 6b514b15e25..4f052256882 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -16118,8 +16118,10 @@ static void test_depth_readback(void) /* The ddraw4 version of this test behaves similarly to the ddraw7 version on Nvidia GPUs, * except that Geforce 7 also returns garbage data in D24S8, whereas the ddraw7 version * returns 0 for that format. Give up on pre-filtering formats, accept Nvidia as generally - * broken here, but still expect at least one format (D16 or D24X8 in practise) to pass. */ - todo_wine_if(tests[i].todo) + * broken here, but still expect at least one format (D16 or D24X8 in practise) to pass. + * + * Some of the tested places pass on some GPUs on Wine by accident. */ + todo_wine_if(tests[i].todo && !compare_uint(expected_depth, depth, max_diff)) ok(compare_uint(expected_depth, depth, max_diff) || ddraw_is_nvidia(ddraw), "Test %u: Got depth 0x%08x (diff %d), expected 0x%08x+/-%u, at %u, %u.\n", i, depth, expected_depth - depth, expected_depth, max_diff, x, y); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 4c42d6f4b64..4402f2d93b5 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -15597,8 +15597,10 @@ static void test_depth_readback(void) * Geforce GTX 650 has working D16 and D24, but D24S8 returns 0. * * Arx Fatalis is broken on the Geforce 9 in the same way it was broken in Wine (bug 43654). - * The !tests[i].s_depth is supposed to rule out D16 on GF9 and D24X8 on GF7. */ - todo_wine_if(tests[i].todo) + * The !tests[i].s_depth is supposed to rule out D16 on GF9 and D24X8 on GF7. + * + * Some of the tested places pass on some GPUs on Wine by accident. */ + todo_wine_if(tests[i].todo && !compare_uint(expected_depth, depth, max_diff)) ok(compare_uint(expected_depth, depth, max_diff) || (ddraw_is_nvidia(ddraw) && (all_zero || all_one || !tests[i].s_depth)), "Test %u: Got depth 0x%08x (diff %d), expected 0x%08x+/-%u, at %u, %u.\n", diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 902b9620f30..72f46693274 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -5130,6 +5130,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->full_ffp_varyings = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_FULL_FFP_VARYINGS); d3d_info->scaled_resolve = !!gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED]; d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps); + d3d_info->filling_convention_nudge = gl_info->filling_convention_nudge;
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) d3d_info->multisample_draw_location = WINED3D_LOCATION_TEXTURE_RGB; @@ -5137,6 +5138,43 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->multisample_draw_location = WINED3D_LOCATION_RB_MULTISAMPLE; }
+static float wined3d_adapter_find_fill_nudge(struct wined3d_caps_gl_ctx *ctx) +{ + static const float test_array[] = + { + 0.0f, + -1.0f / 1024.0f, + -1.0f / 512.0f, + -1.0f / 256.0f, + -1.0f / 128.0f, + -1.0f / 64.0f /* Accept this without a warning if it gets the right result. */ + }; + /* This value was used unconditionally before the dynamic test function was + * introduced. */ + static const float no_clue = -1.0f / 64.0f; + unsigned int i; + float value; + + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) + return no_clue; + + for (i = 0; i < ARRAY_SIZE(test_array); ++i) + { + value = test_array[i]; + if (wined3d_caps_gl_ctx_test_filling_convention(ctx, value)) + { + if (value) + WARN("Using a filling convention fixup nudge of -1/%f\n", -1.0f / value); + else + TRACE("No need for a filling convetion nudge.\n"); + return value; + } + } + + FIXME("Did not find a way to get the filling convention we want.\n"); + return no_clue; +} + static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl, unsigned int ordinal, unsigned int wined3d_creation_flags) { @@ -5222,6 +5260,8 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl, return FALSE; }
+ gl_info->filling_convention_nudge = wined3d_adapter_find_fill_nudge(&caps_gl_ctx); + wined3d_adapter_gl_init_d3d_info(adapter_gl, wined3d_creation_flags);
if (!adapter_gl->a.d3d_info.shader_color_key) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 8316269afcf..5c1c69fb650 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4233,13 +4233,14 @@ static void viewport_miscpart_cc(struct wined3d_context *context, const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; /* See get_projection_matrix() in utils.c for a discussion about those values. */ float pixel_center_offset = context->d3d_info->wined3d_creation_flags - & WINED3D_PIXEL_CENTER_INTEGER ? 63.0f / 128.0f : -1.0f / 128.0f; + & WINED3D_PIXEL_CENTER_INTEGER ? 0.5f : 0.0f; struct wined3d_viewport vp[WINED3D_MAX_VIEWPORTS]; GLdouble depth_ranges[2 * WINED3D_MAX_VIEWPORTS]; GLfloat viewports[4 * WINED3D_MAX_VIEWPORTS]; unsigned int i, reset_count = 0; float min_z, max_z;
+ pixel_center_offset += context->d3d_info->filling_convention_nudge / 2.0f; get_viewports(context, state, state->viewport_count, vp);
GL_EXTCALL(glClipControl(context->render_offscreen ? GL_UPPER_LEFT : GL_LOWER_LEFT, GL_ZERO_TO_ONE)); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 4019dd4d812..38704db2f35 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3928,6 +3928,105 @@ BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx return TRUE; }
+BOOL wined3d_caps_gl_ctx_test_filling_convention(struct wined3d_caps_gl_ctx *ctx, float nudge) +{ + static const struct wined3d_color red = {1.0f, 0.0f, 0.0f, 1.0f}; + const struct wined3d_gl_info *gl_info = ctx->gl_info; + GLuint texture, fbo; + DWORD readback[8][8]; + unsigned int x, y; + + /* This is a very simple test to find out how GL handles pixel edges: + * Draw a quad exactly between 4 pixels in an 8x8 viewport and see + * which pixel it ends up in. So far we've seen top left and bottom + * left conventions. This test may produce unexpected results if the + * driver forces multisampling on us. + * + * If we find a bottom-left filling behavior we also nudge the x axis + * by the same amount. This is necessary to keep diagonals that go + * through the pixel center intact. + * + * Note that we are ignoring some settings that might influence the + * driver: How we switch GL to a upper-left coordinate system, if we + * are drawing into the on-screen framebuffer (we don't have one here + * because our window is hidden), shaders vs fixed function GL. + * Testing these isn't possible with the current draw_test_quad() + * infrastructure. + * + * The minimum nudge also depends on the viewport size, although + * the relation between those two is GPU dependent and not exactly + * sensible. E.g. a 8192x8192 viewport on a GeForce 9 needs at + * least a nudge of 1/240.9, whereas a 8x8 one needs 1/255.982; + * 32x32 needs 1/255.935. 4x4 and lower are happy with something + * below 1/256. The 8x8 size below has been arbitrarily chosen to + * get a useful result out of that card and avoid allocating a + * gigantic texture during library init. + * + * Newer cards usually do the right thing anyway. In cases where + * they do not (e.g. Radeon GPUs in a macbookpro14,3 running MacOS) + * a nudge of 1/2^20 is enough. */ + const struct wined3d_vec3 edge_geometry[] = + { + {(-1.0f + nudge) / 8.0f, (-1.0f + nudge) / 8.0f, 0.0f}, + {( 1.0f + nudge) / 8.0f, (-1.0f + nudge) / 8.0f, 0.0f}, + {(-1.0f + nudge) / 8.0f, ( 1.0f + nudge) / 8.0f, 0.0f}, + {( 1.0f + nudge) / 8.0f, ( 1.0f + nudge) / 8.0f, 0.0f}, + }; + + gl_info->gl_ops.gl.p_glGenTextures(1, &texture); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, texture); + gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); + gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 8, 8, 0, + GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); + gl_info->fbo_ops.glGenFramebuffers(1, &fbo); + gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo); + gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, texture, 0); + checkGLcall("create resources"); + + gl_info->gl_ops.gl.p_glViewport(0, 0, 8, 8); + gl_info->gl_ops.gl.p_glClearColor(0.0f, 0.0f, 1.0f, 1.0f); + gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT); + + draw_test_quad(ctx, edge_geometry, &red); + checkGLcall("draw"); + + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, texture); + gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, + GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, readback); + checkGLcall("readback"); + + gl_info->gl_ops.gl.p_glDeleteTextures(1, &texture); + gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo); + gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0); + checkGLcall("delete resources"); + + if (readback[3][3] == 0xffff0000 && readback[3][4] == 0xff0000ff + && readback[4][3] == 0xff0000ff && readback[4][4] == 0xff0000ff) + { + TRACE("Got the expected filling result.\n"); + return TRUE; + } + else if (readback[3][3] == 0xff0000ff && readback[3][4] == 0xff0000ff + && readback[4][3] == 0xffff0000 && readback[4][4] == 0xff0000ff) + { + WARN("GPU uses a bottom-left filling convention in FBOs.\n"); + return FALSE; + } + + FIXME("Unexpected filling convention test result\n"); + + for (y = 0; y < ARRAY_SIZE(readback); ++y) + { + for (x = 0; x < ARRAY_SIZE(readback[0]); ++x) + { + FIXME("0x%08x ", readback[y][x]); + } + FIXME("\n"); + } + + return FALSE; +} static float wined3d_adapter_find_polyoffset_scale(struct wined3d_caps_gl_ctx *ctx, GLenum format) { const struct wined3d_gl_info *gl_info = ctx->gl_info; @@ -5540,22 +5639,26 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w * - We need to flip along the y-axis in case of offscreen rendering. * - OpenGL Z range is {-Wc,...,Wc} while D3D Z range is {0,...,Wc}. * - <= D3D9 coordinates refer to pixel centers while GL coordinates - * refer to pixel corners. - * - D3D has a top-left filling convention. We need to maintain this - * even after the y-flip mentioned above. - * In order to handle the last two points, we translate by - * (63.0 / 128.0) / VPw and (63.0 / 128.0) / VPh. This is equivalent to - * translating slightly less than half a pixel. We want the difference to - * be large enough that it doesn't get lost due to rounding inside the - * driver, but small enough to prevent it from interfering with any - * anti-aliasing. */ + * refer to pixel corners. D3D10 fixed this particular oddity. + * - D3D has a top-left filling convention while GL does not specify + * a particular behavior, other than that that the GL implementation + * needs to be consistent. + * + * In order to handle the pixel center, we translate by 0.5 / VPw and + * 0.5 / VPh. We test the filling convention during adapter init and + * add a small offset to correct it if necessary. See + * wined3d_caps_gl_ctx_test_filling_convention for more details on how + * we test GL and considerations regarding the added nudge value. + * + * If we have GL_ARB_clip_control we take care of all this through + * viewport properties and don't have to translate geometry. */
clip_control = d3d_info->clip_control; flip = !clip_control && context->render_offscreen; - if (!clip_control && d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER) - center_offset = 63.0f / 64.0f; + if (!clip_control) + center_offset = 1.0f + d3d_info->filling_convention_nudge; else - center_offset = -1.0f / 64.0f; + center_offset = 0.0f;
if (context->last_was_rhw) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 86c053df0db..f305829475e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -242,6 +242,8 @@ struct wined3d_d3d_info enum wined3d_feature_level feature_level;
DWORD multisample_draw_location; + + float filling_convention_nudge; };
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY = @@ -3239,6 +3241,7 @@ struct wined3d_gl_info DWORD quirks; BOOL supported[WINED3D_GL_EXT_COUNT]; GLint wrap_lookup[WINED3D_TADDRESS_MIRROR_ONCE - WINED3D_TADDRESS_WRAP + 1]; + float filling_convention_nudge;
HGLRC (WINAPI *p_wglCreateContextAttribsARB)(HDC dc, HGLRC share, const GLint *attribs); struct opengl_funcs gl_ops; @@ -3487,6 +3490,7 @@ BOOL wined3d_adapter_vk_init_format_info(struct wined3d_adapter_vk *adapter_vk, UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount) DECLSPEC_HIDDEN;
BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN; +BOOL wined3d_caps_gl_ctx_test_filling_convention(struct wined3d_caps_gl_ctx *ctx, float nudge) DECLSPEC_HIDDEN;
void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext) DECLSPEC_HIDDEN;
@@ -5660,10 +5664,15 @@ static inline void shader_get_position_fixup(const struct wined3d_context *conte float center_offset; unsigned int i;
+ /* See get_projection_matrix() in utils.c for a discussion of the position fixup. + * This function here also applies to d3d10+ which does not need adjustment for + * integer pixel centers, but it may need the filling convention nudge. */ if (context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER) - center_offset = 63.0f / 64.0f; + center_offset = 1.0f; else - center_offset = -1.0f / 64.0f; + center_offset = 0.0f; + + center_offset += context->d3d_info->filling_convention_nudge;
for (i = 0; i < fixup_count; ++i) {
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
There is a certain overlap between this test and test_[fractional_]viewport. This test explicitly tests which fragment lights up and how diagonals that are hit by two triangles are handled, whereas test_viewport checks for a mismatch between fragment location and position of that fragment inside the triangle. Both tests are worth having IMO.
I'll port it to ddraw-d3d11 once the merits of the test and geometry nudge have been agreed upon. --- dlls/d3d9/tests/visual.c | 487 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 487 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 40585d5257d..dcb8709ab98 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26912,6 +26912,492 @@ static void test_sample_mask(void) DestroyWindow(window); }
+static void test_filling_convention(void) +{ + static const DWORD colour_bottom = 0x00ffff00; + static const DWORD colour_clear = 0x000000ff; + static const DWORD colour_right = 0x00000000; + static const DWORD colour_left = 0x00ff0000; + static const DWORD colour_top = 0x0000ff00; + IDirect3DSurface9 *rt, *backbuffer, *cur; + IDirect3DVertexShader9 *shader = NULL; + struct surface_readback rb; + IDirect3DDevice9 *device; + unsigned int i, j, x, y; + DWORD colour, expected; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + BOOL todo; + + static const unsigned int vp_size = 8; + const D3DVIEWPORT9 vp = { 0, 0, vp_size, vp_size, 0.0, 1.0 }; + static const DWORD vs_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x0000001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0000001f, 0x8000000a, 0x900f0001, /* dcl_color0 v1 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x00000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ + 0x0000ffff /* end */ + }; + + /* This test data follows the examples in MSDN's + * "Rasterization Rules (Direct3D 9)" article at + * https://docs.microsoft.com/en-us/windows/win32/direct3d9/rasterization-rules */ + static const float eps = 1.0f / 512.0f; + const struct + { + struct vec3 position; + DWORD diffuse; + } + center_tris[] = + { + /* left */ + {{-2.5f / 4.0f, -1.5f / 4.0f, 0.0f}, colour_left}, + {{-2.5f / 4.0f, 2.5f / 4.0f, 0.0f}, colour_left}, + {{-1.5f / 4.0f, 0.5f / 4.0f, 0.0f}, colour_left}, + + /* top */ + {{-1.5f / 4.0f, 0.5f / 4.0f, 0.0f}, colour_top}, + {{-2.5f / 4.0f, 2.5f / 4.0f, 0.0f}, colour_top}, + {{-0.5f / 4.0f, 2.5f / 4.0f, 0.0f}, colour_top}, + + /* right */ + {{-0.5f / 4.0f, -1.5f / 4.0f, 0.0f}, colour_right}, + {{-1.5f / 4.0f, 0.5f / 4.0f, 0.0f}, colour_right}, + {{-0.5f / 4.0f, 2.5f / 4.0f, 0.0f}, colour_right}, + + /* bottom */ + {{-2.5f / 4.0f, -1.5f / 4.0f, 0.0f}, colour_bottom}, + {{-1.5f / 4.0f, 0.5f / 4.0f, 0.0f}, colour_bottom}, + {{-0.5f / 4.0f, -1.5f / 4.0f, 0.0f}, colour_bottom}, + + }, + edge_tris[] = + { + /* left */ + {{-2.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_left}, + {{-2.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_left}, + {{-1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_left}, + + /* top */ + {{-1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_top}, + {{-2.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_top}, + {{ 0.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_top}, + + /* right */ + {{ 0.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_right}, + {{-1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_right}, + {{ 0.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_right}, + + /* bottom */ + {{-2.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_bottom}, + {{-1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_bottom}, + {{ 0.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_bottom}, + }, + nudge_right_tris[] = + { + /* left */ + {{eps - 2.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_left}, + {{eps - 2.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_left}, + {{eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_left}, + + /* top */ + {{eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_top}, + {{eps - 2.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_top}, + {{eps - 0.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_top}, + + /* right */ + {{eps - 0.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_right}, + {{eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_right}, + {{eps - 0.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_right}, + + /* bottom */ + {{eps - 2.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_bottom}, + {{eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_bottom}, + {{eps - 0.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_bottom}, + }, + nudge_left_tris[] = + { + {{-eps - 2.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_left}, + {{-eps - 2.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_left}, + {{-eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_left}, + + /* top */ + {{-eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_top}, + {{-eps - 2.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_top}, + {{-eps - 0.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_top}, + + /* right */ + {{-eps - 0.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_right}, + {{-eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_right}, + {{-eps - 0.0f / 4.0f, 3.0f / 4.0f, 0.0f}, colour_right}, + + /* bottom */ + {{-eps - 2.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_bottom}, + {{-eps - 1.0f / 4.0f, 1.0f / 4.0f, 0.0f}, colour_bottom}, + {{-eps - 0.0f / 4.0f, -1.0f / 4.0f, 0.0f}, colour_bottom}, + }, + nudge_top_tris[] = + { + /* left */ + {{-2.0f / 4.0f, eps - 1.0f / 4.0f, 0.0f}, colour_left}, + {{-2.0f / 4.0f, eps + 3.0f / 4.0f, 0.0f}, colour_left}, + {{-1.0f / 4.0f, eps + 1.0f / 4.0f, 0.0f}, colour_left}, + + /* top */ + {{-1.0f / 4.0f, eps + 1.0f / 4.0f, 0.0f}, colour_top}, + {{-2.0f / 4.0f, eps + 3.0f / 4.0f, 0.0f}, colour_top}, + {{ 0.0f / 4.0f, eps + 3.0f / 4.0f, 0.0f}, colour_top}, + + /* right */ + {{ 0.0f / 4.0f, eps - 1.0f / 4.0f, 0.0f}, colour_right}, + {{-1.0f / 4.0f, eps + 1.0f / 4.0f, 0.0f}, colour_right}, + {{ 0.0f / 4.0f, eps + 3.0f / 4.0f, 0.0f}, colour_right}, + + /* bottom */ + {{-2.0f / 4.0f, eps - 1.0f / 4.0f, 0.0f}, colour_bottom}, + {{-1.0f / 4.0f, eps + 1.0f / 4.0f, 0.0f}, colour_bottom}, + {{ 0.0f / 4.0f, eps - 1.0f / 4.0f, 0.0f}, colour_bottom}, + }, + nudge_bottom_tris[] = + { + /* left */ + {{-2.0f / 4.0f, -eps - 1.0f / 4.0f, 0.0f}, colour_left}, + {{-2.0f / 4.0f, -eps + 3.0f / 4.0f, 0.0f}, colour_left}, + {{-1.0f / 4.0f, -eps + 1.0f / 4.0f, 0.0f}, colour_left}, + + /* top */ + {{-1.0f / 4.0f, -eps + 1.0f / 4.0f, 0.0f}, colour_top}, + {{-2.0f / 4.0f, -eps + 3.0f / 4.0f, 0.0f}, colour_top}, + {{ 0.0f / 4.0f, -eps + 3.0f / 4.0f, 0.0f}, colour_top}, + + /* right */ + {{ 0.0f / 4.0f, -eps - 1.0f / 4.0f, 0.0f}, colour_right}, + {{-1.0f / 4.0f, -eps + 1.0f / 4.0f, 0.0f}, colour_right}, + {{ 0.0f / 4.0f, -eps + 3.0f / 4.0f, 0.0f}, colour_right}, + + /* bottom */ + {{-2.0f / 4.0f, -eps - 1.0f / 4.0f, 0.0f}, colour_bottom}, + {{-1.0f / 4.0f, -eps + 1.0f / 4.0f, 0.0f}, colour_bottom}, + {{ 0.0f / 4.0f, -eps - 1.0f / 4.0f, 0.0f}, colour_bottom}, + }; + + /* FIXME: Is the POSITIONT coord system flipped vs the regular one? */ + const struct + { + struct vec4 position; + DWORD diffuse; + } + center_tris_t[] = + { + /* left */ + {{ 1.5f, 1.5f, 0.0f, 1.0f}, colour_left}, + {{ 2.5f, 3.5f, 0.0f, 1.0f}, colour_left}, + {{ 1.5f, 5.5f, 0.0f, 1.0f}, colour_left}, + + /* top */ + {{ 1.5f, 1.5f, 0.0f, 1.0f}, colour_top}, + {{ 3.5f, 1.5f, 0.0f, 1.0f}, colour_top}, + {{ 2.5f, 3.5f, 0.0f, 1.0f}, colour_top}, + + /* right */ + {{ 3.5f, 1.5f, 0.0f, 1.0f}, colour_right}, + {{ 3.5f, 5.5f, 0.0f, 1.0f}, colour_right}, + {{ 2.5f, 3.5f, 0.0f, 1.0f}, colour_right}, + + /* bottom */ + {{ 2.5f, 3.5f, 0.0f, 1.0f}, colour_bottom}, + {{ 3.5f, 5.5f, 0.0f, 1.0f}, colour_bottom}, + {{ 1.5f, 5.5f, 0.0f, 1.0f}, colour_bottom}, + }, + edge_tris_t[] = + { + /* left */ + {{ 2.0f, 1.0f, 0.0f, 1.0f}, colour_left}, + {{ 3.0f, 3.0f, 0.0f, 1.0f}, colour_left}, + {{ 2.0f, 5.0f, 0.0f, 1.0f}, colour_left}, + + /* top */ + {{ 2.0f, 1.0f, 0.0f, 1.0f}, colour_top}, + {{ 4.0f, 1.0f, 0.0f, 1.0f}, colour_top}, + {{ 3.0f, 3.0f, 0.0f, 1.0f}, colour_top}, + + /* right */ + {{ 4.0f, 1.0f, 0.0f, 1.0f}, colour_right}, + {{ 4.0f, 5.0f, 0.0f, 1.0f}, colour_right}, + {{ 3.0f, 3.0f, 0.0f, 1.0f}, colour_right}, + + /* bottom */ + {{ 3.0f, 3.0f, 0.0f, 1.0f}, colour_bottom}, + {{ 4.0f, 5.0f, 0.0f, 1.0f}, colour_bottom}, + {{ 2.0f, 5.0f, 0.0f, 1.0f}, colour_bottom}, + }; + + const struct + { + const void *geometry; + size_t stride; + DWORD fvf; + const char *expected[8]; + } + tests[] = + { + { + center_tris, + sizeof(center_tris[0]), + D3DFVF_XYZ | D3DFVF_DIFFUSE, + { + " ", + " ", + " TT ", + " LR ", + " LR ", + " BB ", + " ", + " " + } + }, + { + edge_tris, + sizeof(edge_tris[0]), + D3DFVF_XYZ | D3DFVF_DIFFUSE, + { + " ", + " TT ", + " LT ", + " LR ", + " LB ", + " ", + " ", + " " + } + }, + { + nudge_right_tris, + sizeof(nudge_right_tris[0]), + D3DFVF_XYZ | D3DFVF_DIFFUSE, + { + " ", + " TT ", + " TR ", + " LR ", + " BR ", + " ", + " ", + " " + } + }, + { + nudge_left_tris, + sizeof(nudge_left_tris[0]), + D3DFVF_XYZ | D3DFVF_DIFFUSE, + { + " ", + " TT ", + " LT ", + " LR ", + " LB ", + " ", + " ", + " " + } + }, + { + nudge_top_tris, + sizeof(nudge_top_tris[0]), + D3DFVF_XYZ | D3DFVF_DIFFUSE, + { + " ", + " LT ", + " LT ", + " LB ", + " LB ", + " ", + " ", + " " + } + }, + { + nudge_bottom_tris, + sizeof(nudge_bottom_tris[0]), + D3DFVF_XYZ | D3DFVF_DIFFUSE, + { + " ", + " ", + " LT ", + " Lt ", + " LB ", + " lB ", + " ", + " " + } + }, + { + center_tris_t, + sizeof(center_tris_t[0]), + D3DFVF_XYZRHW | D3DFVF_DIFFUSE, + { + " ", + " ", + " TT ", + " LR ", + " LR ", + " BB ", + " ", + " " + } + }, + { + edge_tris_t, + sizeof(edge_tris_t[0]), + D3DFVF_XYZRHW | D3DFVF_DIFFUSE, + { + " ", + " TT ", + " LT ", + " LR ", + " LB ", + " ", + " ", + " " + } + }, + }; + + window = create_window(); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a 3D device.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateRenderTarget(device, vp_size, vp_size, + D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, FALSE, &rt, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + if (caps.VertexShaderVersion >= D3DVS_VERSION(1, 1)) + { + hr = IDirect3DDevice9_CreateVertexShader(device, vs_code, &shader); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + else + skip("Skipping vertex shader codepath in filling convention test.\n"); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + hr = IDirect3DDevice9_SetFVF(device, tests[i].fvf); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Run tests with shader and fixed function vertex processing if shaders are + * supported. There's no point in running the XYZRHW tests with a VS though. */ + if (shader && ((tests[i].fvf & D3DFVF_POSITION_MASK) == D3DFVF_XYZ)) + j = 0; + else + j = 2; + + for (; j < 4; ++j) + { + cur = (j & 1) ? rt : backbuffer; + + hr = IDirect3DDevice9_SetVertexShader(device, (j & 2) ? NULL : shader); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, cur); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, colour_clear, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetViewport(device, &vp); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 4, tests[i].geometry, tests[i].stride); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + get_rt_readback(cur, &rb); + for (y = 0; y < 8; y++) + { + for (x = 0; x < 8; x++) + { + todo = FALSE; + switch (tests[i].expected[y][x]) + { + case 'l': todo = TRUE; + case 'L': + expected = colour_left; + break; + case 't': todo = TRUE; + case 'T': + expected = colour_top; + break; + case 'r': todo = TRUE; + case 'R': + expected = colour_right; + break; + case 'b': todo = TRUE; + case 'B': + expected = colour_bottom; + break; + case ' ': + expected = colour_clear; + break; + default: + ok(0, "Unexpected entry in expected test char\n"); + expected = 0xdeadbeef; + } + colour = get_readback_color(&rb, x, y); + /* The nudge-to-bottom test fails on cards that give us a bottom-left + * filling convention. The cause isn't the bottom part of the filling + * convention, but because wined3d will nudge geometry to the left to + * keep diagonals (the 'R' in test case 'edge_tris') intact. */ + todo_wine_if(todo && !color_match(colour, expected, 1)) + ok(color_match(colour, expected, 1), "Got unexpected colour %08x, %ux%u, case %u, j %u.\n", + colour, x, y, i, j); + } + } + release_surface_readback(&rb); + + /* For debugging */ + if (cur != backbuffer) + { + hr = IDirect3DDevice9_StretchRect(device, rt, NULL, backbuffer, NULL, D3DTEXF_POINT); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + } + + if (shader) + IDirect3DVertexShader9_Release(shader); + IDirect3DSurface9_Release(backbuffer); + IDirect3DSurface9_Release(rt); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -27060,4 +27546,5 @@ START_TEST(visual) test_sample_attached_rendertarget(); test_alpha_to_coverage(); test_sample_mask(); + test_filling_convention(); }
This allows test_fractional_viewports to pass regardless of GL capabilies. I don't think we can get rid of WINED3D_PIXEL_CENTER_INTEGER (and add +0.5 in the client libs) due to vpos in d3d9 shaders.
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
Version 2: Make it depend on GL_VIEWPORT_SUBPIXEL_BITS instead of support for GL_ARB_viewport_array. Floor viewport coordinates passed to GL if we use GL_ARB_viewport_array but decide the subpixel support is insufficient. --- dlls/wined3d/adapter_gl.c | 3 +++ dlls/wined3d/adapter_vk.c | 1 + dlls/wined3d/state.c | 16 ++++++++++++++++ dlls/wined3d/wined3d_private.h | 14 +++++++++++--- 4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 72f46693274..4f1e78d8e48 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -991,6 +991,7 @@ static void quirk_broken_arb_fog(struct wined3d_gl_info *gl_info)
static void quirk_broken_viewport_subpixel_bits(struct wined3d_gl_info *gl_info) { + gl_info->limits.viewport_subpixel_bits = 0; if (gl_info->supported[ARB_CLIP_CONTROL]) { TRACE("Disabling ARB_clip_control.\n"); @@ -3655,6 +3656,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, TRACE("Disabling ARB_clip_control because viewport subpixel bits < 8.\n"); gl_info->supported[ARB_CLIP_CONTROL] = FALSE; } + gl_info->viewport_subpixel_bits = subpixel_bits; } if (gl_info->supported[ARB_CLIP_CONTROL] && !gl_info->supported[ARB_VIEWPORT_ARRAY]) { @@ -5129,6 +5131,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->clip_control = !!gl_info->supported[ARB_CLIP_CONTROL]; d3d_info->full_ffp_varyings = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_FULL_FFP_VARYINGS); d3d_info->scaled_resolve = !!gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED]; + d3d_info->subpixel_viewport = gl_info->limits.viewport_subpixel_bits >= 8; d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps); d3d_info->filling_convention_nudge = gl_info->filling_convention_nudge;
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index c7da02865ea..31f2b677b5f 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -2172,6 +2172,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_ d3d_info->full_ffp_varyings = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_FULL_FFP_VARYINGS); d3d_info->scaled_resolve = false; d3d_info->feature_level = feature_level_from_caps(&shader_caps); + d3d_info->subpixel_viewport = true;
d3d_info->multisample_draw_location = WINED3D_LOCATION_TEXTURE_RGB; } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 5c1c69fb650..85c80198ebf 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4202,6 +4202,22 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine viewports[i * 4 + 1] = vp[i].y; viewports[i * 4 + 2] = vp[i].width; viewports[i * 4 + 3] = vp[i].height; + + /* Don't pass fractionals to GL if we earlier decided not to use + * this functionality for two reasons: First, GL might offer us + * fewer than 8 bits, and still make use of the fractional, in + * addition to the emulation we apply in shader_get_position_fixup. + * Second, even if GL tells us it has no subpixel precision (Mac OS!) + * it might still do something with the fractional amount, e.g. + * round it upwards. I can't find any info on rounding in + * GL_ARB_viewport_array. */ + if (!context->d3d_info->subpixel_viewport) + { + viewports[i * 4] = floor(viewports[i * 4]); + viewports[i * 4 + 1] = floor(viewports[i * 4 + 1]); + viewports[i * 4 + 2] = floor(viewports[i * 4 + 2]); + viewports[i * 4 + 3] = floor(viewports[i * 4 + 3]); + } }
if (context->viewport_count > state->viewport_count) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f305829475e..1673c55f71d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -239,6 +239,7 @@ struct wined3d_d3d_info uint32_t clip_control : 1; uint32_t full_ffp_varyings : 1; uint32_t scaled_resolve : 1; + uint32_t subpixel_viewport : 1; enum wined3d_feature_level feature_level;
DWORD multisample_draw_location; @@ -3211,6 +3212,7 @@ struct wined3d_gl_limits
unsigned int framebuffer_width; unsigned int framebuffer_height; + unsigned int viewport_subpixel_bits;
UINT glsl_varyings; UINT glsl_vs_float_constants; @@ -5661,7 +5663,7 @@ static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg) static inline void shader_get_position_fixup(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int fixup_count, float *position_fixup) { - float center_offset; + float center_offset, x = 0.0f, y = 0.0f; unsigned int i;
/* See get_projection_matrix() in utils.c for a discussion of the position fixup. @@ -5678,8 +5680,14 @@ static inline void shader_get_position_fixup(const struct wined3d_context *conte { position_fixup[4 * i ] = 1.0f; position_fixup[4 * i + 1] = 1.0f; - position_fixup[4 * i + 2] = center_offset / state->viewports[i].width; - position_fixup[4 * i + 3] = -center_offset / state->viewports[i].height; + if (!context->d3d_info->subpixel_viewport) + { + double dummy; + x = modf(state->viewports[i].x, &dummy) * 2.0f; + y = modf(state->viewports[i].y, &dummy) * 2.0f; + } + position_fixup[4 * i + 2] = (center_offset + x) / state->viewports[i].width; + position_fixup[4 * i + 3] = -(center_offset + y) / state->viewports[i].height;
if (context->render_offscreen) {
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=97487
Your paranoid android.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: d3d11.c:5765: Test failed: Got unexpected query result 0x0000000000000000. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0.
=== w1064v1507 (32 bit report) ===
ddraw: ddraw7.c:18676: Test failed: Got unexpected color 0x00000040.
=== debiant2 (32 bit report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit Arabic:Morocco report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit German report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit French report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit Hebrew:Israel report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit Hindi:India report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (32 bit WoW report) ===
d3d11: d3d11.c:20087: Test failed: d3d11.c:16404: Test marked todo: Got {0xfffe0000, 0xfffe0000, 0xfffe0000, 0xfffe0000}, expected {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff} at (0, 0), sub-resource 0. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999999e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42500000e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373704e-003), expected 0x147ae (4.99999553e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747632e-003), expected 0x1eb85 (7.49999329e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750145e-002), expected 0x33333 (1.24999888e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899935e-001), expected 0xa47ae1 (6.42500022e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097461e-002), expected 0x85293 (3.25099845e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940032e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666209e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258030e-002), expected 0x47b (1.75020981e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894179e-001), expected 0xa47a (6.42496376e-001).
=== debiant2 (64 bit WoW report) ===
d3d11: d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999989e-003. d3d11.c:27975: Test failed: Got depth 4.99374978e-003, expected 4.99999989e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999983e-003. d3d11.c:27975: Test failed: Got depth 7.48750009e-003, expected 7.49999983e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999997e-002. d3d11.c:27975: Test failed: Got depth 1.24749998e-002, expected 1.24999997e-002. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42499986e-001. d3d11.c:27975: Test failed: Got depth 6.40899956e-001, expected 6.42499986e-001. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27975: Test failed: Got depth 2.50997487e-003, expected 2.50999994e-003. d3d11.c:27983: Test failed: Got value 0x14745 (4.99373721e-003), expected 0x147ae (4.99999570e-003). d3d11.c:27983: Test failed: Got value 0x14745 (4.99373721e-003), expected 0x147ae (4.99999570e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097479e-002), expected 0x85293 (3.25099863e-002). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747634e-003), expected 0x1eb85 (7.49999331e-003). d3d11.c:27983: Test failed: Got value 0x1eab3 (7.48747634e-003), expected 0x1eb85 (7.49999331e-003). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097479e-002), expected 0x85293 (3.25099863e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750147e-002), expected 0x33333 (1.24999890e-002). d3d11.c:27983: Test failed: Got value 0x33190 (1.24750147e-002), expected 0x33333 (1.24999890e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097479e-002), expected 0x85293 (3.25099863e-002). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899956e-001), expected 0xa47ae0 (6.42499983e-001). d3d11.c:27983: Test failed: Got value 0xa41204 (6.40899956e-001), expected 0xa47ae0 (6.42499983e-001). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097479e-002), expected 0x85293 (3.25099863e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097479e-002), expected 0x85293 (3.25099863e-002). d3d11.c:27983: Test failed: Got value 0x8528f (3.25097479e-002), expected 0x85293 (3.25099863e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940078e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x28e (9.97940078e-003), expected 0x290 (1.00099184e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666207e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x331 (1.24666207e-002), expected 0x334 (1.25123980e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258035e-002), expected 0x47b (1.75020974e-002). d3d11.c:27992: Test failed: Got value 0x476 (1.74258035e-002), expected 0x47b (1.75020974e-002). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894175e-001), expected 0xa47a (6.42496347e-001). d3d11.c:27992: Test failed: Got value 0xa411 (6.40894175e-001), expected 0xa47a (6.42496347e-001).
On Mon, 6 Sept 2021 at 21:41, Stefan Dösinger stefan@codeweavers.com wrote:
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 902b9620f30..72f46693274 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -5130,6 +5130,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->full_ffp_varyings = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_FULL_FFP_VARYINGS); d3d_info->scaled_resolve = !!gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED]; d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps);
- d3d_info->filling_convention_nudge = gl_info->filling_convention_nudge;
It's perhaps worth explicitly initialising "filling_convention_nudge" in wined3d_adapter_vk_init_d3d_info() as well, perhaps with a comment to explain why we're using 0.0f there.
+static float wined3d_adapter_find_fill_nudge(struct wined3d_caps_gl_ctx *ctx) +{
- static const float test_array[] =
- {
0.0f,
-1.0f / 1024.0f,
-1.0f / 512.0f,
-1.0f / 256.0f,
-1.0f / 128.0f,
-1.0f / 64.0f /* Accept this without a warning if it gets the right result. */
- };
- /* This value was used unconditionally before the dynamic test function was
* introduced. */
- static const float no_clue = -1.0f / 64.0f;
- unsigned int i;
- float value;
- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO)
return no_clue;
- for (i = 0; i < ARRAY_SIZE(test_array); ++i)
- {
value = test_array[i];
if (wined3d_caps_gl_ctx_test_filling_convention(ctx, value))
{
if (value)
WARN("Using a filling convention fixup nudge of -1/%f\n", -1.0f / value);
else
TRACE("No need for a filling convetion nudge.\n");
return value;
}
- }
- FIXME("Did not find a way to get the filling convention we want.\n");
- return no_clue;
+}
I don't think "no_clue" is a great name, and you could probably just "return -1.0f / 64.0f;" at the end, and add a label there to jump to in case we're not using FBOs.
Would it make sense to do a binary search here instead of trying every value? (Similar to what we do in wined3d_adapter_find_polyoffset_scale())
"convetion" -> "convention"
The WARN could do with a full stop.
+BOOL wined3d_caps_gl_ctx_test_filling_convention(struct wined3d_caps_gl_ctx *ctx, float nudge) +{
- static const struct wined3d_color red = {1.0f, 0.0f, 0.0f, 1.0f};
- const struct wined3d_gl_info *gl_info = ctx->gl_info;
- GLuint texture, fbo;
- DWORD readback[8][8];
- unsigned int x, y;
We're generally using "bool" and "uint32_t" instead of "BOOL" and "DWORD" these days; doesn't matter too much though.
- /* This is a very simple test to find out how GL handles pixel edges:
* Draw a quad exactly between 4 pixels in an 8x8 viewport and see
* which pixel it ends up in. So far we've seen top left and bottom
* left conventions. This test may produce unexpected results if the
* driver forces multisampling on us.
*
Technically, this is about rasterisation of polygon edges; the pixels stay where they are. :) We're also not drawing "exactly between 4 pixels"; that case would be well defined. Instead, we do quite the opposite, and align the corners of the quad with the pixel centres. (Incidentally, it may not be bad to draw a slightly larger quad, although I suppose it would complicate the maths a little.)
Can the driver force multi-sampling on us here? My understanding was that generally speaking those controls only affect the backbuffer, and not FBOs; that was part of the reason for having the "SampleCount" registry setting.
* If we find a bottom-left filling behavior we also nudge the x axis
* by the same amount. This is necessary to keep diagonals that go
* through the pixel center intact.
*
"x-axis", probably. (I'd also argue for "behaviour" and "centre", but I suppose those are spelling variants more than they are spelling errors.)
* Note that we are ignoring some settings that might influence the
* driver: How we switch GL to a upper-left coordinate system, if we
* are drawing into the on-screen framebuffer (we don't have one here
* because our window is hidden), shaders vs fixed function GL.
* Testing these isn't possible with the current draw_test_quad()
* infrastructure.
*
Well, we do have an on-screen framebuffer here, we may just fail the pixel ownership test. That's true regardless of whether we're drawing to a hidden window though; an otherwise visible window may be partially obscured by some other window, for example. I don't think this is generally an issue on modern Linux. It's also somewhat moot; if we're using FBOs, the application never draws directly to the on-screen/default framebuffer, and if we're not using FBOs we don't use wined3d_caps_gl_ctx_test_filling_convention().
"an upper-left coordinate system"
- if (readback[3][3] == 0xffff0000 && readback[3][4] == 0xff0000ff
&& readback[4][3] == 0xff0000ff && readback[4][4] == 0xff0000ff)
- {
TRACE("Got the expected filling result.\n");
return TRUE;
- }
- else if (readback[3][3] == 0xff0000ff && readback[3][4] == 0xff0000ff
&& readback[4][3] == 0xffff0000 && readback[4][4] == 0xff0000ff)
- {
WARN("GPU uses a bottom-left filling convention in FBOs.\n");
return FALSE;
- }
- FIXME("Unexpected filling convention test result\n");
- for (y = 0; y < ARRAY_SIZE(readback); ++y)
- {
for (x = 0; x < ARRAY_SIZE(readback[0]); ++x)
{
FIXME("0x%08x ", readback[y][x]);
}
FIXME("\n");
- }
Do we really need a FIXME for that? Getting e.g. a bottom-right result would perhaps be unexpected, but it doesn't seem particularly concerning.
* In order to handle the pixel center, we translate by 0.5 / VPw and
* 0.5 / VPh. We test the filling convention during adapter init and
* add a small offset to correct it if necessary. See
* wined3d_caps_gl_ctx_test_filling_convention for more details on how
* we test GL and considerations regarding the added nudge value.
*
"wined3d_caps_gl_ctx_test_filling_convention()"
clip_control = d3d_info->clip_control; flip = !clip_control && context->render_offscreen;
- if (!clip_control && d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
center_offset = 63.0f / 64.0f;
- if (!clip_control)
elsecenter_offset = 1.0f + d3d_info->filling_convention_nudge;
center_offset = -1.0f / 64.0f;
center_offset = 0.0f;
This changes the logic for which offset is applied in which case. Perhaps that makes sense, but it seems like an independent change.
Am Donnerstag, 16. September 2021, 15:28:28 EAT schrieb Henri Verbeet:
It's perhaps worth explicitly initialising "filling_convention_nudge" in wined3d_adapter_vk_init_d3d_info() as well, perhaps with a comment to explain why we're using 0.0f there.
Sounds like a good idea yeah.
Would it make sense to do a binary search here instead of trying every value? (Similar to what we do in wined3d_adapter_find_polyoffset_scale())
Between 1/64 and 1/1024 it might. I don't want to search the space between 1/1024 and 0 for the reason I explained in some comment (unpredictability wrt to other viewport dimensions). For the 5 non-zero values we're testing I don't know if it makes any difference in practise. Yeah I know cache locality isn't a concern here because we're not searching memory contents :-) .
Though for clarity: Do you suggest searching non-power-of-two values too? I am not sure if that will give us anything of use. I've avoided them because I expect powers of two to be more reliable re rounding when we add them to actual geometry positions.
Can the driver force multi-sampling on us here? My understanding was that generally speaking those controls only affect the backbuffer, and not FBOs; that was part of the reason for having the "SampleCount" registry setting.
I think at least the nvidia drivers try to be smarter than "just make the backbuffer multisampled", although I haven't played with nvidia-settings' multisample setting in years. (At some point turning on driver multisampling would break FBO blits from backbuffer to a texture, at least that got fixed somewhen)
"Enable multisampling by user request" is a common enough mode for the driver to ignore our request that it feels worth mentioning in this context. It is a rather fundamental change to rasterization...
Do we really need a FIXME for that? Getting e.g. a bottom-right result would perhaps be unexpected, but it doesn't seem particularly concerning.
A *-right result is the most obvious case, but I also saw the MacOS driver completely discard the test draw at certain magic offsets (1^-24.5 or something along those lines if I remember right); The top edge wasn't yet on the pixel but the bottom edge was already moved away.
Bottom line, we'd potentially apply a nudge for the wrong reason. The nudge can break things just as much as fix things. Seems worthy of a FIXME to me.
I am persuadable to returning TRUE in case of an unexpected result. That way we'd either not apply a quirk if things go wrong or just apply too small a nudge (if we keep the linear search). In that case I am less invested in the FIXME, but we'd depart more from the current behaviour.
On Thu, 16 Sept 2021 at 20:34, Stefan Dösinger stefandoesinger@gmail.com wrote:
Would it make sense to do a binary search here instead of trying every value? (Similar to what we do in wined3d_adapter_find_polyoffset_scale())
Between 1/64 and 1/1024 it might. I don't want to search the space between 1/1024 and 0 for the reason I explained in some comment (unpredictability wrt to other viewport dimensions). For the 5 non-zero values we're testing I don't know if it makes any difference in practise. Yeah I know cache locality isn't a concern here because we're not searching memory contents :-) .
Though for clarity: Do you suggest searching non-power-of-two values too? I am not sure if that will give us anything of use. I've avoided them because I expect powers of two to be more reliable re rounding when we add them to actual geometry positions.
Well, there are different variant we could do. The most straightforward one is perhaps to simply do a binary search of the values in test_array[], it's already sorted. Alternatively, we'd set e.g. "low = 6, high = 10", and then "value = -1.0f / (1u << cur)". Perhaps there are also just few enough values that it's not worth it. I'd stick to powers of two, yes.
Do we really need a FIXME for that? Getting e.g. a bottom-right result would perhaps be unexpected, but it doesn't seem particularly concerning.
A *-right result is the most obvious case, but I also saw the MacOS driver completely discard the test draw at certain magic offsets (1^-24.5 or something along those lines if I remember right); The top edge wasn't yet on the pixel but the bottom edge was already moved away.
Bottom line, we'd potentially apply a nudge for the wrong reason. The nudge can break things just as much as fix things. Seems worthy of a FIXME to me.
I am persuadable to returning TRUE in case of an unexpected result. That way we'd either not apply a quirk if things go wrong or just apply too small a nudge (if we keep the linear search). In that case I am less invested in the FIXME, but we'd depart more from the current behaviour.
We could certainly get broken results here, yes, and those would be worth a FIXME or even a winediag message. I think validation rules are just the following though:
- Exactly one of the centre four values in readback[] is 0xffff0000. - All other values in readback[] are 0xff0000ff.
Provided we have a valid result, we can then just "return readback[3][3] == 0xffff0000;"