From e014248b3b053c8a4f448681a87771dec200d8cc Mon Sep 17 00:00:00 2001 From: Codotaku <88196711+CodesOtakuYT@users.noreply.github.com> Date: Wed, 26 Jul 2023 15:36:21 +0100 Subject: [PATCH 1/2] Provide more info about vk.xml path --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45cbff1..ff6f47f 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,20 @@ vulkan-zig aims to be always compatible with the ever-changing Zig master branch ### CLI-interface A CLI-interface is provided to generate vk.zig from the [Vulkan XML registry](https://github.com/KhronosGroup/Vulkan-Docs/blob/main/xml), which is built by default when invoking `zig build` in the project root. To generate vk.zig, simply invoke the program as follows: ``` -$ zig-out/bin/vulkan-zig-generator path/to/vk.xml output/path/to/vk.zig +$ zig-out/bin/generator path/to/vk.xml output/path/to/vk.zig ``` This reads the xml file, parses its contents, renders the Vulkan bindings, and formats file, before writing the result to the output path. While the intended usage of vulkan-zig is through direct generation from build.zig (see below), the CLI-interface can be used for one-off generation and vendoring the result. +NOTE: you need to replace `path/to/vk.xml` with the spec path from whatever source you prefer, here are some example orderered from the most recommended: +- Vulkan-Headers repo: + https://github.com/KhronosGroup/Vulkan-Headers/blob/main/registry/vk.xml +- Vulkan SDK (you need the package installed on your system with environment path setup): + Windows: + Powershell: ${env:VULKAN_SDK}/share/vulkan/registry + Cmd: %VULKAN_SDL%/share/vulkan/registry + Linux: + /usr/share/vulkan/registry/vk.xml +- local vk.xml inside examples: + vulkan-zig\examples\vk.xml ### Generation from build.zig Vulkan bindings can be generated from the Vulkan XML registry at compile time with build.zig, by using the provided Vulkan generation step: From a5aac7ad14a700066345671b375c3ca2dce6b7d0 Mon Sep 17 00:00:00 2001 From: Codotaku Date: Wed, 26 Jul 2023 16:39:20 +0100 Subject: [PATCH 2/2] Provide more info about vk.xml path --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ff6f47f..5972c1a 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,13 @@ A CLI-interface is provided to generate vk.zig from the [Vulkan XML registry](ht $ zig-out/bin/generator path/to/vk.xml output/path/to/vk.zig ``` This reads the xml file, parses its contents, renders the Vulkan bindings, and formats file, before writing the result to the output path. While the intended usage of vulkan-zig is through direct generation from build.zig (see below), the CLI-interface can be used for one-off generation and vendoring the result. -NOTE: you need to replace `path/to/vk.xml` with the spec path from whatever source you prefer, here are some example orderered from the most recommended: -- Vulkan-Headers repo: +NOTE: you need to replace `path/to/vk.xml` with the spec path from whatever source you prefer, here are some examples orderered from the most recommended: +- Vulkan SDK, you need the package installed on your system with environment path setup but its the most stable option: + /share/vulkan/registry/vk.xml +- Vulkan-Headers repo, doesn't require the Vulkan SDK in the build environment: https://github.com/KhronosGroup/Vulkan-Headers/blob/main/registry/vk.xml -- Vulkan SDK (you need the package installed on your system with environment path setup): - Windows: - Powershell: ${env:VULKAN_SDK}/share/vulkan/registry - Cmd: %VULKAN_SDL%/share/vulkan/registry - Linux: - /usr/share/vulkan/registry/vk.xml - local vk.xml inside examples: - vulkan-zig\examples\vk.xml + vulkan-zig\examples\vk.xml ### Generation from build.zig Vulkan bindings can be generated from the Vulkan XML registry at compile time with build.zig, by using the provided Vulkan generation step: