Commit b60961ae authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wined3d: Use surface_prepare_texture for surface allocation in read_from_framebuffer_texture.

parent 658209b5
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment