turnip: Force sysmem for tessellation
authorBrian Ho <brian@brkho.com>
Tue, 9 Jun 2020 18:48:49 +0000 (14:48 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Jun 2020 14:35:46 +0000 (14:35 +0000)
Tessellation is incompatible with HW binning (dEQP tests fail when
we set forcebin), so force sysmem when we finish recording a command
buffer that uses a tess pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5059>

src/freedreno/vulkan/tu_cmd_buffer.c
src/freedreno/vulkan/tu_private.h

index 2f88ca758cb2e3bbad72fb5f4c8d7c63231e97ef..41d6bfcdeddc11aacdb61fdf2fc2db3115f9f4b7 100644 (file)
@@ -730,6 +730,9 @@ use_sysmem_rendering(struct tu_cmd_buffer *cmd)
    if (cmd->state.framebuffer->layers > 1)
       return true;
 
+   if (cmd->has_tess)
+      return true;
+
    return cmd->state.tiling_config.force_sysmem;
 }
 
@@ -2514,6 +2517,9 @@ tu_CmdExecuteCommands(VkCommandBuffer commandBuffer,
             cmd->record_result = result;
             break;
          }
+
+         if (secondary->has_tess)
+            cmd->has_tess = true;
       } else {
          assert(tu_cs_is_empty(&secondary->draw_cs));
          assert(tu_cs_is_empty(&secondary->draw_epilogue_cs));
@@ -3217,6 +3223,7 @@ tu6_bind_draw_states(struct tu_cmd_buffer *cmd,
          pipeline->active_stages & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
    struct tu_cs_entry tess_consts = {};
    if (has_tess) {
+      cmd->has_tess = true;
       result = tu6_emit_tess_consts(cmd, draw, pipeline, &tess_consts);
       if (result != VK_SUCCESS)
          return result;
index df843ee2789222fd31e5c5dd3ee3db3095e4c558..532ab64362c263bc3be1a736b4268dfd155af671 100644 (file)
@@ -967,6 +967,8 @@ struct tu_cmd_buffer
 
    struct tu_bo scratch_bo;
 
+   bool has_tess;
+
    struct tu_bo vsc_draw_strm;
    struct tu_bo vsc_prim_strm;
    uint32_t vsc_draw_strm_pitch;