radv: Always reset draw user SGPRs after secondary command buffer.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 9 Apr 2018 14:54:55 +0000 (16:54 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 9 Apr 2018 21:04:42 +0000 (23:04 +0200)
As we sometimes reset them to -1, -1 does not mean that they are
not written by the secondary command buffer.

Fixes: ad11fc3571 "radv: don't emit unneeded vertex state."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_cmd_buffer.c

index cec62f6ac115283888e0df57401fbb73a670a292..4e89969016c69c357a7857436d893e6a3e2bf4dd 100644 (file)
@@ -2599,20 +2599,9 @@ void radv_CmdExecuteCommands(
                                secondary->state.last_ia_multi_vgt_param;
                }
 
-               if (secondary->state.last_first_instance != -1) {
-                       primary->state.last_first_instance =
-                               secondary->state.last_first_instance;
-               }
-
-               if (secondary->state.last_num_instances != -1) {
-                       primary->state.last_num_instances =
-                               secondary->state.last_num_instances;
-               }
-
-               if (secondary->state.last_vertex_offset != -1) {
-                       primary->state.last_vertex_offset =
-                               secondary->state.last_vertex_offset;
-               }
+               primary->state.last_first_instance = secondary->state.last_first_instance;
+               primary->state.last_num_instances = secondary->state.last_num_instances;
+               primary->state.last_vertex_offset = secondary->state.last_vertex_offset;
 
                if (secondary->state.last_index_type != -1) {
                        primary->state.last_index_type =