[PATCH v2 1/4] wined3d: Enable multisampling for GPU surface blits.

Chip Davis cdavis at codeweavers.com
Mon Apr 20 00:52:59 CDT 2020


Signed-off-by: Chip Davis <cdavis at codeweavers.com>
---
v2: Hoist a couple of GL_MULTISAMPLE enables into
    wined3d_context_gl_apply_blit_state().
---
 dlls/wined3d/context_gl.c |  5 +++++
 dlls/wined3d/surface.c    | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index 9dbd0346ff3..fa2f117fe9c 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -2773,6 +2773,11 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
     gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
     gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
     context_invalidate_state(context, STATE_BLEND);
+    if (gl_info->supported[ARB_MULTISAMPLE])
+    {
+        gl_info->gl_ops.gl.p_glEnable(GL_MULTISAMPLE);
+        context_invalidate_state(context, STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS));
+    }
     gl_info->gl_ops.gl.p_glDisable(GL_CULL_FACE);
     gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
     context_invalidate_state(context, STATE_RASTERIZER);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e965203950e..6ab5bd10325 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -130,6 +130,11 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
         context_invalidate_state(context, STATE_RENDER(WINED3D_RS_STENCILWRITEMASK));
     }
 
+    if (gl_info->supported[ARB_MULTISAMPLE])
+    {
+        gl_info->gl_ops.gl.p_glEnable(GL_MULTISAMPLE);
+        context_invalidate_state(context, STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS));
+    }
     gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
     context_invalidate_state(context, STATE_RASTERIZER);
 
@@ -251,6 +256,11 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
     gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
     context_invalidate_state(context, STATE_BLEND);
 
+    if (gl_info->supported[ARB_MULTISAMPLE])
+    {
+        gl_info->gl_ops.gl.p_glEnable(GL_MULTISAMPLE);
+        context_invalidate_state(context, STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS));
+    }
     gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
     context_invalidate_state(context, STATE_RASTERIZER);
 
@@ -848,6 +858,12 @@ void texture2d_load_fb_texture(struct wined3d_texture_gl *texture_gl,
         gl_info->gl_ops.gl.p_glReadBuffer(wined3d_texture_get_gl_buffer(&texture_gl->t));
     checkGLcall("glReadBuffer");
 
+    if (gl_info->supported[ARB_MULTISAMPLE])
+    {
+        gl_info->gl_ops.gl.p_glEnable(GL_MULTISAMPLE);
+        context_invalidate_state(context, STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS));
+    }
+
     level = sub_resource_idx % texture_gl->t.level_count;
     target = wined3d_texture_gl_get_sub_resource_target(texture_gl, sub_resource_idx);
     gl_info->gl_ops.gl.p_glCopyTexSubImage2D(target, level, 0, 0, 0, 0,
-- 
2.24.0




More information about the wine-devel mailing list