Commit 0b5bd254 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Handle depth textures in texture2d_read_from_framebuffer().

parent 7d5f9e42
......@@ -374,8 +374,12 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
wined3d_context_gl_apply_fbo_state_explicit(context_gl, GL_READ_FRAMEBUFFER,
resource, sub_resource_idx, NULL, 0, src_location);
if (resource->format->depth_size || resource->format->stencil_size)
wined3d_context_gl_apply_fbo_state_explicit(context_gl, GL_READ_FRAMEBUFFER,
NULL, 0, resource, sub_resource_idx, src_location);
else
wined3d_context_gl_apply_fbo_state_explicit(context_gl, GL_READ_FRAMEBUFFER,
resource, sub_resource_idx, NULL, 0, src_location);
}
/* Select the correct read buffer, and give some debug output.
......
......@@ -3006,8 +3006,7 @@ static BOOL wined3d_texture_gl_load_sysmem(struct wined3d_texture_gl *texture_gl
return TRUE;
}
if (!(texture_gl->t.resource.bind_flags & WINED3D_BIND_DEPTH_STENCIL)
&& (sub_resource->locations & WINED3D_LOCATION_DRAWABLE))
if (sub_resource->locations & WINED3D_LOCATION_DRAWABLE)
{
texture2d_read_from_framebuffer(&texture_gl->t, sub_resource_idx, &context_gl->c,
texture_gl->t.resource.draw_binding, dst_location);
......
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