add: additional debug info

This commit is contained in:
Samuliak 2024-08-25 10:15:10 +02:00
parent c905399f1f
commit 96d6168c50
2 changed files with 18 additions and 5 deletions

View File

@ -20,6 +20,7 @@
#include "HW/Latte/Renderer/Metal/MetalCommon.h"
#include "HW/Latte/Renderer/Metal/MetalLayerHandle.h"
#include "HW/Latte/Renderer/Renderer.h"
#include "Metal/MTLDevice.hpp"
#include "Metal/MTLRenderPass.hpp"
#include "imgui.h"
@ -39,8 +40,9 @@ MetalRenderer::MetalRenderer()
m_commandQueue = m_device->newCommandQueue();
// Feature support
m_hasUnifiedMemory = m_device->hasUnifiedMemory();
m_isAppleGPU = m_device->supportsFamily(MTL::GPUFamilyApple1);
m_hasUnifiedMemory = m_device->hasUnifiedMemory();
m_supportsMetal3 = m_device->supportsFamily(MTL::GPUFamilyMetal3);
m_recommendedMaxVRAMUsage = m_device->recommendedMaxWorkingSetSize();
m_pixelFormatSupport = MetalPixelFormatSupport(m_device);
@ -413,13 +415,18 @@ void MetalRenderer::DeleteFontTextures()
void MetalRenderer::AppendOverlayDebugInfo()
{
ImGui::Text("--- GPU info ---");
ImGui::Text("Is Apple GPU %s", (m_isAppleGPU ? "yes" : "no"));
ImGui::Text("Has unified memory %s", (m_hasUnifiedMemory ? "yes" : "no"));
ImGui::Text("Supports Metal3 %s", (m_supportsMetal3 ? "yes" : "no"));
ImGui::Text("--- Metal info ---");
ImGui::Text("Render pipeline states %zu", m_pipelineCache->GetPipelineCacheSize());
ImGui::Text("Buffer allocator memory %zuMB", m_performanceMonitor.m_bufferAllocatorMemory / 1024 / 1024);
ImGui::Text("--- Metal info (per frame) ---");
ImGui::Text("Command buffers %zu", m_commandBuffers.size());
ImGui::Text("Render passes %u", m_performanceMonitor.m_renderPasses);
ImGui::Text("Render passes %u", m_performanceMonitor.m_renderPasses);
}
// TODO: halfZ

View File

@ -376,14 +376,19 @@ public:
void ClearColorTextureInternal(MTL::Texture* mtlTexture, sint32 sliceIndex, sint32 mipIndex, float r, float g, float b, float a);
// Getters
bool IsAppleGPU() const
{
return m_isAppleGPU;
}
bool HasUnifiedMemory() const
{
return m_hasUnifiedMemory;
}
bool IsAppleGPU() const
bool SupportsMetal3() const
{
return m_isAppleGPU;
return m_supportsMetal3;
}
const MetalPixelFormatSupport& GetPixelFormatSupport() const
@ -417,8 +422,9 @@ private:
MTL::CommandQueue* m_commandQueue;
// Feature support
bool m_hasUnifiedMemory;
bool m_isAppleGPU;
bool m_hasUnifiedMemory;
bool m_supportsMetal3;
uint32 m_recommendedMaxVRAMUsage;
MetalPixelFormatSupport m_pixelFormatSupport;