mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-19 09:57:02 +02:00
[vk] Adjusted Query Cache
This commit is contained in:
parent
7e79effa03
commit
061fe400d8
2 changed files with 12 additions and 3 deletions
|
|
@ -42,7 +42,8 @@ public:
|
||||||
static constexpr size_t BANK_SIZE = 256;
|
static constexpr size_t BANK_SIZE = 256;
|
||||||
static constexpr size_t QUERY_SIZE = 8;
|
static constexpr size_t QUERY_SIZE = 8;
|
||||||
explicit SamplesQueryBank(const Device& device_, size_t index_)
|
explicit SamplesQueryBank(const Device& device_, size_t index_)
|
||||||
: BankBase(BANK_SIZE), device{device_}, index{index_} {
|
: BankBase(BANK_SIZE), device{device_}, index{index_},
|
||||||
|
supports_host_query_reset{device_.SupportsHostQueryReset()} {
|
||||||
const auto& dev = device.GetLogical();
|
const auto& dev = device.GetLogical();
|
||||||
query_pool = dev.CreateQueryPool({
|
query_pool = dev.CreateQueryPool({
|
||||||
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
|
||||||
|
|
@ -60,8 +61,10 @@ public:
|
||||||
void Reset() override {
|
void Reset() override {
|
||||||
ASSERT(references == 0);
|
ASSERT(references == 0);
|
||||||
VideoCommon::BankBase::Reset();
|
VideoCommon::BankBase::Reset();
|
||||||
const auto& dev = device.GetLogical();
|
if (supports_host_query_reset) {
|
||||||
dev.ResetQueryPool(*query_pool, 0, BANK_SIZE);
|
const auto& dev = device.GetLogical();
|
||||||
|
dev.ResetQueryPool(*query_pool, 0, BANK_SIZE);
|
||||||
|
}
|
||||||
host_results.fill(0ULL);
|
host_results.fill(0ULL);
|
||||||
next_bank = 0;
|
next_bank = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -99,6 +102,7 @@ public:
|
||||||
private:
|
private:
|
||||||
const Device& device;
|
const Device& device;
|
||||||
const size_t index;
|
const size_t index;
|
||||||
|
const bool supports_host_query_reset;
|
||||||
vk::QueryPool query_pool;
|
vk::QueryPool query_pool;
|
||||||
std::array<u64, BANK_SIZE> host_results;
|
std::array<u64, BANK_SIZE> host_results;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -366,6 +366,11 @@ public:
|
||||||
return GetDriverID() != VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
|
return GetDriverID() != VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if vkResetQueryPool can be used from the host.
|
||||||
|
bool SupportsHostQueryReset() const {
|
||||||
|
return features.host_query_reset.hostQueryReset;
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns true when the driver should use the mobile mega buffer allocator.
|
/// Returns true when the driver should use the mobile mega buffer allocator.
|
||||||
bool ShouldUseMobileMegaBuffer() const {
|
bool ShouldUseMobileMegaBuffer() const {
|
||||||
return use_mobile_megabuffer;
|
return use_mobile_megabuffer;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue