> For the complete documentation index, see [llms.txt](https://okzkx.gitbook.io/blogs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://okzkx.gitbook.io/blogs/game-tech/engine/gpu/vulkan/renderer-steps.md).

# 渲染器流程

1. SimpleLogger Init
2. Set up window
   1. Create event loop
   2. Build window
3. Create VulkanContext
   1. Create vulkan instance
      1. Ash\_window::enumerate\_required\_extensions
      2. Create Vulkan Instance
      3. DebugUtilMessenger
   2. Create vulkan surface
   3. Create vulkan physical device and queue families indices
   4. Create vulkan device and graphics, present queues
   5. Create command buffer pool
4. Allocate command buffer
5. Create swapchain
   1. Create vulkan swapchain
      1. Swapchain format
      2. Swapchain present mode
      3. Swapchain extent (width , height)
      4. Swapchian image count
      5. Create swapchain
      6. Create swapchain image views
   2. Create vulkan render pass
      1. Attachment descriptions
      2. Color attachment reference
      3. Subpass descriptions
      4. Subpass dependency
      5. Create render pass
   3. Create vulkan frame buffers
6. Semaphore for presentation
   1. Image available semaphore
   2. render finished semaphore
7. Create fence
8. Setup Imgui
   1. Create Imgui
   2. WinitPlatform init imgui
   3. Imgui add fonts
   4. Platform attach window
9. Allocate renderer
10. Main loop
    1. platform handle event
    2. new frame event
    3. dirty swapchain
    4. UI
       1. generate ui
       2. draw ui
       3. create ui draw data
    5. device wait for preframe fence
    6. swap chain acquire next image
    7. record ui draw data to command buffer
       1. begin render pass with frame buffer, render area, clear value
       2. insert draw data
       3. end render pass
    8. vulkan\_context submit command\_buffers
    9. get present\_result
11. LoopDestroyed
    1. destroy any thing


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://okzkx.gitbook.io/blogs/game-tech/engine/gpu/vulkan/renderer-steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
