Stefan Dösinger : wined3d: Fix the center offset in get_projection_matrix.

Alexandre Julliard julliard at winehq.org
Tue Oct 5 15:51:42 CDT 2021


Module: wine
Branch: master
Commit: 235908a7a6f6f85a45edb8b9681f3b12d58d7351
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=235908a7a6f6f85a45edb8b9681f3b12d58d7351

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Sep 29 22:42:57 2021 +0300

wined3d: Fix the center offset in get_projection_matrix.

If we have clip control, viewport_miscpart_cc applies both the half pixel
offset and the filling convention nudge. We always have integer pixel centers
in this <= d3d9-only codepath.

Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/utils.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 4019dd4d812..0a1e0707359 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -5550,12 +5550,16 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
      * driver, but small enough to prevent it from interfering with any
      * anti-aliasing. */
 
+    /* Projection matrices are <= d3d9, which all have integer pixel centers. */
+    if (!(d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER))
+        ERR("Did not expect to enter this codepath without WINED3D_PIXEL_CENTER_INTEGER.\n");
+
     clip_control = d3d_info->clip_control;
     flip = !clip_control && context->render_offscreen;
-    if (!clip_control && d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
+    if (!clip_control)
         center_offset = 63.0f / 64.0f;
     else
-        center_offset = -1.0f / 64.0f;
+        center_offset = 0.0f;
 
     if (context->last_was_rhw)
     {




More information about the wine-cvs mailing list