[Vulkan] Remove backend swap event (unused and confusing)
This commit is contained in:
parent
b2f1bf914a
commit
b3626a039b
|
@ -122,27 +122,12 @@ bool VulkanCommandProcessor::SetupContext() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkEventCreateInfo info = {
|
|
||||||
VK_STRUCTURE_TYPE_EVENT_CREATE_INFO,
|
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
};
|
|
||||||
|
|
||||||
status = vkCreateEvent(*device_, &info, nullptr,
|
|
||||||
reinterpret_cast<VkEvent*>(&swap_state_.backend_data));
|
|
||||||
if (status != VK_SUCCESS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanCommandProcessor::ShutdownContext() {
|
void VulkanCommandProcessor::ShutdownContext() {
|
||||||
// TODO(benvanik): wait until idle.
|
// TODO(benvanik): wait until idle.
|
||||||
|
|
||||||
vkDestroyEvent(*device_, reinterpret_cast<VkEvent>(swap_state_.backend_data),
|
|
||||||
nullptr);
|
|
||||||
|
|
||||||
if (swap_state_.front_buffer_texture) {
|
if (swap_state_.front_buffer_texture) {
|
||||||
// Free swap chain image.
|
// Free swap chain image.
|
||||||
DestroySwapImage();
|
DestroySwapImage();
|
||||||
|
@ -504,10 +489,6 @@ void VulkanCommandProcessor::PerformSwap(uint32_t frontbuffer_ptr,
|
||||||
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
||||||
swap_state_.width = frontbuffer_width;
|
swap_state_.width = frontbuffer_width;
|
||||||
swap_state_.height = frontbuffer_height;
|
swap_state_.height = frontbuffer_height;
|
||||||
|
|
||||||
auto swap_event = reinterpret_cast<VkEvent>(swap_state_.backend_data);
|
|
||||||
vkCmdSetEvent(copy_commands, swap_event,
|
|
||||||
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status = vkEndCommandBuffer(copy_commands);
|
status = vkEndCommandBuffer(copy_commands);
|
||||||
|
|
|
@ -278,19 +278,6 @@ void VulkanGraphicsSystem::Swap(xe::ui::UIEvent* e) {
|
||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto event = reinterpret_cast<VkEvent>(swap_state.backend_data);
|
|
||||||
if (event == nullptr) {
|
|
||||||
// The command processor is currently uninitialized.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
VkResult status = vkGetEventStatus(*device_, event);
|
|
||||||
if (status != VK_EVENT_SET) {
|
|
||||||
// The device has not finished processing the image.
|
|
||||||
// return;
|
|
||||||
}
|
|
||||||
|
|
||||||
vkResetEvent(*device_, event);
|
|
||||||
swap_state.pending = false;
|
swap_state.pending = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,11 +291,6 @@ void VulkanGraphicsSystem::Swap(xe::ui::UIEvent* e) {
|
||||||
auto front_buffer =
|
auto front_buffer =
|
||||||
reinterpret_cast<VkImage>(swap_state.front_buffer_texture);
|
reinterpret_cast<VkImage>(swap_state.front_buffer_texture);
|
||||||
|
|
||||||
// Wait on and signal the swap semaphore.
|
|
||||||
// TODO(DrChat): Interacting with the window causes the device to be lost in
|
|
||||||
// some games.
|
|
||||||
// swap_chain->WaitAndSignalSemaphore(semaphore);
|
|
||||||
|
|
||||||
VkImageMemoryBarrier barrier;
|
VkImageMemoryBarrier barrier;
|
||||||
std::memset(&barrier, 0, sizeof(VkImageMemoryBarrier));
|
std::memset(&barrier, 0, sizeof(VkImageMemoryBarrier));
|
||||||
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
||||||
|
|
Loading…
Reference in New Issue