From d04ca90bca9ed52da96f13334ca79defe663a7d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Sun, 21 Feb 2016 21:30:00 +0000 Subject: [PATCH] wined3d: Check multisampling compatibility before finding the FBO key. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Dösinger Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 65a700b719b..d04a246a761 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 c8f004ac510..d7ea23da57e 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; -- 2.11.4.GIT