Hi forum,
I am trying to use streamline annotation for 4 vkCmdDrawIndexed in my test application with indexCount argument of 440, 220, 220, 53 respectively.
Each drawcall submission is preceded with a sleep and annotation and queuewaitidle as below.
for (size_t cb = 0; cb < n_drawcalls; ++cb)
{
VkSubmitInfo si;
si.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
si.commandBufferCount = 1;
si.pCommandBuffers = &command_buffers[cb];
sleep(3);
ANNOTATE_MARKER_COLOR_STR(ANNOTATE_GREEN, "Draw call start");
res = device_table->QueueSubmit(queue, 1, &si, nullptr);
device_table->QueueWaitIdle(queue);
ANNOTATE_MARKER_COLOR_STR(ANNOTATE_RED, "Draw call end");
}
When I look at some counters like $MaliInputPrimitivesTrianglePrimitives, it seems to be a cumulative count after each drawcall showing 440, 660, 880, 933 (screenshot).
I was expecting it to be 440, 220, 220, 53 to match with the indexCount argument of the vkCmdDrawIndexed. Other counters like FMA, CVT are being reset after each drawcall (screenshot). Is this expected or is there any way to reset the counters before each drawcall?
Counters are sampled and show the activity on the GPU in that time period, and reset each sample, so if you are seeing an increasing count that's probably due to how your command buffers are being recorded.
Can you show a more complete example?
Hi Peter,
Thank you for the inputs. I am trying out this code snippet in DumpDrawCalls routine in GFXR player: gfxreconstruct/framework/decode/vulkan_replay_dump_resources_draw_calls.cpp at dev · LunarG/gfxreconstruct · GitHub
Based on my understanding, the command buffer is recorded by calling CloneCommandBuffer in the same file when resource dumping is enabled. Let me know if you need more details.
With this code change and resource dumping feature of gfxr player am trying to dump the counters of drawcalls which is specified using a json file for a GFXR capture.
I can only really explain how the hardware sampling works and what you are seeing - debugging your modifications to GFXR is a bit beyond the scope of what Arm can help with =-) Based on what you are seeing it looks like you are replaying command buffers containing more and more draw calls. Beyond that I can't really help unless you have a minimal standalone reproducer that shows this is a driver bug.
Kind regards Pete