Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question regarding buffer upload synchronization #301

Open
Desperado17 opened this issue Aug 12, 2022 · 0 comments
Open

Question regarding buffer upload synchronization #301

Desperado17 opened this issue Aug 12, 2022 · 0 comments

Comments

@Desperado17
Copy link

Greetings, I have a question regarding one of the tutorials.
I'd have used disqus but the registration doesn't work for me so this is my only remaining option, sorry.

In your tutorial you have a createVertexBuffer function which creates a staging buffer, maps, writes and unmaps it then copies it to the final gpu memory buffer:

void createVertexBuffer() {

The copy uses endSingleTimeCommands which itself uses an vkQueueWaitIdle to ait on the graphics queue.

I have an OpenGL application that uploads small buffers to the gpu per frame. It is using merely glMapBuffer/glUnmapBuffer with unsynchronized access at a point where it knows the buffer is not used by the gpu.

Now when I port this to Vulkan I have a measurable wait time at this vkQueueWaitIdle. In a high load test where 500 frames are allowed, the OpenGL app produces almost 500 while the Vulkan version produces 300. Cause seems to be a delay in the Linux poll() function caused by the above mentioned vkQueueWaitIdle which can be up to 10 ms which is just too much (X64 Ubuntu, Nvidia driver).

My question is if a separate command buffer and vkQueueWaitIdle is really necessary if I know the buffer is not in use at the moment. Can't I just drop all command in the same command buffer the drawcall that uses this VBO goes to?

Regards

@Desperado17 Desperado17 changed the title Question regarding Question regarding buffer upload synchronization Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant