mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
- VKHelpers was the rug everything was swept under for a long time. This commit essentially deprecates its usage across most of the backend.
39 lines
751 B
C++
39 lines
751 B
C++
#pragma once
|
|
|
|
#include "../VulkanAPI.h"
|
|
#include "../../rsx_utils.h"
|
|
|
|
namespace vk
|
|
{
|
|
class query_pool : public rsx::ref_counted
|
|
{
|
|
VkQueryPool m_query_pool;
|
|
VkDevice m_device;
|
|
|
|
public:
|
|
query_pool(VkDevice dev, VkQueryType type, u32 size)
|
|
: m_query_pool(VK_NULL_HANDLE)
|
|
, m_device(dev)
|
|
{
|
|
VkQueryPoolCreateInfo info{};
|
|
info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
|
|
info.queryType = type;
|
|
info.queryCount = size;
|
|
vkCreateQueryPool(dev, &info, nullptr, &m_query_pool);
|
|
|
|
// Take 'size' references on this object
|
|
ref_count.release(static_cast<s32>(size));
|
|
}
|
|
|
|
~query_pool()
|
|
{
|
|
vkDestroyQueryPool(m_device, m_query_pool, nullptr);
|
|
}
|
|
|
|
operator VkQueryPool()
|
|
{
|
|
return m_query_pool;
|
|
}
|
|
};
|
|
}
|