Create present complete semaphore in example base class (#60)
This commit is contained in:
parent
4ff8fbf71c
commit
71cdb93234
2 changed files with 9 additions and 0 deletions
|
|
@ -485,6 +485,8 @@ VulkanExampleBase::~VulkanExampleBase()
|
||||||
|
|
||||||
vkDestroyCommandPool(device, cmdPool, nullptr);
|
vkDestroyCommandPool(device, cmdPool, nullptr);
|
||||||
|
|
||||||
|
vkDestroySemaphore(device, presentCompleteSemaphore, nullptr);
|
||||||
|
|
||||||
vkDestroyDevice(device, nullptr);
|
vkDestroyDevice(device, nullptr);
|
||||||
|
|
||||||
if (enableValidation)
|
if (enableValidation)
|
||||||
|
|
@ -570,6 +572,11 @@ void VulkanExampleBase::initVulkan(bool enableValidation)
|
||||||
assert(validDepthFormat);
|
assert(validDepthFormat);
|
||||||
|
|
||||||
swapChain.connect(instance, physicalDevice, device);
|
swapChain.connect(instance, physicalDevice, device);
|
||||||
|
|
||||||
|
// Create a semaphore used to synchronize image presentation
|
||||||
|
VkSemaphoreCreateInfo presentCompleteSemaphoreCreateInfo = vkTools::initializers::semaphoreCreateInfo();
|
||||||
|
err = vkCreateSemaphore(device, &presentCompleteSemaphoreCreateInfo, nullptr, &presentCompleteSemaphore);
|
||||||
|
assert(!err);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,8 @@ protected:
|
||||||
VkPipelineCache pipelineCache;
|
VkPipelineCache pipelineCache;
|
||||||
// Wraps the swap chain to present images (framebuffers) to the windowing system
|
// Wraps the swap chain to present images (framebuffers) to the windowing system
|
||||||
VulkanSwapChain swapChain;
|
VulkanSwapChain swapChain;
|
||||||
|
// Semaphore to synchronize image presentation
|
||||||
|
VkSemaphore presentCompleteSemaphore;
|
||||||
// Simple texture loader
|
// Simple texture loader
|
||||||
vkTools::VulkanTextureLoader *textureLoader = nullptr;
|
vkTools::VulkanTextureLoader *textureLoader = nullptr;
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue