[PATCH 1/5] wined3d: Use the correct texture coordinates in swapchain_blit() in the non-glBlitFramebuffer, NP2 case.

Matteo Bruni mbruni at codeweavers.com
Mon Jul 6 15:20:10 CDT 2015


---
 dlls/wined3d/swapchain.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 146f5d6..141abc2 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -280,21 +280,21 @@ HRESULT CDECL wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *s
 
 /* A GL context is provided by the caller */
 static void swapchain_blit(const struct wined3d_swapchain *swapchain,
-        struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect)
+        struct wined3d_context *context, unsigned int src_w, unsigned int src_h,
+        const RECT *src_rect, const RECT *dst_rect)
 {
     struct wined3d_surface *backbuffer = surface_from_resource(
             wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0));
-    UINT src_w = src_rect->right - src_rect->left;
-    UINT src_h = src_rect->bottom - src_rect->top;
     GLenum gl_filter;
     const struct wined3d_gl_info *gl_info = context->gl_info;
     RECT win_rect;
     UINT win_h;
 
-    TRACE("swapchain %p, context %p, src_rect %s, dst_rect %s.\n",
-            swapchain, context, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect));
+    TRACE("swapchain %p, context %p, src_w %u, src_h %u, src_rect %s, dst_rect %s.\n",
+            swapchain, context, src_w, src_h, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect));
 
-    if (src_w == dst_rect->right - dst_rect->left && src_h == dst_rect->bottom - dst_rect->top)
+    if (src_rect->right - src_rect->left == dst_rect->right - dst_rect->left
+            && src_rect->bottom - src_rect->top == dst_rect->bottom - dst_rect->top)
         gl_filter = GL_NEAREST;
     else
         gl_filter = GL_LINEAR;
@@ -528,7 +528,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
         if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP && !once++)
             FIXME("WINED3D_SWAP_EFFECT_FLIP not implemented.\n");
 
-        swapchain_blit(swapchain, context, &src_rect, &dst_rect);
+        swapchain_blit(swapchain, context, back_buffer->pow2Width, back_buffer->pow2Height, &src_rect, &dst_rect);
     }
 
     if (swapchain->num_contexts > 1)
-- 
2.3.6




More information about the wine-patches mailing list