Skip to content

Conversation

@gpx1000
Copy link
Contributor

@gpx1000 gpx1000 commented Oct 17, 2025

  • Include equivalent C code snippets for 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: Please do NOT merge until KhronosGroup/Vulkan-Site#141 is live. This depends upon that.

- 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.
@gpx1000
Copy link
Contributor Author

gpx1000 commented Oct 17, 2025

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.

@walcht
Copy link

walcht commented Oct 20, 2025

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.

  • 03_Drawing_a_triangle => 00_Setup/* (waiting for feedback on previous chapters)
  • 03_Drawing_a_triangle => 01_Presentation => 01_Swap_chain.adoc (done)
  • 03_Drawing_a_triangle => 01_Presentation => 02_Image_views.adoc (done)
  • 03_Drawing_a_triangle => 02_Graphics_pipeline_basics/01_Shader_modules.adoc (done)
  • 03_Drawing_a_triangle => 02_Graphics_pipeline_basics/02_Fixed_functions.adoc (done)
  • 03_Drawing_a_triangle => 02_Graphics_pipeline_basics/03_Render_passes.adoc (done)
  • 03_Drawing_a_triangle => 02_Graphics_pipeline_basics/04_Conclusion.adoc (done)

// END c++
// START c
VkBufferCreateInfo bufferInfo{};
Copy link
Collaborator

Choose a reason for hiding this comment

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

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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

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