In Vulkan, different concepts play distinct roles in the initialization phase versus the operational (rendering) phase of a program. Here's a breakdown:
Initialization Phase
These components are primarily involved in setting up your Vulkan environment and are typically used during the initialization phase:
-
Entry:
- This relates to the Vulkan loader, which is responsible for loading Vulkan functions dynamically. It’s mainly used at the very beginning of your program to fetch function pointers for Vulkan commands.
-
Instance:
- An instance is one of the first objects you create in a Vulkan application. It initializes the connection between your application and the Vulkan library, and enables instance-level functionalities such as enumerating physical devices and creating logical devices. It's set up during the initialization phase but remains relevant throughout the program for context-wide functionalities.
-
Physical Device:
- This represents a Vulkan-capable device (like a GPU) available on the system. It’s discovered and selected during the initialization phase. While you identify and select a physical device initially, the physical device itself doesn't get used directly in rendering but is used to create logical devices.
Operational Phase
These components are primarily used throughout the program's lifecycle for rendering operations:
-
Logical Device:
- Created from a physical device, the logical device is essential for Vulan commands that involve resource creation and rendering. It provides handles to the queues that are used to submit rendering commands. It remains critical throughout the life of the application as it directly interfaces with GPU resources.
-
Queues:
- Allocated from a logical device, queues are used extensively during rendering. Command buffers are submitted to queues for execution, making them a crucial concept throughout the entire application lifecycle. Different types of queues (graphics, compute, transfer) may handle different aspects of the rendering pipeline.
To summarize:
- Initialization: Entry, Instance, Physical Device are primarily involved in setup and are mostly used during the initialization stage.
- Operational: Logical Device, Queues are utilized throughout the program’s life for executing render commands and resource management.
Understanding these distinctions helps in efficiently organizing code and resources in a Vulkan application, ensuring that the resources and structures created during initialization are properly utilized during rendering operations.