Add C language examples alongside C++ in Vulkan tutorials#202
Add C language examples alongside C++ in Vulkan tutorials#202gpx1000 wants to merge 1 commit intoKhronosGroup:mainfrom
Conversation
- Include equivalent C code snippets for all Vulkan-related examples to enhance tutorial compatibility. - Annotate source blocks to specify programming languages for clarity (`[source,multilang,c++,c]`). - Improve cross-language consistency in method signatures, helper functions, and setup instructions.
|
NOTE: this is an in-progress work to test the site and to gradually migrate all code blocks to handle both C-API and current C++. Don't merge until all relevant code blocks have been addressed and the test site validates that this works as intended. |
|
For organizational purposes, I will keep track of chapters I am adjusting and their linked pull requests in this comment. All request changes are provided in this PR.
|
| // END c++ | ||
|
|
||
| // START c | ||
| VkBufferCreateInfo bufferInfo{}; |
There was a problem hiding this comment.
This should use designated initializers, just like the code a few lines below.
| void createVertexBuffer() { | ||
| VkBufferCreateInfo bufferInfo = { | ||
| .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, | ||
| .pNext = NULL, |
There was a problem hiding this comment.
More of a general question: Do we want to always set all fields, or should we omit those that are not set/required? In this case pNext and flags is not used and zeroed out when using designated initializers.
|
Is this still active? In case it is, I can complete adding equivalent C snippets for the remaining chapters (and updating already finished ones to current HEAD). (Note: I do understand that reviewing this is probably a major task) |
|
Yep still very much active. No worries about length of pr, we can deal
with it.
…On Mon, Jan 19, 2026, 9:50 PM Walid Chtioui ***@***.***> wrote:
*walcht* left a comment (KhronosGroup/Vulkan-Tutorial#202)
<#202 (comment)>
Is this still active? In case it is, I can complete adding equivalent C
snippets for the remaining chapters.
(Note: I do understand that reviewing this is probably a major task)
—
Reply to this email directly, view it on GitHub
<#202 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5IAY7NQE2WA3HCETS4IA34HW627AVCNFSM6AAAAACJQQH37GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONZRGE2TEOBQHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
We might want to agree on best practices and guidelines before too much work is done. Like if we add C, will this be pure C or "C in C++"? If it's the latter, will we use designated initializers? etc. |
[source,multilang,c++,c]).NOTE: Please do NOT merge until KhronosGroup/Vulkan-Site#141 is live. This depends upon that.