Henri Verbeet : wined3d: Explicitly specify the resource location to context_attach_depth_stencil_fbo ().

Alexandre Julliard julliard at winehq.org
Fri Aug 26 10:40:48 CDT 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Aug 25 21:05:00 2011 +0200

wined3d: Explicitly specify the resource location to context_attach_depth_stencil_fbo().

---

 dlls/wined3d/context.c |   44 +++++++++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 829c570..b4788bd 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -113,7 +113,7 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo)
 
 /* GL locking is done by the caller */
 static void context_attach_depth_stencil_fbo(struct wined3d_context *context,
-        GLenum fbo_target, struct wined3d_surface *depth_stencil)
+        GLenum fbo_target, struct wined3d_surface *depth_stencil, DWORD location)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
 
@@ -141,22 +141,32 @@ static void context_attach_depth_stencil_fbo(struct wined3d_context *context,
         }
         else
         {
-            surface_prepare_texture(depth_stencil, context, FALSE);
-
-            if (format_flags & WINED3DFMT_FLAG_DEPTH)
+            switch (location)
             {
-                gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT,
-                        depth_stencil->texture_target, depth_stencil->texture_name,
-                        depth_stencil->texture_level);
-                checkGLcall("glFramebufferTexture2D()");
-            }
+                case SFLAG_INTEXTURE:
+                case SFLAG_INSRGBTEX:
+                    surface_prepare_texture(depth_stencil, context, FALSE);
+
+                    if (format_flags & WINED3DFMT_FLAG_DEPTH)
+                    {
+                        gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT,
+                                depth_stencil->texture_target, depth_stencil->texture_name,
+                                depth_stencil->texture_level);
+                        checkGLcall("glFramebufferTexture2D()");
+                    }
+
+                    if (format_flags & WINED3DFMT_FLAG_STENCIL)
+                    {
+                        gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT,
+                                depth_stencil->texture_target, depth_stencil->texture_name,
+                                depth_stencil->texture_level);
+                        checkGLcall("glFramebufferTexture2D()");
+                    }
+                    break;
 
-            if (format_flags & WINED3DFMT_FLAG_STENCIL)
-            {
-                gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT,
-                        depth_stencil->texture_target, depth_stencil->texture_name,
-                        depth_stencil->texture_level);
-                checkGLcall("glFramebufferTexture2D()");
+                default:
+                    ERR("Unsupported location %s (%#x).\n", debug_surflocation(location), location);
+                    break;
             }
         }
 
@@ -393,7 +403,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
     /* Apply depth targets */
     if (entry->depth_stencil)
         surface_set_compatible_renderbuffer(entry->depth_stencil, entry->render_targets[0]);
-    context_attach_depth_stencil_fbo(context, target, entry->depth_stencil);
+    context_attach_depth_stencil_fbo(context, target, entry->depth_stencil, entry->location);
 
     entry->attached = TRUE;
 }




More information about the wine-cvs mailing list