diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp index ee15a5a56..eb85f1ea1 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp @@ -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 diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h index d1f0eaeb8..7a9b41e48 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h @@ -376,14 +376,19 @@ class MetalRenderer : public Renderer 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 @@ class MetalRenderer : public Renderer MTL::CommandQueue* m_commandQueue; // Feature support - bool m_hasUnifiedMemory; bool m_isAppleGPU; + bool m_hasUnifiedMemory; + bool m_supportsMetal3; uint32 m_recommendedMaxVRAMUsage; MetalPixelFormatSupport m_pixelFormatSupport;