Module: wine Branch: master Commit: 0b5bd254156f37dfb9f0531f5cdbefd011755657 URL: https://gitlab.winehq.org/wine/wine/-/commit/0b5bd254156f37dfb9f0531f5cdbefd...
Author: Matteo Bruni mbruni@codeweavers.com Date: Thu Jul 6 20:37:04 2023 +0200
wined3d: Handle depth textures in texture2d_read_from_framebuffer().
---
dlls/wined3d/surface.c | 8 ++++++-- dlls/wined3d/texture.c | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index b519e26ee2a..dce1de3ac18 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -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. diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index a59fdb7e255..22f69cc0cc6 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -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);