Enable more extensions desired by vk_mem_alloc and add vk_membudget cvar
This commit is contained in:
parent
30cc548d92
commit
a9a5ee8a96
3 changed files with 60 additions and 0 deletions
|
|
@ -76,6 +76,8 @@ EXTERN_CVAR(Bool, r_skipmats)
|
|||
// Physical device info
|
||||
static std::vector<VulkanCompatibleDevice> SupportedDevices;
|
||||
int vkversion;
|
||||
static TArray<FString> memheapnames;
|
||||
static TArray<VmaBudget> membudgets;
|
||||
|
||||
CUSTOM_CVAR(Bool, vk_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
{
|
||||
|
|
@ -102,6 +104,27 @@ CCMD(vk_listdevices)
|
|||
}
|
||||
}
|
||||
|
||||
CCMD(vk_membudget)
|
||||
{
|
||||
for (size_t i = 0; i < membudgets.size(); i++)
|
||||
{
|
||||
if (membudgets[i].budget != 0)
|
||||
{
|
||||
Printf("#%d %s - %d MB used out of %d MB estimated budget (%d%%)\n",
|
||||
i, memheapnames[i].GetChars(),
|
||||
(int)(membudgets[i].usage / (1024 * 1024)),
|
||||
(int)(membudgets[i].budget / (1024 * 1024)),
|
||||
(int)(membudgets[i].usage * 100 / membudgets[i].budget));
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf("#%d %s - %d MB used\n",
|
||||
i, memheapnames[i].GetChars(),
|
||||
(int)(membudgets[i].usage / (1024 * 1024)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void I_BuildVKDeviceList(FOptionValues* opt)
|
||||
{
|
||||
for (size_t i = 0; i < SupportedDevices.size(); i++)
|
||||
|
|
@ -478,6 +501,19 @@ TArray<uint8_t> VulkanRenderDevice::GetScreenshotBuffer(int &pitch, ESSType &col
|
|||
|
||||
void VulkanRenderDevice::BeginFrame()
|
||||
{
|
||||
vmaSetCurrentFrameIndex(mDevice->allocator, 0);
|
||||
membudgets.Resize(mDevice->PhysicalDevice.Properties.Memory.memoryHeapCount);
|
||||
vmaGetHeapBudgets(mDevice->allocator, membudgets.data());
|
||||
if (memheapnames.size() == 0)
|
||||
{
|
||||
memheapnames.Resize(mDevice->PhysicalDevice.Properties.Memory.memoryHeapCount);
|
||||
for (unsigned int i = 0; i < memheapnames.Size(); i++)
|
||||
{
|
||||
bool deviceLocal = !!(mDevice->PhysicalDevice.Properties.Memory.memoryHeaps[i].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT);
|
||||
memheapnames[i] = deviceLocal ? "device local" : "system";
|
||||
}
|
||||
}
|
||||
|
||||
if (levelMeshChanged)
|
||||
{
|
||||
levelMeshChanged = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue