@@ -53,7 +53,7 @@ static void bind_program_resources(VkrCommand* cmd, VkrSpecProgram* prog) {
5353
5454static Command make_command_base () {
5555 return (Command ) {
56- .wait_for_completion = (bool (* )(Command * )) vkr_wait_completion ,
56+ .wait_for_completion = (bool (* )(Command * )) vkr_wait_completion ,
5757 };
5858}
5959
@@ -92,7 +92,7 @@ VkrCommand* vkr_launch_kernel(VkrDevice* device, Program* program, String entry_
9292 };
9393 CHECK_VK (vkCreateQueryPool (device -> device , & qpci , NULL , & cmd -> query_pool ), {});
9494 cmd -> profiled_gpu_time = options -> profiled_gpu_time ;
95- vkCmdResetQueryPool (cmd -> cmd_buf , cmd -> query_pool , 0 , 1 );
95+ vkCmdResetQueryPool (cmd -> cmd_buf , cmd -> query_pool , 0 , 2 );
9696 vkCmdWriteTimestamp (cmd -> cmd_buf , VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT , cmd -> query_pool , 0 );
9797 }
9898
@@ -174,7 +174,7 @@ bool vkr_wait_completion(VkrCommand* cmd) {
174174 if (cmd -> profiled_gpu_time ) {
175175 uint64_t ts [2 ];
176176 CHECK_VK (vkGetQueryPoolResults (cmd -> device -> device , cmd -> query_pool , 0 , 2 , sizeof (uint64_t ) * 2 , ts , sizeof (uint64_t ), VK_QUERY_RESULT_64_BIT ), {});
177- * cmd -> profiled_gpu_time = ts [1 ] - ts [0 ];
177+ * cmd -> profiled_gpu_time = ( ts [1 ] - ts [0 ]) * cmd -> device -> caps . properties . base . properties . limits . timestampPeriod ;
178178 }
179179 vkr_destroy_command (cmd );
180180 return true;
0 commit comments