vk_swapchain: Prefer scheduler finish
* The scheduler might have recorded a present that uses the to-be-destroyed semaphores. vkWaitIdle might miss this
This commit is contained in:
@ -149,16 +149,11 @@ bool PipelineCache::GraphicsPipeline::Build(bool fail_on_compile_required) {
|
||||
}
|
||||
|
||||
// Check if all shader modules are ready
|
||||
bool shaders_ready = true;
|
||||
for (Shader* shader : stages) {
|
||||
if (shader) {
|
||||
shaders_ready &= shader->IsBuilt();
|
||||
for (auto& shader : stages) {
|
||||
if (shader && !shader->IsBuilt()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shaders_ready) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
MICROPROFILE_SCOPE(Vulkan_Pipeline);
|
||||
|
@ -43,8 +43,7 @@ Swapchain::~Swapchain() {
|
||||
}
|
||||
|
||||
void Swapchain::Create(vk::SurfaceKHR new_surface) {
|
||||
vk::Device device = instance.GetDevice();
|
||||
device.waitIdle();
|
||||
scheduler.Finish();
|
||||
Destroy();
|
||||
|
||||
if (new_surface) {
|
||||
@ -82,7 +81,7 @@ void Swapchain::Create(vk::SurfaceKHR new_surface) {
|
||||
};
|
||||
|
||||
try {
|
||||
swapchain = device.createSwapchainKHR(swapchain_info);
|
||||
swapchain = instance.GetDevice().createSwapchainKHR(swapchain_info);
|
||||
} catch (vk::SystemError& err) {
|
||||
LOG_CRITICAL(Render_Vulkan, "{}", err.what());
|
||||
UNREACHABLE();
|
||||
|
Reference in New Issue
Block a user