On 10/19/2017 08:45 PM, Bas Nieuwenhuizen wrote:
r-b for the series. MAybe add a fixes tag?

Thanks! Pushed with a fixes tag.


On Thu, Oct 19, 2017 at 12:35 PM, Samuel Pitoiset
<[email protected]> wrote:
Only on CIK and later. We should only update VGT_INDEX_TYPE but
it seems easier to re-emit all the index buffer packets.

Signed-off-by: Samuel Pitoiset <[email protected]>
---
  src/amd/vulkan/radv_cmd_buffer.c | 13 +++++++++++--
  1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index b3f0ad0da7..13489b9faf 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1770,8 +1770,17 @@ radv_cmd_buffer_flush_state(struct radv_cmd_buffer 
*cmd_buffer,
         if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_FRAMEBUFFER)
                 radv_emit_framebuffer_state(cmd_buffer);

-       if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_INDEX_BUFFER)
-               radv_emit_index_buffer(cmd_buffer);
+       if (indexed_draw) {
+               if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_INDEX_BUFFER)
+                       radv_emit_index_buffer(cmd_buffer);
+       } else {
+               /* On CI and later, non-indexed draws overwrite VGT_INDEX_TYPE,
+                * so the state must be re-emitted before the next indexed
+                * draw.
+                */
+               if (cmd_buffer->device->physical_device->rad_info.chip_class >= 
CIK)
+                       cmd_buffer->state.dirty |= RADV_CMD_DIRTY_INDEX_BUFFER;
+       }

         ia_multi_vgt_param = si_get_ia_multi_vgt_param(cmd_buffer, 
instanced_draw, indirect_draw, draw_vertex_count);
         if (cmd_buffer->state.last_ia_multi_vgt_param != ia_multi_vgt_param) {
--
2.14.2

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to