vulkano: Compute shader shader example doesn't perform compute on mac

  • Version of vulkano:
vulkano = "0.11"
vulkano-shaders = "0.11"
vulkano-win = "0.11"
  • OS: Mac OS X Mojave
  • GPU (the selected PhysicalDevice): GT750M
  • GPU Driver: Vulkan Instance Version: 1.1.92
  • Upload of a reasonably minimal complete main.rs file that demonstrates the issue: see basic-compute-shader.rs in the vulkano-examples repository.

Issue

The example runs but does does not return 12 as expected. Instead it returns 1. The computer shader does not perform the multiply operation.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 18 (14 by maintainers)

Most upvoted comments

Ok I’m also experiencing this issue https://github.com/KhronosGroup/MoltenVK/issues/377 But I realized that you can fix the above issue and the one we are having by Unmapping before any vkBindBufferMemory calls and then remapping. So if you need to bind buffer memory do it like:

  1. vkUnMapMemory
  2. vkBindBufferMemory
  3. vkMapMemory

So I’m having a similar problem aswell with the first example in the guide. It doesn’t swap the buffers. So I adapted a minimal c++ example to do the same thing here. It does work on my system. Then I cloned vulkano and put a print in the vulkan-sys calls so I could see exactly what calls the example was making. Output is here: output.txt

I’m working through the differences in the calls and my minimal c++ example. I’m pretty new to Vulkan but hopefully this helps.

So far the only thing I’ve noticed that is different is the way the memory is mapped and unmapped.

The queueCreateInfoCount was a me printing a variable wrong. It’s actually the same. In fact every single call and parameter is now exactly the same between the two examples. I still get a proper result with the c++ example and all 0’s with the vulkano. I think it must be something to do with how the memory is mapped / read. For example maybe there’s been an update to MoltenVK that means the memory mapping doesn’t last as long and is no longer active when we read or something. I’ll starting digging into the read and see what I can find.