[PATCH 1/3] wined3d: use surface_prepare_texture for surface allocation in read_from_framebuffer_texture
Roderick Colenbrander
thunderbird2k at gmail.com
Mon May 10 08:36:31 CDT 2010
Right now read_from_framebuffer_texture calls surface_allocate_surface but this call doesn't set conversion flags which
caused bug 22356. The use of surface_prepare_texture fixes this.
---
dlls/wined3d/surface.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index bb18b95..db4a58b 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1495,7 +1495,6 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb)
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
GLint prevRead;
- BOOL alloc_flag = srgb ? SFLAG_SRGBALLOCATED : SFLAG_ALLOCATED;
/* Activate the surface to read from. In some situations it isn't the currently active target(e.g. backbuffer
* locking during offscreen rendering). RESOURCELOAD is ok because glCopyTexSubImage2D isn't affected by any
@@ -1504,6 +1503,7 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb)
context = context_acquire(device, This);
gl_info = context->gl_info;
+ surface_prepare_texture(This, gl_info, srgb);
surface_bind_and_dirtify(This, srgb);
ENTER_GL();
@@ -1536,12 +1536,6 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb)
LEAVE_GL();
}
- if (!(This->Flags & alloc_flag))
- {
- surface_allocate_surface(This, gl_info, This->resource.format_desc, srgb);
- This->Flags |= alloc_flag;
- }
-
ENTER_GL();
/* If !SrcIsUpsideDown we should flip the surface.
* This can be done using glCopyTexSubImage2D but this
--
1.6.3.3
More information about the wine-patches
mailing list