mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-10 06:56:49 +00:00
[vk, qcom] Adjusting Sampler Budget reserved value
This commit is contained in:
committed by
Caio Oliveira
parent
c14175e481
commit
d763cafca6
@@ -586,13 +586,14 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
|||||||
const size_t sampler_limit = properties.properties.limits.maxSamplerAllocationCount;
|
const size_t sampler_limit = properties.properties.limits.maxSamplerAllocationCount;
|
||||||
if (sampler_limit > 0) {
|
if (sampler_limit > 0) {
|
||||||
constexpr size_t MIN_SAMPLER_BUDGET = 1024U;
|
constexpr size_t MIN_SAMPLER_BUDGET = 1024U;
|
||||||
|
const size_t reserved = sampler_limit / 4U;
|
||||||
const size_t derived_budget =
|
const size_t derived_budget =
|
||||||
(std::max)(MIN_SAMPLER_BUDGET, sampler_limit / 4U);
|
(std::max)(MIN_SAMPLER_BUDGET, sampler_limit - reserved);
|
||||||
sampler_heap_budget = derived_budget;
|
sampler_heap_budget = derived_budget;
|
||||||
LOG_WARNING(Render_Vulkan,
|
LOG_WARNING(Render_Vulkan,
|
||||||
"Qualcomm driver reports max {} samplers; clamping cache to {} (25%) to "
|
"Qualcomm driver reports max {} samplers; reserving {} (25%) and "
|
||||||
"avoid heap exhaustion",
|
"allowing Eden to use {} (75%) to avoid heap exhaustion",
|
||||||
sampler_limit, sampler_heap_budget);
|
sampler_limit, reserved, sampler_heap_budget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user