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

Enable debugPrintf example on macOS using validation layer #1124

Merged
merged 1 commit into from
May 25, 2024

Conversation

SRSaunders
Copy link
Contributor

@SRSaunders SRSaunders commented May 15, 2024

This small PR adds basic support for the debugprintf example on macOS. The shader debugPrintfEXT capability is not native on macOS/MoltenVK, but can be provided by VK_LAYER_KHRONOS_validation instead. This change forces validation on for this example and enables the layer's debugPrintfEXT feature when running on macOS. Without this change, the example's shaders will not cross compile to MSL and will not run on macOS.

Also, since RenderDoc is not available on macOS, and native graphics debuggers are Metal-centric (not Vulkan), this PR also enables the validation layer's printf to stdout feature which redirects output to the console window. Since the example is free running, you will see a continuous stream of printf output to the console, and periodically will observe a buffer overflow warning from the validation layer. This is a result of the layer using a fixed size internal printf buffer and can be safely ignored.

Fixes #1133

@SaschaWillems SaschaWillems merged commit 202cfbb into SaschaWillems:master May 25, 2024
3 checks passed
@SRSaunders SRSaunders deleted the debugprintf-macos branch May 25, 2024 18:19
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

Successfully merging this pull request may close these issues.

debugprintf example fails on macOS
2 participants