mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-05 03:59:59 +00:00
renderer_vulkan/wrapper: Add queue handle
This commit is contained in:
parent
151ddcf419
commit
d85ca0ab33
2 changed files with 36 additions and 0 deletions
|
@ -409,4 +409,15 @@ DebugCallback Instance::TryCreateDebugCallback(
|
||||||
return DebugCallback(messenger, handle, *dld);
|
return DebugCallback(messenger, handle, *dld);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<VkCheckpointDataNV> Queue::GetCheckpointDataNV(const DeviceDispatch& dld) const {
|
||||||
|
if (!dld.vkGetQueueCheckpointDataNV) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
u32 num;
|
||||||
|
dld.vkGetQueueCheckpointDataNV(queue, &num, nullptr);
|
||||||
|
std::vector<VkCheckpointDataNV> checkpoints(num);
|
||||||
|
dld.vkGetQueueCheckpointDataNV(queue, &num, checkpoints.data());
|
||||||
|
return checkpoints;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Vulkan::vk
|
} // namespace Vulkan::vk
|
||||||
|
|
|
@ -559,4 +559,29 @@ public:
|
||||||
DebugCallback TryCreateDebugCallback(PFN_vkDebugUtilsMessengerCallbackEXT callback) noexcept;
|
DebugCallback TryCreateDebugCallback(PFN_vkDebugUtilsMessengerCallbackEXT callback) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Queue {
|
||||||
|
public:
|
||||||
|
/// Construct an empty queue handle.
|
||||||
|
constexpr Queue() noexcept = default;
|
||||||
|
|
||||||
|
/// Construct a queue handle.
|
||||||
|
constexpr Queue(VkQueue queue, const DeviceDispatch& dld) noexcept : queue{queue}, dld{&dld} {}
|
||||||
|
|
||||||
|
/// Returns the checkpoint data.
|
||||||
|
/// @note Returns an empty vector when the function pointer is not present.
|
||||||
|
std::vector<VkCheckpointDataNV> GetCheckpointDataNV(const DeviceDispatch& dld) const;
|
||||||
|
|
||||||
|
void Submit(Span<VkSubmitInfo> submit_infos, VkFence fence) const {
|
||||||
|
Check(dld->vkQueueSubmit(queue, submit_infos.size(), submit_infos.data(), fence));
|
||||||
|
}
|
||||||
|
|
||||||
|
VkResult Present(const VkPresentInfoKHR& present_info) const noexcept {
|
||||||
|
return dld->vkQueuePresentKHR(queue, &present_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
VkQueue queue = nullptr;
|
||||||
|
const DeviceDispatch* dld = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Vulkan::vk
|
} // namespace Vulkan::vk
|
||||||
|
|
Loading…
Reference in a new issue