radeonsi: don't convert to fp16 in the compute blit if not testing
authorMarek Olšák <marek.olsak@amd.com>
Mon, 7 Nov 2022 02:42:38 +0000 (21:42 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 15 Mar 2023 13:16:34 +0000 (13:16 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>

src/gallium/drivers/radeonsi/si_compute_blit.c

index 84187a6..474e5f5 100644 (file)
@@ -1158,10 +1158,17 @@ bool si_compute_blit(struct si_context *sctx, const struct pipe_blit_info *info,
    options.use_integer_one = util_format_is_pure_integer(info->dst.format) &&
                              options.last_src_channel < options.last_dst_channel &&
                              options.last_dst_channel == 3;
-   options.fp16_rtz = !util_format_is_pure_integer(info->dst.format) &&
-                      (dst_desc->channel[i].size <= 10 ||
-                       (dst_desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT &&
-                        dst_desc->channel[i].size <= 16));
+
+   /* WARNING: We only use this codepath for AMD_TEST to get results identical with the gfx blit,
+    * otherwise we wouldn't be able to fully validate whether everything else works.
+    * The test expects that the behavior is identical to u_blitter.
+    */
+   if (testing) {
+      options.fp16_rtz = !util_format_is_pure_integer(info->dst.format) &&
+                         (dst_desc->channel[i].size <= 10 ||
+                          (dst_desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT &&
+                           dst_desc->channel[i].size <= 16));
+   }
 
    struct hash_entry *entry = _mesa_hash_table_search(sctx->cs_blit_shaders,
                                                       (void*)(uintptr_t)options.key);