[PATCH 5/8] wined3d: Check multisampling compatibility before finding the FBO key.

Stefan Dösinger stefandoesinger at gmx.at
Sun Feb 14 14:33:56 CST 2016


---
 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 fc6a0a0..012dab1 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 33f6a23..e2d9cef 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2478,7 +2478,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;
-- 
2.4.10




More information about the wine-patches mailing list