Module: Mesa
Branch: main
Commit: da7e6f303b1a8ed7e9c13bccb6e4c90ff356a914
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=da7e6f303b1a8ed7e9c13bccb6e4c90ff356a914

Author: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
Date:   Sat Oct 21 01:36:48 2023 +0200

radv: Add some initial graphics DGC preprocessing support.

Just the bits that obviously need no adjustment in the DGC
preprocessing code.

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

---

 src/amd/vulkan/radv_device_generated_commands.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_device_generated_commands.c 
b/src/amd/vulkan/radv_device_generated_commands.c
index 5afd1c119a6..bb8748601ba 100644
--- a/src/amd/vulkan/radv_device_generated_commands.c
+++ b/src/amd/vulkan/radv_device_generated_commands.c
@@ -1346,8 +1346,20 @@ radv_CreateIndirectCommandsLayoutNV(VkDevice _device, 
const VkIndirectCommandsLa
     *
     * So we can always preprocess compute layouts.
     */
-   if (layout->pipeline_bind_point != VK_PIPELINE_BIND_POINT_COMPUTE)
-      layout->use_preprocess = false;
+   if (layout->pipeline_bind_point != VK_PIPELINE_BIND_POINT_COMPUTE) {
+      /* We embed the index buffer extent in indirect draw packets, but that 
isn't available at preprocess time. */
+      if (layout->indexed && !layout->binds_index_buffer)
+         layout->use_preprocess = false;
+
+      /* VBO binding (in particular partial VBO binding) uses some draw state 
which we don't generate at preprocess time
+       * yet. */
+      if (layout->bind_vbo_mask)
+         layout->use_preprocess = false;
+
+      /* In preprocess we use the non-overridden push constants from the draw 
state for now. */
+      if (layout->push_constant_mask)
+         layout->use_preprocess = false;
+   }
 
    *pIndirectCommandsLayout = radv_indirect_command_layout_to_handle(layout);
    return VK_SUCCESS;

Reply via email to