From: Stefan Dösinger Subject: [PATCH 5/6] wined3d: Check multisampling compatibility before finding the FBO key. Message-Id: <1446042562-27871-5-git-send-email-stefan@codeweavers.com> Date: Wed, 28 Oct 2015 15:29:21 +0100 In-Reply-To: <1446042562-27871-1-git-send-email-stefan@codeweavers.com> References: <1446042562-27871-1-git-send-email-stefan@codeweavers.com> Signed-off-by: Stefan Dösinger --- 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 24444b2..c557a59 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -411,11 +411,8 @@ static struct fbo_entry *context_create_fbo_entry(const struct wined3d_context * entry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 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)); context_create_fbo_key(&entry->key, render_targets, depth_stencil, color_location, ds_location, gl_info->limits.buffers); - 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; @@ -438,7 +435,6 @@ static void context_reuse_fbo_entry(struct wined3d_context *context, GLenum targ context_create_fbo_key(&entry->key, render_targets, depth_stencil, color_location, ds_location, gl_info->limits.buffers); - 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; } @@ -453,7 +449,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); } @@ -475,6 +470,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]); } @@ -559,19 +565,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 410b975..439d02a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2384,7 +2384,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