wined3d: Handle depth textures in texture2d_read_from_framebuffer().

This commit is contained in:
Matteo Bruni 2023-07-06 20:37:04 +02:00 committed by Alexandre Julliard
parent 7d5f9e42d3
commit 0b5bd25415
2 changed files with 7 additions and 4 deletions

View file

@ -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.

View file

@ -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);