@@ -41,34 +41,32 @@ class Device {
41
41
42
42
public:
43
43
// / @brief Check if a certain device extension is available for a specific graphics card.
44
- // / @param graphics_card The graphics card.
45
- // / @param extension The name of the device extension.
46
- // / @return ``true`` if the requested device extension is available.
44
+ // / @param graphics_card The graphics card
45
+ // / @param extension The name of the device extension
46
+ // / @return ``true`` if the requested device extension is available
47
47
[[nodiscard]] static bool is_extension_supported (VkPhysicalDevice graphics_card, const std::string &extension);
48
48
49
49
// / @brief Check if a swapchain is available for a specific graphics card.
50
- // / @param graphics_card The graphics card.
51
- // / @return ``true`` if swapchain is supported.
50
+ // / @param graphics_card The graphics card
51
+ // / @return ``true`` if swapchain is supported
52
52
[[nodiscard]] static bool is_swapchain_supported (VkPhysicalDevice graphics_card);
53
53
54
54
// / @brief Check if presentation is available for a specific combination of graphics card and surface.
55
- // / @param graphics_card The graphics card.
56
- // / @param surface The ( window) surface.
57
- // / @return ``true`` if presentation is supported.
55
+ // / @param graphics_card The graphics card
56
+ // / @param surface The window surface
57
+ // / @return ``true`` if presentation is supported
58
58
[[nodiscard]] static bool is_presentation_supported (VkPhysicalDevice graphics_card, VkSurfaceKHR surface);
59
59
60
60
// / @brief Default constructor.
61
- // / @param instance The instance wrapper from which the device will be created.
62
- // / @param surface The surface which will be associated with the device.
63
- // / @param enable_vulkan_debug_markers True if Vulkan debug markers should be enabled, false otherwise.
64
- // / @param prefer_distinct_transfer_queue True if a distinct data transfer queue (if available) should be
65
- // / enabled, false otherwise.
61
+ // / @param instance The instance wrapper from which the device will be created
62
+ // / @param surface The surface which will be associated with the device
63
+ // / @param enable_vulkan_debug_markers ``true`` if Vulkan debug markers should be enabled
64
+ // / @param prefer_distinct_transfer_queue ``true`` if a distinct data transfer queue should be preferred
66
65
// / @param preferred_physical_device_index The index of the preferred graphics card which should be used,
67
66
// / starting from 0. If the graphics card index is invalid or if the graphics card is unsuitable for the
68
67
// / application's purpose, another graphics card will be selected automatically. See the details of the device
69
- // / selection mechanism!
70
- // / @todo Add overloaded constructors for VkPhysicalDeviceFeatures and requested device extensions in the
71
- // / future!
68
+ // / selection mechanism.
69
+ // / TODO: Add overloaded constructors for VkPhysicalDeviceFeatures and requested device extensions
72
70
Device (const wrapper::Instance &instance, VkSurfaceKHR surface, bool enable_vulkan_debug_markers,
73
71
bool prefer_distinct_transfer_queue,
74
72
std::optional<std::uint32_t > preferred_physical_device_index = std::nullopt);
@@ -126,39 +124,131 @@ class Device {
126
124
// / @brief Assign an internal Vulkan debug marker name to a Vulkan object.
127
125
// / This internal name can be seen in external debuggers like RenderDoc.
128
126
// / @note This method is only available in debug mode with ``VK_EXT_debug_marker`` device extension enabled.
129
- // / @param object The Vulkan object.
130
- // / @param object_type The Vulkan debug report object type.
131
- // / @param name The internal name of the Vulkan object.
127
+ // / @param object The Vulkan object
128
+ // / @param object_type The Vulkan debug report object type
129
+ // / @param name The internal name of the Vulkan object
132
130
void set_debug_marker_name (void *object, VkDebugReportObjectTypeEXT object_type, const std::string &name) const ;
133
131
134
132
// / @brief Assigns a block of memory to a Vulkan resource.
135
133
// / This memory block can be seen in external debuggers like RenderDoc.
136
134
// / @note This method is only available in debug mode with ``VK_EXT_debug_marker`` device extension enabled.
137
- // / @param object The Vulkan object.
138
- // / @param object_type The Vulkan debug report object type.
139
- // / @param name The name of the memory block which will be connected to this object.
140
- // / @param memory_size The size of the memory block in bytes.
141
- // / @param memory_address The memory address to read from.
135
+ // / @param object The Vulkan object
136
+ // / @param object_type The Vulkan debug report object type
137
+ // / @param name The name of the memory block which will be connected to this object
138
+ // / @param memory_size The size of the memory block in bytes
139
+ // / @param memory_block The memory block to read from
142
140
void set_memory_block_attachment (void *object, VkDebugReportObjectTypeEXT object_type, std::uint64_t name,
143
141
std::size_t memory_size, const void *memory_block) const ;
144
142
145
- // / @param color [in] The rgba color of the rendering region.
146
- // / @param name [in] The name of the rendering region.
147
- // / @param command_buffer [in] The associated command buffer.
148
- // / The rendering region will be visible in external debuggers like RenderDoc.
149
143
// / @brief Vulkan debug markers: Annotation of a rendering region.
144
+ // / The rendering region will be visible in external debuggers like RenderDoc.
145
+ // / @param command_buffer The associated command buffer
146
+ // / @param name The name of the rendering region
147
+ // / @param color The rgba color of the rendering region
150
148
void bind_debug_region (VkCommandBuffer command_buffer, const std::string &name, std::array<float , 4 > color) const ;
151
149
152
- // / @brief Insert a debug markers into the current renderpass using vkCmdDebugMarkerInsertEXT. This debug
153
- // / markers can be seen in external debuggers like RenderDoc.
154
- // / @param command_buffer The command buffer which is associated to the debug marker.
155
- // / @param name The name of the debug marker.
156
- // / @param color An array of red, green, blue and alpha values for the debug region's color.
150
+ // / @brief Insert a debug markers into the current renderpass using vkCmdDebugMarkerInsertEXT.
151
+ // / This debug markers can be seen in external debuggers like RenderDoc.
152
+ // / @param command_buffer The command buffer which is associated to the debug marker
153
+ // / @param name The name of the debug marker
154
+ // / @param color An array of red, green, blue and alpha values for the debug region's color
157
155
void insert_debug_marker (VkCommandBuffer command_buffer, const std::string &name, std::array<float , 4 > color) const ;
158
156
159
157
// / @brief End the debug region of the current renderpass using vkCmdDebugMarkerEndEXT.
160
- // / @param command_buffer The command buffer which is associated to the debug marker.
158
+ // / @param command_buffer The command buffer which is associated to the debug marker
161
159
void end_debug_region (VkCommandBuffer command_buffer) const ;
160
+
161
+ // / @brief Call vkCreateCommandPool
162
+ // / @param command_pool_ci The command pool create info structure
163
+ // / @param command_pool The command pool to create
164
+ // / @param name The internal debug marker name which will be assigned to this command pool
165
+ void create_command_pool (const VkCommandPoolCreateInfo &command_pool_ci, VkCommandPool *command_pool,
166
+ const std::string &name) const ;
167
+
168
+ // / @brief Call vkCreateDescriptorPool
169
+ // / @param descriptor_pool_ci The descriptor pool create info structure
170
+ // / @param descriptor_pool The descriptor pool to create
171
+ // / @param name The internal debug marker name which will be assigned to this command pool
172
+ void create_descriptor_pool (const VkDescriptorPoolCreateInfo &descriptor_pool_ci, VkDescriptorPool *descriptor_pool,
173
+ const std::string &name) const ;
174
+
175
+ // / @brief Call vkCreateDescriptorSetLayout
176
+ // / @param descriptor_set_layout_ci The descriptor set layout create info structure
177
+ // / @param descriptor_set_layout The descriptor set layout to create
178
+ // / @param name The internal debug marker name which will be assigned to this descriptor set layout
179
+ void create_descriptor_set_layout (const VkDescriptorSetLayoutCreateInfo &descriptor_set_layout_ci,
180
+ VkDescriptorSetLayout *descriptor_set_layout, const std::string &name) const ;
181
+
182
+ // / @brief Call vkCreateFence
183
+ // / @param fence_ci The fence create info structure
184
+ // / @param fence The fence to create
185
+ // / @param name The internal debug marker name which will be assigned to this fence
186
+ void create_fence (const VkFenceCreateInfo &fence_ci, VkFence *fence, const std::string &name) const ;
187
+
188
+ // / @brief Call vkCreateFramebuffer
189
+ // / @param framebuffer_ci The framebuffer create info structure
190
+ // / @param framebuffer The Vulkan framebuffer to create
191
+ // / @param name The internal debug marker name which will be assigned to this framebuffer
192
+ void create_framebuffer (const VkFramebufferCreateInfo &framebuffer_ci, VkFramebuffer *framebuffer,
193
+ const std::string &name) const ;
194
+
195
+ // / @brief Call vkCreateGraphicsPipelines
196
+ // / @param pipeline_ci The graphics pipeline create info structure
197
+ // / @param pipeline The graphics pipeline to create
198
+ // / @param name The internal debug marker name which will be assigned to this pipeline
199
+ // TODO: Offer parameter for Vulkan pipeline caches!
200
+ // TODO: Use std::span to offer a more general method (creating multiple pipelines with one call)
201
+ // TODO: We might want to use std::span<std::pair<VkGraphicsPipelineCreateInfo, VkPipeline *>>
202
+ void create_graphics_pipeline (const VkGraphicsPipelineCreateInfo &pipeline_ci, VkPipeline *pipeline,
203
+ const std::string &name) const ;
204
+
205
+ // / @brief Call vkCreateImageView
206
+ // / @param image_view_ci The image view create info structure
207
+ // / @param image_view The image view to create
208
+ // / @param name The internal debug marker name which will be assigned to this image view
209
+ void create_image_view (const VkImageViewCreateInfo &image_view_ci, VkImageView *image_view,
210
+ const std::string &name) const ;
211
+
212
+ // / @brief Call vkCreatePipelineLayout
213
+ // / @param pipeline_layout_ci The pipeline layout create info structure
214
+ // / @param pipeline_layout The pipeline layout to create
215
+ // / @param name The internal debug marker name which will be assigned to this pipeline layout
216
+ void create_pipeline_layout (const VkPipelineLayoutCreateInfo &pipeline_layout_ci, VkPipelineLayout *pipeline_layout,
217
+ const std::string &name) const ;
218
+
219
+ // / @brief Call vkCreateRenderPass
220
+ // / @param render_pass_ci The render pass create info structure
221
+ // / @param render_pass The render pass to create
222
+ // / @param name The internal debug marker name which will be assigned to this render pass
223
+ void create_render_pass (const VkRenderPassCreateInfo &render_pass_ci, VkRenderPass *render_pass,
224
+ const std::string &name) const ;
225
+
226
+ // / @brief Call vkCreateSampler
227
+ // / @param sampler_ci The sampler create info structure
228
+ // / @param sampler The sampler to create
229
+ // / @param name The internal debug marker name which will be assigned to this sampler
230
+ void create_sampler (const VkSamplerCreateInfo &sampler_ci, VkSampler *sampler, const std::string &name) const ;
231
+
232
+ // / @brief Call vkCreateSemaphore
233
+ // / @param semaphore_ci The semaphore create info structure
234
+ // / @param semaphore The semaphore to create
235
+ // / @param name The internal debug marker name which will be assigned to this semaphore
236
+ void create_semaphore (const VkSemaphoreCreateInfo &semaphore_ci, VkSemaphore *semaphore,
237
+ const std::string &name) const ;
238
+
239
+ // / @brief Call vkCreateShaderModule
240
+ // / @param shader_module_ci The shader module create info structure
241
+ // / @param shader_module The shader module to create
242
+ // / @param name The internal debug marker name which will be assigned to this shader module
243
+ void create_shader_module (const VkShaderModuleCreateInfo &shader_module_ci, VkShaderModule *shader_module,
244
+ const std::string &name) const ;
245
+
246
+ // / @brief Call vkCreateSwapchainKHR
247
+ // / @param swapchain_ci The swapchain_ci create info structure
248
+ // / @param swapchain The swapchain to create
249
+ // / @param name The internal debug marker name which will be assigned to this swapchain
250
+ void create_swapchain (const VkSwapchainCreateInfoKHR &swapchain_ci, VkSwapchainKHR *swapchain,
251
+ const std::string &name) const ;
162
252
};
163
253
164
254
} // namespace inexor::vulkan_renderer::wrapper
0 commit comments