radv: allow launching waves out-of-order for compute
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Oct 2017 14:03:15 +0000 (16:03 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 9 Oct 2017 08:04:17 +0000 (10:04 +0200)
Ported from RadeonSI, and -pro seems to enable it as well.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 4b41b358e9914692c9021692b91f66946fc5ce75..3f6945bfea301b6a823873a1adec0ea1e53a6efd 100644 (file)
@@ -3216,7 +3216,15 @@ radv_emit_dispatch_packets(struct radv_cmd_buffer *cmd_buffer,
                }
        } else {
                unsigned blocks[3] = { info->blocks[0], info->blocks[1], info->blocks[2] };
-               unsigned dispatch_initiator = S_00B800_COMPUTE_SHADER_EN(1);
+               unsigned dispatch_initiator = S_00B800_COMPUTE_SHADER_EN(1) |
+                                             S_00B800_FORCE_START_AT_000(1);
+
+               if (cmd_buffer->device->physical_device->rad_info.chip_class >= CIK) {
+                       /* If the KMD allows it (there is a KMD hw register for
+                        * it), allow launching waves out-of-order.
+                        */
+                       dispatch_initiator |= S_00B800_ORDER_MODE(1);
+               }
 
                if (info->unaligned) {
                        unsigned *cs_block_size = compute_shader->info.cs.block_size;