@@ -53,7 +53,7 @@ static void bind_program_resources(VkrCommand* cmd, VkrSpecProgram* prog) {
53
53
54
54
static Command make_command_base () {
55
55
return (Command ) {
56
- .wait_for_completion = (bool (* )(Command * )) vkr_wait_completion ,
56
+ .wait_for_completion = (bool (* )(Command * )) vkr_wait_completion ,
57
57
};
58
58
}
59
59
@@ -92,7 +92,7 @@ VkrCommand* vkr_launch_kernel(VkrDevice* device, Program* program, String entry_
92
92
};
93
93
CHECK_VK (vkCreateQueryPool (device -> device , & qpci , NULL , & cmd -> query_pool ), {});
94
94
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 );
96
96
vkCmdWriteTimestamp (cmd -> cmd_buf , VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT , cmd -> query_pool , 0 );
97
97
}
98
98
@@ -174,7 +174,7 @@ bool vkr_wait_completion(VkrCommand* cmd) {
174
174
if (cmd -> profiled_gpu_time ) {
175
175
uint64_t ts [2 ];
176
176
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 ;
178
178
}
179
179
vkr_destroy_command (cmd );
180
180
return true;
0 commit comments