Henri Verbeet : wined3d: Simply pass an IWineD3DSurfaceImpl pointer to context_attach_surface_fbo() .

Alexandre Julliard julliard at winehq.org
Fri Apr 16 10:56:00 CDT 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Apr 15 19:21:25 2010 +0200

wined3d: Simply pass an IWineD3DSurfaceImpl pointer to context_attach_surface_fbo().

---

 dlls/wined3d/context.c         |   15 +++++++--------
 dlls/wined3d/device.c          |    8 ++++----
 dlls/wined3d/swapchain.c       |    2 +-
 dlls/wined3d/wined3d_private.h |    2 +-
 4 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index fe6cd1f..e98eecb 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -255,20 +255,19 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
 
 /* GL locking is done by the caller */
 void context_attach_surface_fbo(const struct wined3d_context *context,
-        GLenum fbo_target, DWORD idx, IWineD3DSurface *surface)
+        GLenum fbo_target, DWORD idx, IWineD3DSurfaceImpl *surface)
 {
-    IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface;
     const struct wined3d_gl_info *gl_info = context->gl_info;
 
     TRACE("Attach surface %p to %u\n", surface, idx);
 
     if (surface)
     {
-        surface_prepare_texture(surface_impl, gl_info, FALSE);
-        context_apply_attachment_filter_states(surface_impl);
+        surface_prepare_texture(surface, gl_info, FALSE);
+        context_apply_attachment_filter_states(surface);
 
-        gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, surface_impl->texture_target,
-                surface_impl->texture_name, surface_impl->texture_level);
+        gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, surface->texture_target,
+                surface->texture_name, surface->texture_level);
         checkGLcall("glFramebufferTexture2D()");
     }
     else
@@ -415,7 +414,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_
         /* Apply render targets */
         for (i = 0; i < gl_info->limits.buffers; ++i)
         {
-            IWineD3DSurface *render_target = device->render_targets[i];
+            IWineD3DSurfaceImpl *render_target = (IWineD3DSurfaceImpl *)device->render_targets[i];
             context_attach_surface_fbo(context, GL_FRAMEBUFFER, i, render_target);
         }
 
@@ -2011,7 +2010,7 @@ static void context_apply_state(struct wined3d_context *context, IWineD3DDeviceI
 
                     ENTER_GL();
                     context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo);
-                    context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, context->current_rt);
+                    context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, (IWineD3DSurfaceImpl *)context->current_rt);
                     context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE);
                     LEAVE_GL();
                 } else {
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 986d042..c3d6a6e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4394,7 +4394,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
 
             ENTER_GL();
             context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo);
-            context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, (IWineD3DSurface *)target);
+            context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, target);
             context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE);
             LEAVE_GL();
         }
@@ -5458,7 +5458,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
         context = context_acquire(This, NULL, CTXUSAGE_RESOURCELOAD);
         ENTER_GL();
         context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo);
-        context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, surface);
+        context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, (IWineD3DSurfaceImpl *)surface);
         context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE);
     }
 
@@ -5784,7 +5784,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, const
         TRACE("Source surface %p is offscreen\n", src_surface);
         ENTER_GL();
         context_bind_fbo(context, GL_READ_FRAMEBUFFER, &context->src_fbo);
-        context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, src_surface);
+        context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, (IWineD3DSurfaceImpl *)src_surface);
         glReadBuffer(GL_COLOR_ATTACHMENT0);
         checkGLcall("glReadBuffer()");
         context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER, NULL, FALSE);
@@ -5823,7 +5823,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, const
 
         ENTER_GL();
         context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, &context->dst_fbo);
-        context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER, 0, dst_surface);
+        context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER, 0, (IWineD3DSurfaceImpl *)dst_surface);
         context_set_draw_buffer(context, GL_COLOR_ATTACHMENT0);
         context_attach_depth_stencil_fbo(context, GL_DRAW_FRAMEBUFFER, NULL, FALSE);
     }
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 9929037..8c78fac 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -118,7 +118,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
     {
         ENTER_GL();
         context_bind_fbo(context, GL_READ_FRAMEBUFFER, &context->src_fbo);
-        context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, This->backBuffer[0]);
+        context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, backbuffer);
         context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER, NULL, FALSE);
 
         context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, NULL);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index dc57762..7a86d4c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1216,7 +1216,7 @@ void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fb
 void context_attach_depth_stencil_fbo(struct wined3d_context *context,
         GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN;
 void context_attach_surface_fbo(const struct wined3d_context *context,
-        GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) DECLSPEC_HIDDEN;
+        GLenum fbo_target, DWORD idx, IWineD3DSurfaceImpl *surface) DECLSPEC_HIDDEN;
 struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3DSurfaceImpl *target,
         const struct wined3d_format_desc *ds_format_desc) DECLSPEC_HIDDEN;
 void context_destroy(IWineD3DDeviceImpl *This, struct wined3d_context *context) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list