SaschaWillems / Vulkan

C++ examples for the Vulkan graphics API
MIT License
10.18k stars 2.02k forks source link

Question about computeheadless example #1131

Open losanc opened 3 months ago

losanc commented 3 months ago

Hi Willems,

I have a question about computeheadless example. here it creates a buffer memory barrier for devicebuffer from HOST_WRITE to SHADER_READ

After copy from staging buffer to device buffer, there is a fence to wait for the finish of copy. So is this barrier still necessary ?

if it's necessary, why srcAccessMask isVK_ACCESS_HOST_WRITE_BIT. Isn't host_write for the staging buffer, not device buffer? After the copy, shouldn't the srcAccessMask of device buffer be VK_ACCESS_TRANSFER_WRITE_BIT?

And thank you for this great tutorial!