Module: wine
Branch: master
Commit: 82f6410bfcc5395bd2d5d58945402d0d736253f5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=82f6410bfcc5395bd2d5d5894…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Fri Mar 11 11:28:19 2011 +0100
wined3d: Disable the depth stencil if it is smaller than the primary color buffer.
This way we get correct behavior if the application has depth and stencil related tests
disabled. If we attach the depth stencil GL limits the framebuffer size to the smallest
surface, making some parts of the framebuffer inaccessible.
---
dlls/wined3d/context.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 86ab77b..499c3d1 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -399,6 +399,16 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context,
const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry;
+ if (depth_stencil && render_targets && render_targets[0])
+ {
+ if (depth_stencil->resource.width < render_targets[0]->resource.width ||
+ depth_stencil->resource.height < render_targets[0]->resource.height)
+ {
+ WARN("Depth stencil is smaller than the primary color buffer, disabling\n");
+ depth_stencil = NULL;
+ }
+ }
+
LIST_FOR_EACH_ENTRY(entry, &context->fbo_list, struct fbo_entry, entry)
{
if (!memcmp(entry->render_targets,