Commit 9308c549 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make sure all texture levels are allocated in surface_prepare_texture().

This fixes a regression introduced by commit af7dfcd3.
parent 958b5237
......@@ -1563,7 +1563,8 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb)
}
/* Context activation is done by the caller. */
void surface_prepare_texture(IWineD3DSurfaceImpl *surface, const struct wined3d_gl_info *gl_info, BOOL srgb)
static void surface_prepare_texture_internal(IWineD3DSurfaceImpl *surface,
const struct wined3d_gl_info *gl_info, BOOL srgb)
{
DWORD alloc_flag = srgb ? SFLAG_SRGBALLOCATED : SFLAG_ALLOCATED;
CONVERT_TYPES convert;
......@@ -1580,6 +1581,31 @@ void surface_prepare_texture(IWineD3DSurfaceImpl *surface, const struct wined3d_
surface->Flags |= alloc_flag;
}
/* Context activation is done by the caller. */
void surface_prepare_texture(IWineD3DSurfaceImpl *surface, const struct wined3d_gl_info *gl_info, BOOL srgb)
{
IWineD3DBaseTextureImpl *texture;
if (SUCCEEDED(IWineD3DSurface_GetContainer((IWineD3DSurface *)surface,
&IID_IWineD3DBaseTexture, (void **)&texture)))
{
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
UINT i;
TRACE("surface %p is a subresource of texture %p.\n", surface, texture);
for (i = 0; i < sub_count; ++i)
{
IWineD3DSurfaceImpl *s = (IWineD3DSurfaceImpl *)texture->baseTexture.sub_resources[i];
surface_prepare_texture_internal(s, gl_info, srgb);
}
IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture);
}
surface_prepare_texture_internal(surface, gl_info, srgb);
}
static void surface_prepare_system_memory(IWineD3DSurfaceImpl *This)
{
IWineD3DDeviceImpl *device = This->resource.device;
......
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