Skip to content

meta: Fix glBlitFramebuffer temp texture setup

Ville Syrjälä requested to merge vsyrjala/mesa:meta_blitframebuffer_fix into main

Pass the correct src coordinates to CopyTexSubImage() when creating the temporary texture, and also take care to adjust flipX/Y if the original src coordinates were flipped compared to the new temporary texture src coordinates.

It looks to me like commit b702233f ("meta: Refactor the BlitFramebuffer color CopyTexImage fallback.") most likely broke this codepath.

We also have to restore the extra 1 texel "border" around the specified source rectangle to fix linear filtering near the edges. We're not supposed to get CLAMP_TO_EDGE behaviour until we hit the edges of the read buffer, but without the extra border we get it alrady when we hit the edges of the source rectangle.

This fixes all the flip_src_x/y tests in piglit.spec.arb_framebuffer_object.fbo-blit-stretch on i915, and most of the stretch tests as well. IIRC the remaining failures are due to allocating an oversized temp texture and hence not always getting the CLAMP_TO_EDGE behavious we want.

v2: Make it better

Cc: mesa-stable@lists.freedesktop.org Cc: Eric Anholt eric@anholt.net Cc: Kenneth Graunke kenneth@whitecape.org Cc: Ian Romanick ian.d.romanick@intel.com Cc: Anuj Phogat anuj.phogat@gmail.com Fixes: b702233f ("meta: Refactor the BlitFramebuffer color CopyTexImage fallback.") References: https://bugs.freedesktop.org/show_bug.cgi?id=101414 Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com

6ddd9436 (Ville Syrjälä) meta: Fix glBlitFramebuffer temp texture setup

src/mesa/drivers/common/meta_blit.c | 45 ++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 8 deletions(-)

Merge request reports