Skip to content

Commit

Permalink
Merge pull request #102 from CodesOtakuYT/patch-3
Browse files Browse the repository at this point in the history
Provide more info about vk.xml path and fix generator path in README
  • Loading branch information
Snektron authored Jul 26, 2023
2 parents 4156f73 + a5aac7a commit 391998e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ 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 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
- 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:
Expand Down

0 comments on commit 391998e

Please sign in to comment.