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

Mac OS #77

Open
matt328 opened this issue Sep 16, 2022 · 3 comments
Open

Mac OS #77

matt328 opened this issue Sep 16, 2022 · 3 comments

Comments

@matt328
Copy link

matt328 commented Sep 16, 2022

Has anyone tried running this code on Mac OS? It works fine up until switching from vertices hard coded in the shader to vertex buffers. After this change, I don't get any validation warnings or errors, just nothing is rendered on the screen. It's really hard to debug on Mac, and of course it works just fine on Windows. Compiling with clang on both platforms if that matters.

I'm unable to get the chapter 3 code to run as-is on Mac OS, I get tons of linker errors coming from SDL. My own code that isn't working has some some minor differences from the code in this repo, mainly using vcpkg instead of vendoring everything.

I also have other examples of vertex buffers working on Mac OS, just there are a lot of differences, eg not using vkbootstrap or vulkan-memory-allocator.

I think the only way to debug vulkan on Mac OS is to install Xcode, but I can't for the life of me seem to free up enough disk space to allow Xcode to install.

@MHDtA-dev
Copy link

The same thing. I thought maybe I did something wrong, but my code is almost identical to the code of the tutorial. After I switched to the Vertex Buffer Object, the image disappeared. I don't know how to fix it.

@MHDtA-dev
Copy link

I solved this by completely abandoning the VulkanMemoryAllocator library. I created the buffer manually and the render appeared.

@rje
Copy link

rje commented Mar 21, 2023

Having a similar issue here - ch3 code works fine on windows and linux, but on macos I only see the strobing clear color

Edit: reading through the moltenvk docs, I noticed the following:

On macOS versions prior to macOS 10.15.6, native host-coherent image device memory is not available. Because of this, changes made to VkImage VK_MEMORY_PROPERTY_HOST_COHERENT_BIT device memory by the CPU or GPU will not be available to the GPU or CPU, respectively, until the memory is flushed or unmapped by the application.

Now, I am running a later OS version (13.2.1), and this is for a vertex buffer and not a a VkImage, But I tried adding the following after each vmaUnmapMemory() call:

vmaFlushAllocation(allocator, <allocation variable>, 0, VK_WHOLE_SIZE);

And sure enough, that resolved the issue.

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

3 participants