If the destination texture is not FBO attachable GLSL blitter does not work for it unless backbuffer is used as offscreen rendering mode.
Related to bug https://bugs.winehq.org/show_bug.cgi?id=47121, while that is a Staging bug (without a staging patch, the GLSL blitter is avoided for that textures regardless).
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/wined3d/glsl_shader.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 47eb6f2b79..6493e7f16c 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13193,6 +13193,14 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi return FALSE; }
+ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO + && !((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + || (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) + { + TRACE("Destination texture is not FBO attachable.\n"); + return FALSE; + } + TRACE("Returning supported.\n"); return TRUE; }
On Mon, 6 May 2019 at 14:56, Paul Gofman gofmanp@gmail.com wrote:
@@ -13193,6 +13193,14 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi return FALSE; }
- if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& !((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE)
|| (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET)))
- {
TRACE("Destination texture is not FBO attachable.\n");
return FALSE;
- }
This is basically fine. Two comments though:
- I could imagine cases where creating a staging destination texture for the blit and compressing it afterwards would be preferable to going through the CPU blitter. It's of course fine to handle that when we run into it. - We're using src_format/dst_format with WINED3D_GL_RES_TYPE_TEX_2D mostly for historical reasons, but at this point it would be more appropriate to use src_resource/dst_resource->format_flags.