aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/vulkan_common/vulkan_device.cpp
diff options
context:
space:
mode:
authorMai M <mathew1800@gmail.com>2021-06-23 08:03:01 -0400
committerGitHub <noreply@github.com>2021-06-23 08:03:01 -0400
commit17fff10e06e7935522a5a69705b9a750761aab79 (patch)
tree7e7b3ae9fedbc0fed85f6c5c58e92e8d047efd87 /src/video_core/vulkan_common/vulkan_device.cpp
parent20f474b09ab503607fab651342bcee433d117c80 (diff)
parentf9b940a442d50875d2b45a0f2f380ccad88670da (diff)
Merge pull request #6465 from FernandoS27/sex-on-the-beach
GPU: Implement a garbage collector for GPU Caches (project Reaper+)
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.cpp')
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 64206b3d2..707a8b8fb 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -408,6 +408,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
}
logical = vk::Device::Create(physical, queue_cis, extensions, first_next, dld);
+ CollectPhysicalMemoryInfo();
CollectTelemetryParameters();
CollectToolingInfo();
@@ -818,6 +819,17 @@ void Device::CollectTelemetryParameters() {
}
}
+void Device::CollectPhysicalMemoryInfo() {
+ const auto mem_properties = physical.GetMemoryProperties();
+ const std::size_t num_properties = mem_properties.memoryHeapCount;
+ device_access_memory = 0;
+ for (std::size_t element = 0; element < num_properties; element++) {
+ if ((mem_properties.memoryHeaps[element].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) != 0) {
+ device_access_memory += mem_properties.memoryHeaps[element].size;
+ }
+ }
+}
+
void Device::CollectToolingInfo() {
if (!ext_tooling_info) {
return;