summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-03-27 02:53:52 -0300
committerGravatar ReinUsesLisp2020-03-27 03:21:04 -0300
commit60f351084a060c40c4c1c0e6956ca1e4b284598e (patch)
tree42f8c92bd60223377657d779e611c9afadd26051 /src/video_core/renderer_vulkan
parentrenderer_vulkan/wrapper: Add dispatch table and loaders (diff)
downloadyuzu-60f351084a060c40c4c1c0e6956ca1e4b284598e.tar.gz
yuzu-60f351084a060c40c4c1c0e6956ca1e4b284598e.tar.xz
yuzu-60f351084a060c40c4c1c0e6956ca1e4b284598e.zip
renderer_vulkan/wrapper: Add destroy and free overload set
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/wrapper.cpp105
-rw-r--r--src/video_core/renderer_vulkan/wrapper.h28
2 files changed, 133 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp
index 6d7e141e1..c412b7f20 100644
--- a/src/video_core/renderer_vulkan/wrapper.cpp
+++ b/src/video_core/renderer_vulkan/wrapper.cpp
@@ -234,4 +234,109 @@ const char* ToString(VkResult result) noexcept {
234 return "Unknown"; 234 return "Unknown";
235} 235}
236 236
237void Destroy(VkInstance instance, const InstanceDispatch& dld) noexcept {
238 dld.vkDestroyInstance(instance, nullptr);
239}
240
241void Destroy(VkDevice device, const InstanceDispatch& dld) noexcept {
242 dld.vkDestroyDevice(device, nullptr);
243}
244
245void Destroy(VkDevice device, VkBuffer handle, const DeviceDispatch& dld) noexcept {
246 dld.vkDestroyBuffer(device, handle, nullptr);
247}
248
249void Destroy(VkDevice device, VkBufferView handle, const DeviceDispatch& dld) noexcept {
250 dld.vkDestroyBufferView(device, handle, nullptr);
251}
252
253void Destroy(VkDevice device, VkCommandPool handle, const DeviceDispatch& dld) noexcept {
254 dld.vkDestroyCommandPool(device, handle, nullptr);
255}
256
257void Destroy(VkDevice device, VkDescriptorPool handle, const DeviceDispatch& dld) noexcept {
258 dld.vkDestroyDescriptorPool(device, handle, nullptr);
259}
260
261void Destroy(VkDevice device, VkDescriptorSetLayout handle, const DeviceDispatch& dld) noexcept {
262 dld.vkDestroyDescriptorSetLayout(device, handle, nullptr);
263}
264
265void Destroy(VkDevice device, VkDescriptorUpdateTemplateKHR handle,
266 const DeviceDispatch& dld) noexcept {
267 dld.vkDestroyDescriptorUpdateTemplateKHR(device, handle, nullptr);
268}
269
270void Destroy(VkDevice device, VkDeviceMemory handle, const DeviceDispatch& dld) noexcept {
271 dld.vkFreeMemory(device, handle, nullptr);
272}
273
274void Destroy(VkDevice device, VkFence handle, const DeviceDispatch& dld) noexcept {
275 dld.vkDestroyFence(device, handle, nullptr);
276}
277
278void Destroy(VkDevice device, VkFramebuffer handle, const DeviceDispatch& dld) noexcept {
279 dld.vkDestroyFramebuffer(device, handle, nullptr);
280}
281
282void Destroy(VkDevice device, VkImage handle, const DeviceDispatch& dld) noexcept {
283 dld.vkDestroyImage(device, handle, nullptr);
284}
285
286void Destroy(VkDevice device, VkImageView handle, const DeviceDispatch& dld) noexcept {
287 dld.vkDestroyImageView(device, handle, nullptr);
288}
289
290void Destroy(VkDevice device, VkPipeline handle, const DeviceDispatch& dld) noexcept {
291 dld.vkDestroyPipeline(device, handle, nullptr);
292}
293
294void Destroy(VkDevice device, VkPipelineLayout handle, const DeviceDispatch& dld) noexcept {
295 dld.vkDestroyPipelineLayout(device, handle, nullptr);
296}
297
298void Destroy(VkDevice device, VkQueryPool handle, const DeviceDispatch& dld) noexcept {
299 dld.vkDestroyQueryPool(device, handle, nullptr);
300}
301
302void Destroy(VkDevice device, VkRenderPass handle, const DeviceDispatch& dld) noexcept {
303 dld.vkDestroyRenderPass(device, handle, nullptr);
304}
305
306void Destroy(VkDevice device, VkSampler handle, const DeviceDispatch& dld) noexcept {
307 dld.vkDestroySampler(device, handle, nullptr);
308}
309
310void Destroy(VkDevice device, VkSwapchainKHR handle, const DeviceDispatch& dld) noexcept {
311 dld.vkDestroySwapchainKHR(device, handle, nullptr);
312}
313
314void Destroy(VkDevice device, VkSemaphore handle, const DeviceDispatch& dld) noexcept {
315 dld.vkDestroySemaphore(device, handle, nullptr);
316}
317
318void Destroy(VkDevice device, VkShaderModule handle, const DeviceDispatch& dld) noexcept {
319 dld.vkDestroyShaderModule(device, handle, nullptr);
320}
321
322void Destroy(VkInstance instance, VkDebugUtilsMessengerEXT handle,
323 const InstanceDispatch& dld) noexcept {
324 dld.vkDestroyDebugUtilsMessengerEXT(instance, handle, nullptr);
325}
326
327void Destroy(VkInstance instance, VkSurfaceKHR handle, const InstanceDispatch& dld) noexcept {
328 dld.vkDestroySurfaceKHR(instance, handle, nullptr);
329}
330
331VkResult Free(VkDevice device, VkDescriptorPool handle, Span<VkDescriptorSet> sets,
332 const DeviceDispatch& dld) noexcept {
333 return dld.vkFreeDescriptorSets(device, handle, sets.size(), sets.data());
334}
335
336VkResult Free(VkDevice device, VkCommandPool handle, Span<VkCommandBuffer> buffers,
337 const DeviceDispatch& dld) noexcept {
338 dld.vkFreeCommandBuffers(device, handle, buffers.size(), buffers.data());
339 return VK_SUCCESS;
340}
341
237} // namespace Vulkan::vk 342} // namespace Vulkan::vk
diff --git a/src/video_core/renderer_vulkan/wrapper.h b/src/video_core/renderer_vulkan/wrapper.h
index f5f868233..e5d9b34f2 100644
--- a/src/video_core/renderer_vulkan/wrapper.h
+++ b/src/video_core/renderer_vulkan/wrapper.h
@@ -250,4 +250,32 @@ bool Load(InstanceDispatch&) noexcept;
250/// @return True on success, false on error. 250/// @return True on success, false on error.
251bool Load(VkInstance, InstanceDispatch&) noexcept; 251bool Load(VkInstance, InstanceDispatch&) noexcept;
252 252
253void Destroy(VkInstance, const InstanceDispatch&) noexcept;
254void Destroy(VkDevice, const InstanceDispatch&) noexcept;
255
256void Destroy(VkDevice, VkBuffer, const DeviceDispatch&) noexcept;
257void Destroy(VkDevice, VkBufferView, const DeviceDispatch&) noexcept;
258void Destroy(VkDevice, VkCommandPool, const DeviceDispatch&) noexcept;
259void Destroy(VkDevice, VkDescriptorPool, const DeviceDispatch&) noexcept;
260void Destroy(VkDevice, VkDescriptorSetLayout, const DeviceDispatch&) noexcept;
261void Destroy(VkDevice, VkDescriptorUpdateTemplateKHR, const DeviceDispatch&) noexcept;
262void Destroy(VkDevice, VkDeviceMemory, const DeviceDispatch&) noexcept;
263void Destroy(VkDevice, VkFence, const DeviceDispatch&) noexcept;
264void Destroy(VkDevice, VkFramebuffer, const DeviceDispatch&) noexcept;
265void Destroy(VkDevice, VkImage, const DeviceDispatch&) noexcept;
266void Destroy(VkDevice, VkImageView, const DeviceDispatch&) noexcept;
267void Destroy(VkDevice, VkPipeline, const DeviceDispatch&) noexcept;
268void Destroy(VkDevice, VkPipelineLayout, const DeviceDispatch&) noexcept;
269void Destroy(VkDevice, VkQueryPool, const DeviceDispatch&) noexcept;
270void Destroy(VkDevice, VkRenderPass, const DeviceDispatch&) noexcept;
271void Destroy(VkDevice, VkSampler, const DeviceDispatch&) noexcept;
272void Destroy(VkDevice, VkSwapchainKHR, const DeviceDispatch&) noexcept;
273void Destroy(VkDevice, VkSemaphore, const DeviceDispatch&) noexcept;
274void Destroy(VkDevice, VkShaderModule, const DeviceDispatch&) noexcept;
275void Destroy(VkInstance, VkDebugUtilsMessengerEXT, const InstanceDispatch&) noexcept;
276void Destroy(VkInstance, VkSurfaceKHR, const InstanceDispatch&) noexcept;
277
278VkResult Free(VkDevice, VkDescriptorPool, Span<VkDescriptorSet>, const DeviceDispatch&) noexcept;
279VkResult Free(VkDevice, VkCommandPool, Span<VkCommandBuffer>, const DeviceDispatch&) noexcept;
280
253} // namespace Vulkan::vk 281} // namespace Vulkan::vk