mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-27 15:49:04 +02:00
[vk, qcom] Samplers Budget Management
This commit is contained in:
parent
bc51d68447
commit
b98a150e4c
2 changed files with 5 additions and 5 deletions
|
|
@ -2039,6 +2039,7 @@ SamplerId TextureCache<P>::FindSampler(const TSCEntry& config) {
|
|||
}
|
||||
const auto [pair, is_new] = channel_state->samplers.try_emplace(config);
|
||||
if (is_new) {
|
||||
EnforceSamplerBudget();
|
||||
pair->second = slot_samplers.insert(runtime, config);
|
||||
EnforceSamplerBudget();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -595,14 +595,13 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
|||
const size_t sampler_limit = properties.properties.limits.maxSamplerAllocationCount;
|
||||
if (sampler_limit > 0) {
|
||||
constexpr size_t MIN_SAMPLER_BUDGET = 1024U;
|
||||
const size_t reserved = sampler_limit / 4U;
|
||||
const size_t derived_budget =
|
||||
(std::max)(MIN_SAMPLER_BUDGET, sampler_limit - reserved);
|
||||
(std::max)(MIN_SAMPLER_BUDGET, sampler_limit / 4U);
|
||||
sampler_heap_budget = derived_budget;
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Qualcomm driver reports max {} samplers; reserving {} (25%) and "
|
||||
"allowing Eden to use {} (75%) to avoid heap exhaustion",
|
||||
sampler_limit, reserved, sampler_heap_budget);
|
||||
"Qualcomm driver reports max {} samplers; clamping cache to {} (25%) to "
|
||||
"avoid heap exhaustion",
|
||||
sampler_limit, sampler_heap_budget);
|
||||
}
|
||||
const u32 version = (properties.properties.driverVersion << 3) >> 3;
|
||||
if (version < VK_MAKE_API_VERSION(0, 255, 615, 512) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue