Extremely slow vkQueuePresentKHR


#1

I’m using mailbox present mode because this GPU doesn’t seem to support any other non-vsynced method. vkQueuePresentKHR() is extremely slow. If I render one instance of one object then vkQueuePresentKHR takes about one millisecond:

vkCmdDrawIndexed(commandbuffers[currentFrame], mesh->indiceCount, 1, 0, 0, 0);

If I change the instance count to 100000 then vkQueuePresentKHR takes about 120 milliseconds.

vkCmdDrawIndexed(commandbuffers[currentFrame], mesh->indiceCount, 100000, 0, 0, 0);

It makes no sense to me that the number of instances would cause any slowdown here, certainly not on the level I am seeing. OpenGL renders the same amount of geometry pretty much instantly on the same hardware. What’s going on here?


#2

Okay, I found this was really down to the frag shader and number of pixels being filled. Need to do more work before I have a fair comparison.