From 2cd143b0f50b3089864957199c0c74fa8810b9bd Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Fri, 29 Aug 2025 12:58:42 +0200 Subject: [PATCH] r600: fix r600_resource_copy_region behavior for some formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function resource_copy_region is expected to have a memcpy() like behavior. Some formats, like r11g11b10_float, do not preserve the original raw values. This was the problem. This change updates r600_resource_copy_region() to use the generic copy path for those formats. This change takes into account how 8235d3aa1950 "radeonsi: preserve NaNs in draw-based resource_copy_region" proceeds. This change fixes the remaining khr-gl and deqp-gles31 copy_image tests. This change was tested on palm, barts and cayman. Here are the tests fixed: khr-gl4[2-6]/texture_view/view_classes: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_2d_array_src_format_rgb9_e5_dst_target_texture_2d_array_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_2d_array_src_format_rgb9_e5_dst_target_texture_3d_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_2d_array_src_format_rgb9_e5_dst_target_texture_rectangle_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_3d_src_format_rgb9_e5_dst_target_texture_2d_array_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_3d_src_format_rgb9_e5_dst_target_texture_3d_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_3d_src_format_rgb9_e5_dst_target_texture_rectangle_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_rectangle_src_format_rgb9_e5_dst_target_texture_2d_array_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_rectangle_src_format_rgb9_e5_dst_target_texture_3d_dst_format_r11f_g11f_b10f: fail pass khr-gl4[3-6]/copy_image/functional_src_target_texture_rectangle_src_format_rgb9_e5_dst_target_texture_rectangle_dst_format_r11f_g11f_b10f: fail pass deqp-gles31/functional/copy_image/non_compressed/viewclass_16_bits/.*: fail pass deqp-gles31/functional/copy_image/non_compressed/viewclass_32_bits/.*: fail pass Cc: mesa-stable Signed-off-by: Patrick Lerda Reviewed-by: Marek Olšák Part-of: (cherry picked from commit df5e8e1252f2703fd3d14ef08b531f85b508ad67) --- .pick_status.json | 2 +- .../drivers/r600/ci/r600-turks-fails.txt | 82 ------------------- src/gallium/drivers/r600/r600_blit.c | 5 +- 3 files changed, 5 insertions(+), 84 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f26e0ccafc4..3e9b9f305e3 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7824,7 +7824,7 @@ "description": "r600: fix r600_resource_copy_region behavior for some formats", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/r600/ci/r600-turks-fails.txt b/src/gallium/drivers/r600/ci/r600-turks-fails.txt index e7869fc72f1..c7b004f0a5b 100644 --- a/src/gallium/drivers/r600/ci/r600-turks-fails.txt +++ b/src/gallium/drivers/r600/ci/r600-turks-fails.txt @@ -312,88 +312,6 @@ dEQP-GLES31.functional.compute.shared_var.work_group_size.vec4_128_1_1,Fail dEQP-GLES31.functional.compute.shared_var.work_group_size.vec4_13_2_4,Fail dEQP-GLES31.functional.compute.shared_var.work_group_size.vec4_1_128_1,Fail -# Just a few pixels wrong in each. -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16i.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16i.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16i.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16i.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16ui.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16ui.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16ui.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_16_bits.rg8_snorm_r16ui.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32i.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32i.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32i.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32i.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32ui.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32ui.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32ui.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_r32ui.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16i.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16i.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16i.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16i.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16ui.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16ui.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16ui.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rg16ui.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.cubemap_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.cubemap_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.cubemap_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.cubemap_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_array_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_array_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_array_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_array_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture2d_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture3d_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture3d_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture3d_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2.texture3d_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.cubemap_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.cubemap_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.cubemap_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.cubemap_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.cubemap_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_array_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_array_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_array_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_array_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_array_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture2d_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture3d_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture3d_to_renderbuffer,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture3d_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture3d_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2ui.texture3d_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.cubemap_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.cubemap_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.cubemap_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.cubemap_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_array_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_array_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_array_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_array_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture2d_to_texture3d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture3d_to_cubemap,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture3d_to_texture2d,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture3d_to_texture2d_array,Fail -dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5.texture3d_to_texture3d,Fail - dEQP-GLES31.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.0,Fail dEQP-GLES31.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.1,Fail dEQP-GLES31.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.10,Fail diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 650325d8671..8911ee4fbd9 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -941,7 +941,10 @@ void r600_resource_copy_region(struct pipe_context *ctx, src_box = &sbox; src_force_level = src_level; - } else if (!util_blitter_is_copy_supported(rctx->blitter, dst, src)) { + } else if (!util_blitter_is_copy_supported(rctx->blitter, dst, src) || + (src->format == dst->format && + ((util_format_is_float(src->format) && !util_format_is_depth_or_stencil(src->format)) || + util_format_is_snorm(src->format)))) { if (util_format_is_subsampled_422(src->format)) { src_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;