mirror of
https://github.com/korenkonder/ReDIVA.git
synced 2026-10-07 06:08:16 +03:00
Experimental Vulkan support
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
by korenkonder
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Semaphore.hpp"
|
||||
|
||||
namespace Vulkan {
|
||||
bool Semaphore::Create(VkDevice device, VkSemaphoreCreateFlags flags) {
|
||||
Destroy();
|
||||
|
||||
VkSemaphoreCreateInfo semaphore_create_info;
|
||||
semaphore_create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
|
||||
semaphore_create_info.pNext = 0;
|
||||
semaphore_create_info.flags = flags;
|
||||
|
||||
this->device = device;
|
||||
if (vkCreateSemaphore(device, &semaphore_create_info, 0, &data) == VK_SUCCESS)
|
||||
return true;
|
||||
|
||||
this->device = 0;
|
||||
data = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Semaphore::Destroy() {
|
||||
if (data) {
|
||||
vkDestroySemaphore(device, data, 0);
|
||||
data = 0;
|
||||
}
|
||||
device = 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user