Skip to content

Add SIGGRAPH2026 Vulkan tutorial#419

Open
iagoCL wants to merge 3 commits into
KhronosGroup:mainfrom
iagoCL:siggraph2026_code
Open

Add SIGGRAPH2026 Vulkan tutorial#419
iagoCL wants to merge 3 commits into
KhronosGroup:mainfrom
iagoCL:siggraph2026_code

Conversation

@iagoCL

@iagoCL iagoCL commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Code for the SIGGRAPH 2026 Vulkan Tutorial.

@CLAassistant

CLAassistant commented Jul 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

The repo includes a Visual Studio 2022 x64 preset:

```bash
cmake --preset vs2022-debug -DSLANGC_EXECUTABLE="C:/VulkanSDK/1.4.341.1/Bin/slangc.exe"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason there is a preset that's pinned to a specific VS version? I'm already on VS2026.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to give an easy to configure/build/run version so I just added a preset to make it easy to compile

I changed to make it clear we also support 2026

@SaschaWillems SaschaWillems left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shader compilation fails for me with the following error:

Custom build for 'V:\Vulkan-Docs-Site\Vulkan-Tutorial-review\attachments\siggraph2026_vk_tutorial\build\vs2022\CMakeFiles\d79c7eb460355f97f6a43dc990eed41f\albedo.frag.spv.rule;V:\Vulkan-Docs-Site\Vulkan-Tutorial-review\attachments\siggraph2026_vk_tutorial\build\vs2022\CMakeFiles\f53c6c7b794bd22104e72c02a70f4a94\albedo_fragment_shader.rule;V:\Vulkan-Docs-Site\Vulkan-Tutorial-review\attachments\siggraph2026_vk_tutorial\CMakeLists.txt' exited with code 3.

I have the SDK installed, slangc is in the path, and CMake slang compiler variable properly points at it.

See the [course page](https://github.com/KhronosGroup/Vulkan-Tutorial/blob/main/en/courses/siggraph2026_vk_tutorial) for more information.

> [!NOTE]
> ChatGPT and Codex were used to generate code for this tutorial.

@SaschaWillems SaschaWillems Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this will upset at least some people. It might feel odd that the people creating the api (we as Khronos) use AI to generate code :/

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem removing it, but if I understand correctly Khronos want to disclose the use of AI.

I think I didn't use AI to write most of the code, the majority of the use was:

  • Review spelling and grammar
  • Small refactors ("Use span instead of vector for this function")
  • Generate some basic utility functions, mostly to parse glTF and JSON and for CMakefiles

I believe this was relatively reasonable and expected, so I think we can remove this if people prefer so.

After cloning the repository, initialize the pinned dependencies with:

```bash
python .\init_submodules.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required? Shouldn't git submodules work fine here? If not, why not use CMake's FetchContent instead?

@iagoCL iagoCL Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit complicated, there are some edge case with submodules.
I changed it to a CMake git command.

Comment thread .gitignore Outdated
attachments/template/build/** No newline at end of file
attachments/template/build/**

attachments/siggraph2026_vk_tutorial/.git/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the git folder excluded?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was an edge case with submodules.
No longer needed now that I am using Cmake

Comment thread attachments/siggraph2026_vk_tutorial/shaders/albedo.frag.slang Outdated
Comment thread attachments/siggraph2026_vk_tutorial/shaders/albedo.frag.slang Outdated
// [VK_SHADER_STAGE_FRAGMENT_BIT]. This is not invalid, but the write to the unused Output is discarded, causing a
// performance validation message. Proper solution is to have a custom vertex shader, but this is intentionally
// avoided to keep the tutorial simple.
if (color.a < 0.0f) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this supposed to do? The comment above doesn't refer to the actual code.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to clarify the comment.

We are using all variables, so Vulkan Validation layers does not point this as a performance warning.

Comment thread LICENSES/MIT.txt
@@ -0,0 +1,9 @@
MIT License

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason the license file is duplicated (see src/LICENSE)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially we planned this to be its own repository, MIT is one of the license we use as standard for new projects, so we choose MIT license.

The CI requires to have a MIT license file here.

I would not mind to remove the one in attachments/siggraph2026_vk_tutorial/LICENSE

# SIGGRAPH 2026: How to write a Vulkan application

This is a simple tutorial with the objective of explaining how to write a Vulkan application in 2026.
The tutorial employs the latest recommended best practices for beginners:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh. I wouldn't say that descriptor heaps are a topic for beginners.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I removed the sentence about beginners.

I personally think they are completely different form classic descriptor sets, and require a new mental model.
I would not call them more beginner friendly but I think they can be a proper alternative for new developers.

I find them easy to use, if you have experience with memory, but I think is going to depend on the person.

Comment thread attachments/siggraph2026_vk_tutorial/README.md Outdated
Comment thread attachments/siggraph2026_vk_tutorial/CMakeLists.txt Outdated
Comment thread attachments/siggraph2026_vk_tutorial/CMakeLists.txt Outdated
Change Cmake to clone the modules instead of using submodules.
Remove HLSL annotations from Slang.
Readme is AsciiDoc.
Clarify comment about unused vertex output
Improve Cmake
@iagoCL

iagoCL commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Shader compilation fails for me with the following error:

Custom build for 'V:\Vulkan-Docs-Site\Vulkan-Tutorial-review\attachments\siggraph2026_vk_tutorial\build\vs2022\CMakeFiles\d79c7eb460355f97f6a43dc990eed41f\albedo.frag.spv.rule;V:\Vulkan-Docs-Site\Vulkan-Tutorial-review\attachments\siggraph2026_vk_tutorial\build\vs2022\CMakeFiles\f53c6c7b794bd22104e72c02a70f4a94\albedo_fragment_shader.rule;V:\Vulkan-Docs-Site\Vulkan-Tutorial-review\attachments\siggraph2026_vk_tutorial\CMakeLists.txt' exited with code 3.

I have the SDK installed, slangc is in the path, and CMake slang compiler variable properly points at it.

Sorry which version of the SKD do you have?
I am on 1.4.350.0 and seems to work for me.
Jose emilio was also able to compile it

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.

3 participants