mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 10:51:50 -05:00
vulkan_common: promote host query reset usage to core
This commit is contained in:
parent
e44a804ec7
commit
7fc6514be1
4 changed files with 12 additions and 11 deletions
|
@ -98,7 +98,7 @@ HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> depend
|
||||||
query{cache_.AllocateQuery(type_)}, tick{cache_.GetScheduler().CurrentTick()} {
|
query{cache_.AllocateQuery(type_)}, tick{cache_.GetScheduler().CurrentTick()} {
|
||||||
const vk::Device* logical = &cache.GetDevice().GetLogical();
|
const vk::Device* logical = &cache.GetDevice().GetLogical();
|
||||||
cache.GetScheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) {
|
cache.GetScheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) {
|
||||||
logical->ResetQueryPoolEXT(query.first, query.second, 1);
|
logical->ResetQueryPool(query.first, query.second, 1);
|
||||||
cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT);
|
cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,10 +77,6 @@ enum class NvidiaArchitecture {
|
||||||
constexpr std::array REQUIRED_EXTENSIONS{
|
constexpr std::array REQUIRED_EXTENSIONS{
|
||||||
VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME,
|
VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME,
|
||||||
VK_EXT_ROBUSTNESS_2_EXTENSION_NAME,
|
VK_EXT_ROBUSTNESS_2_EXTENSION_NAME,
|
||||||
|
|
||||||
// Core in 1.2, but required due to use of extension methods,
|
|
||||||
// and well-supported by drivers
|
|
||||||
VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME,
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME,
|
VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME,
|
||||||
#endif
|
#endif
|
||||||
|
@ -438,8 +434,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||||
};
|
};
|
||||||
SetNext(next, robustness2);
|
SetNext(next, robustness2);
|
||||||
|
|
||||||
VkPhysicalDeviceHostQueryResetFeaturesEXT host_query_reset{
|
VkPhysicalDeviceHostQueryResetFeatures host_query_reset{
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT,
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES,
|
||||||
.pNext = nullptr,
|
.pNext = nullptr,
|
||||||
.hostQueryReset = true,
|
.hostQueryReset = true,
|
||||||
};
|
};
|
||||||
|
|
|
@ -184,7 +184,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept {
|
||||||
X(vkMapMemory);
|
X(vkMapMemory);
|
||||||
X(vkQueueSubmit);
|
X(vkQueueSubmit);
|
||||||
X(vkResetFences);
|
X(vkResetFences);
|
||||||
X(vkResetQueryPoolEXT);
|
X(vkResetQueryPool);
|
||||||
X(vkSetDebugUtilsObjectNameEXT);
|
X(vkSetDebugUtilsObjectNameEXT);
|
||||||
X(vkSetDebugUtilsObjectTagEXT);
|
X(vkSetDebugUtilsObjectTagEXT);
|
||||||
X(vkUnmapMemory);
|
X(vkUnmapMemory);
|
||||||
|
@ -199,6 +199,11 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept {
|
||||||
Proc(dld.vkWaitForFences, dld, "vkWaitForFencesKHR", device);
|
Proc(dld.vkWaitForFences, dld, "vkWaitForFencesKHR", device);
|
||||||
Proc(dld.vkWaitSemaphores, dld, "vkWaitSemaphoresKHR", device);
|
Proc(dld.vkWaitSemaphores, dld, "vkWaitSemaphoresKHR", device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support for host query reset is mandatory in Vulkan 1.2
|
||||||
|
if (!dld.vkResetQueryPool) {
|
||||||
|
Proc(dld.vkResetQueryPool, dld, "vkResetQueryPoolEXT", device);
|
||||||
|
}
|
||||||
#undef X
|
#undef X
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ struct DeviceDispatch : InstanceDispatch {
|
||||||
PFN_vkMapMemory vkMapMemory{};
|
PFN_vkMapMemory vkMapMemory{};
|
||||||
PFN_vkQueueSubmit vkQueueSubmit{};
|
PFN_vkQueueSubmit vkQueueSubmit{};
|
||||||
PFN_vkResetFences vkResetFences{};
|
PFN_vkResetFences vkResetFences{};
|
||||||
PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT{};
|
PFN_vkResetQueryPool vkResetQueryPool{};
|
||||||
PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT{};
|
PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT{};
|
||||||
PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT{};
|
PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT{};
|
||||||
PFN_vkUnmapMemory vkUnmapMemory{};
|
PFN_vkUnmapMemory vkUnmapMemory{};
|
||||||
|
@ -884,8 +884,8 @@ public:
|
||||||
return dld->vkDeviceWaitIdle(handle);
|
return dld->vkDeviceWaitIdle(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetQueryPoolEXT(VkQueryPool query_pool, u32 first, u32 count) const noexcept {
|
void ResetQueryPool(VkQueryPool query_pool, u32 first, u32 count) const noexcept {
|
||||||
dld->vkResetQueryPoolEXT(handle, query_pool, first, count);
|
dld->vkResetQueryPool(handle, query_pool, first, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult GetQueryResults(VkQueryPool query_pool, u32 first, u32 count, std::size_t data_size,
|
VkResult GetQueryResults(VkQueryPool query_pool, u32 first, u32 count, std::size_t data_size,
|
||||||
|
|
Loading…
Reference in a new issue