Skip to content

Commit

Permalink
Fixed the misuse of vkGetQueryPoolResults in the profiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
apanteleev committed Sep 11, 2024
1 parent 31ea9d0 commit af8459f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/refresh/vkpt/profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ typedef struct profiler_entry_samples_s
static struct {
VkQueryPool query_pool;

uint64_t query_pool_results[NUM_PROFILER_QUERIES_PER_FRAME * 2];
// ^^^
// not sure why (* 2) is necessary, looks like there is a bug in AMD drivers
// causing vkGetQueryPoolResults to stop writing the results halfway through
// the buffer if it's properly sized.
uint64_t query_pool_results[NUM_PROFILER_QUERIES_PER_FRAME];

bool queries_used[NUM_PROFILER_QUERIES_PER_FRAME * MAX_FRAMES_IN_FLIGHT];

Expand Down Expand Up @@ -212,7 +208,7 @@ vkpt_profiler_next_frame(VkCommandBuffer cmd_buf)
sizeof(profiler_data.query_pool_results),
profiler_data.query_pool_results,
sizeof(profiler_data.query_pool_results[0]),
VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT);
VK_QUERY_RESULT_64_BIT);

if (result != VK_SUCCESS && result != VK_NOT_READY)
{
Expand Down

0 comments on commit af8459f

Please sign in to comment.