=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Check multisampling compatibility before finding the FBO key.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 24 11:01:42 CST 2016


Module: wine
Branch: master
Commit: d04ca90bca9ed52da96f13334ca79defe663a7d6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d04ca90bca9ed52da96f13334ca79defe663a7d6

Author: Stefan Dösinger <stefandoesinger at gmx.at>
Date:   Sun Feb 21 21:30:00 2016 +0000

wined3d: Check multisampling compatibility before finding the FBO key.

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

---

 dlls/wined3d/context.c         | 29 +++++++++++------------------
 dlls/wined3d/wined3d_private.h |  1 -
 2 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 65a700b..d04a246 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -410,11 +410,8 @@ static struct fbo_entry *context_create_fbo_entry(const struct wined3d_context *
 
     entry = HeapAlloc(GetProcessHeap(), 0,
             FIELD_OFFSET(struct fbo_entry, key.objects[object_count]));
-    entry->d3d_render_targets = HeapAlloc(GetProcessHeap(), 0,
-            gl_info->limits.buffers * sizeof(*entry->d3d_render_targets));
     memset(&entry->key, 0, FIELD_OFFSET(struct wined3d_fbo_entry_key, objects[object_count]));
     context_generate_fbo_key(context, &entry->key, render_targets, depth_stencil, color_location, ds_location);
-    memcpy(entry->d3d_render_targets, render_targets, sizeof(*entry->d3d_render_targets) * gl_info->limits.buffers);
     entry->d3d_depth_stencil = depth_stencil;
     entry->rt_mask = context_generate_rt_mask(GL_COLOR_ATTACHMENT0);
     entry->attached = FALSE;
@@ -436,7 +433,6 @@ static void context_reuse_fbo_entry(struct wined3d_context *context, GLenum targ
     context_clean_fbo_attachments(gl_info, target);
 
     context_generate_fbo_key(context, &entry->key, render_targets, depth_stencil, color_location, ds_location);
-    memcpy(entry->d3d_render_targets, render_targets, sizeof(*entry->d3d_render_targets) * gl_info->limits.buffers);
     entry->d3d_depth_stencil = depth_stencil;
     entry->attached = FALSE;
 }
@@ -451,7 +447,6 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb
     }
     --context->fbo_entry_count;
     list_remove(&entry->entry);
-    HeapFree(GetProcessHeap(), 0, entry->d3d_render_targets);
     HeapFree(GetProcessHeap(), 0, entry);
 }
 
@@ -473,6 +468,17 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context,
             WARN("Depth stencil is smaller than the primary color buffer, disabling\n");
             depth_stencil = NULL;
         }
+        else if (depth_stencil->resource.multisample_type
+                != render_targets[0]->resource.multisample_type
+                || depth_stencil->resource.multisample_quality
+                != render_targets[0]->resource.multisample_quality)
+        {
+            WARN("Color multisample type %u and quality %u, depth stencil has %u and %u, disabling ds buffer.\n",
+                    render_targets[0]->resource.multisample_quality,
+                    render_targets[0]->resource.multisample_type,
+                    depth_stencil->resource.multisample_quality, depth_stencil->resource.multisample_type);
+            depth_stencil = NULL;
+        }
         else
             surface_set_compatible_renderbuffer(depth_stencil, render_targets[0]);
     }
@@ -557,19 +563,6 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
                 entry->key.rb_namespace & (1 << (i + 1)));
     }
 
-    if (depth_stencil && entry->d3d_render_targets[0]
-            && (depth_stencil->resource.multisample_type
-            != entry->d3d_render_targets[0]->resource.multisample_type
-            || depth_stencil->resource.multisample_quality
-            != entry->d3d_render_targets[0]->resource.multisample_quality))
-    {
-        WARN("Color multisample type %u and quality %u, depth stencil has %u and %u, disabling ds buffer.\n",
-                entry->d3d_render_targets[0]->resource.multisample_quality,
-                entry->d3d_render_targets[0]->resource.multisample_type,
-                depth_stencil->resource.multisample_quality, depth_stencil->resource.multisample_type);
-        depth_stencil = NULL;
-    }
-
     if (depth_stencil)
     {
         DWORD format_flags = depth_stencil->container->resource.format_flags;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c8f004a..d7ea23d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2485,7 +2485,6 @@ struct wined3d_fbo_resource
 struct fbo_entry
 {
     struct list entry;
-    struct wined3d_surface **d3d_render_targets;
     struct wined3d_surface *d3d_depth_stencil;
     DWORD rt_mask;
     BOOL attached;




More information about the wine-cvs mailing list