Add hwtexture count to vk_mem_budget

This commit is contained in:
Magnus Norddahl 2024-02-19 10:00:46 +01:00
commit 08d376d3f4
2 changed files with 7 additions and 2 deletions

View file

@ -37,6 +37,8 @@ public:
VulkanImage* GetNullTexture() { return NullTexture.get(); }
VulkanImageView* GetNullTextureView() { return NullTextureView.get(); }
int GetHWTextureCount() { return (int)Textures.size(); }
VkTextureImage Shadowmap;
VkTextureImage Lightmap;
int LMTextureSize = 0;

View file

@ -78,6 +78,7 @@ static std::vector<VulkanCompatibleDevice> SupportedDevices;
int vkversion;
static TArray<FString> memheapnames;
static TArray<VmaBudget> membudgets;
static int hwtexturecount;
CUSTOM_CVAR(Bool, vk_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
@ -110,7 +111,7 @@ CCMD(vk_membudget)
{
if (membudgets[i].budget != 0)
{
Printf("#%d %s - %d MB used out of %d MB estimated budget (%d%%)\n",
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)),
@ -123,6 +124,7 @@ CCMD(vk_membudget)
(int)(membudgets[i].usage / (1024 * 1024)));
}
}
Printf("%d total hardware textures\n", hwtexturecount);
}
void I_BuildVKDeviceList(FOptionValues* opt)
@ -510,9 +512,10 @@ void VulkanRenderDevice::BeginFrame()
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";
memheapnames[i] = deviceLocal ? " (device local)" : "";
}
}
hwtexturecount = mTextureManager->GetHWTextureCount();
if (levelMeshChanged)
{