[Mesa-dev] [PATCH 2/2] radv: Always reset draw user SGPRs after secondary command buffer.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Apr 9 14:56:20 UTC 2018


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."
---
 src/amd/vulkan/radv_cmd_buffer.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index d8795ba562..db9992b2f6 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -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 =
-- 
2.17.0



More information about the mesa-dev mailing list