From 5d01c77efc5d464377dfb99ea90ac96057882f81 Mon Sep 17 00:00:00 2001 From: Samuliak Date: Mon, 30 Sep 2024 19:43:53 +0200 Subject: [PATCH] rename hybrid pipeline to void vertex pipeline --- src/Cafe/CMakeLists.txt | 4 ++-- .../Metal/MetalHybridComputePipeline.h | 20 ------------------- .../Renderer/Metal/MetalMemoryManager.cpp | 2 +- .../Latte/Renderer/Metal/MetalMemoryManager.h | 6 +++--- .../HW/Latte/Renderer/Metal/MetalRenderer.cpp | 8 ++++---- .../HW/Latte/Renderer/Metal/MetalRenderer.h | 6 +++--- ...peline.cpp => MetalVoidVertexPipeline.cpp} | 9 +++------ .../Renderer/Metal/MetalVoidVertexPipeline.h | 16 +++++++++++++++ 8 files changed, 32 insertions(+), 39 deletions(-) delete mode 100644 src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h rename src/Cafe/HW/Latte/Renderer/Metal/{MetalHybridComputePipeline.cpp => MetalVoidVertexPipeline.cpp} (67%) create mode 100644 src/Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h diff --git a/src/Cafe/CMakeLists.txt b/src/Cafe/CMakeLists.txt index c7360458..9b5f8d3e 100644 --- a/src/Cafe/CMakeLists.txt +++ b/src/Cafe/CMakeLists.txt @@ -566,8 +566,8 @@ if(ENABLE_METAL) HW/Latte/Renderer/Metal/MetalDepthStencilCache.h HW/Latte/Renderer/Metal/MetalSamplerCache.cpp HW/Latte/Renderer/Metal/MetalSamplerCache.h - HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp - HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h + HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.cpp + HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h HW/Latte/Renderer/Metal/MetalQuery.cpp HW/Latte/Renderer/Metal/MetalQuery.h HW/Latte/Renderer/Metal/MetalPerformanceMonitor.h diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h b/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h deleted file mode 100644 index 5aeee65f..00000000 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "Cafe/HW/Latte/Renderer/Metal/MetalCommon.h" -#include "HW/Latte/Renderer/Metal/MetalRenderer.h" -#include "Metal/MTLLibrary.hpp" -#include "Metal/MTLRenderPipeline.hpp" - -// TODO: rename to MetalVoidVertexPipeline -class MetalHybridComputePipeline -{ -public: - MetalHybridComputePipeline(class MetalRenderer* mtlRenderer, MTL::Library* library, const std::string& vertexFunctionName/*, const std::string& kernelFunctionName*/); - ~MetalHybridComputePipeline(); - - MTL::RenderPipelineState* GetRenderPipelineState() const { return m_renderPipelineState; } - - //MTL::RenderPipelineState* GetComputePipelineState() const { return m_computePipelineState; } - -private: - MTL::RenderPipelineState* m_renderPipelineState; - //MTL::RenderPipelineState* m_computePipelineState; -}; diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.cpp index d324d652..9765b24a 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.cpp @@ -1,6 +1,6 @@ #include "Cafe/HW/Latte/Renderer/Metal/MetalCommon.h" #include "Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.h" -#include "Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h" +#include "Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h" #include "Common/precompiled.h" #include "HW/Latte/Renderer/Metal/MetalRenderer.h" #include "Metal/MTLResource.hpp" diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.h b/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.h index ee065249..a79111fd 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.h +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.h @@ -24,7 +24,7 @@ public: MetalVertexBufferCache(class MetalRenderer* metalRenderer, MetalDefaultBufferAllocator& bufferAllocator) : m_mtlr{metalRenderer}, m_bufferAllocator{bufferAllocator} {} ~MetalVertexBufferCache(); - void SetRestrideBufferPipeline(class MetalHybridComputePipeline* restrideBufferPipeline) + void SetRestrideBufferPipeline(class MetalVoidVertexPipeline* restrideBufferPipeline) { m_restrideBufferPipeline = restrideBufferPipeline; } @@ -48,7 +48,7 @@ private: class MetalRenderer* m_mtlr; MetalDefaultBufferAllocator& m_bufferAllocator; - class MetalHybridComputePipeline* m_restrideBufferPipeline = nullptr; + class MetalVoidVertexPipeline* m_restrideBufferPipeline = nullptr; MetalVertexBufferRange m_bufferRanges[LATTE_MAX_VERTEX_BUFFERS] = {}; @@ -62,7 +62,7 @@ public: ~MetalMemoryManager(); // Pipelines - void SetRestrideBufferPipeline(class MetalHybridComputePipeline* restrideBufferPipeline) + void SetRestrideBufferPipeline(class MetalVoidVertexPipeline* restrideBufferPipeline) { m_vertexBufferCache.SetRestrideBufferPipeline(restrideBufferPipeline); } diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp index cfe45fb8..0587b268 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp @@ -9,7 +9,7 @@ #include "Cafe/HW/Latte/Renderer/Metal/MetalDepthStencilCache.h" #include "Cafe/HW/Latte/Renderer/Metal/MetalSamplerCache.h" #include "Cafe/HW/Latte/Renderer/Metal/LatteTextureReadbackMtl.h" -#include "Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h" +#include "Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h" #include "Cafe/HW/Latte/Renderer/Metal/MetalQuery.h" #include "Cafe/HW/Latte/Renderer/Metal/LatteToMtl.h" #include "Cafe/HW/Latte/Renderer/Metal/UtilityShaderSource.h" @@ -159,9 +159,9 @@ MetalRenderer::MetalRenderer() // Hybrid pipelines if (m_isAppleGPU) - m_copyBufferToBufferPipeline = new MetalHybridComputePipeline(this, utilityLibrary, "vertexCopyBufferToBuffer"); - //m_copyTextureToTexturePipeline = new MetalHybridComputePipeline(this, utilityLibrary, "vertexCopyTextureToTexture"); - m_restrideBufferPipeline = new MetalHybridComputePipeline(this, utilityLibrary, "vertexRestrideBuffer"); + m_copyBufferToBufferPipeline = new MetalVoidVertexPipeline(this, utilityLibrary, "vertexCopyBufferToBuffer"); + //m_copyTextureToTexturePipeline = new MetalVoidVertexPipeline(this, utilityLibrary, "vertexCopyTextureToTexture"); + m_restrideBufferPipeline = new MetalVoidVertexPipeline(this, utilityLibrary, "vertexRestrideBuffer"); utilityLibrary->release(); m_memoryManager->SetRestrideBufferPipeline(m_restrideBufferPipeline); diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h index 04956ac7..327104a1 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h @@ -471,9 +471,9 @@ private: MTL::RenderPipelineState* m_presentPipelineSRGB; // Hybrid pipelines - class MetalHybridComputePipeline* m_copyBufferToBufferPipeline; - //class MetalHybridComputePipeline* m_copyTextureToTexturePipeline; - class MetalHybridComputePipeline* m_restrideBufferPipeline; + class MetalVoidVertexPipeline* m_copyBufferToBufferPipeline; + //class MetalVoidVertexPipeline* m_copyTextureToTexturePipeline; + class MetalVoidVertexPipeline* m_restrideBufferPipeline; // Resources MTL::SamplerState* m_nearestSampler; diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.cpp similarity index 67% rename from src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp rename to src/Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.cpp index 7043b99f..ded711f9 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.cpp @@ -1,6 +1,6 @@ -#include "Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h" +#include "Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h" -MetalHybridComputePipeline::MetalHybridComputePipeline(class MetalRenderer* mtlRenderer, MTL::Library* library, const std::string& vertexFunctionName/*, const std::string& kernelFunctionName*/) +MetalVoidVertexPipeline::MetalVoidVertexPipeline(class MetalRenderer* mtlRenderer, MTL::Library* library, const std::string& vertexFunctionName) { // Render pipeline state MTL::Function* vertexFunction = library->newFunction(ToNSString(vertexFunctionName)); @@ -18,12 +18,9 @@ MetalHybridComputePipeline::MetalHybridComputePipeline(class MetalRenderer* mtlR cemuLog_log(LogType::Force, "error creating hybrid render pipeline state: {}", error->localizedDescription()->utf8String()); error->release(); } - - // Compute pipeline state } -MetalHybridComputePipeline::~MetalHybridComputePipeline() +MetalVoidVertexPipeline::~MetalVoidVertexPipeline() { m_renderPipelineState->release(); - //m_computePipelineState->release(); } diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h b/src/Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h new file mode 100644 index 00000000..57666a57 --- /dev/null +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalVoidVertexPipeline.h @@ -0,0 +1,16 @@ +#include "Cafe/HW/Latte/Renderer/Metal/MetalCommon.h" +#include "HW/Latte/Renderer/Metal/MetalRenderer.h" +#include "Metal/MTLLibrary.hpp" +#include "Metal/MTLRenderPipeline.hpp" + +class MetalVoidVertexPipeline +{ +public: + MetalVoidVertexPipeline(class MetalRenderer* mtlRenderer, MTL::Library* library, const std::string& vertexFunctionName); + ~MetalVoidVertexPipeline(); + + MTL::RenderPipelineState* GetRenderPipelineState() const { return m_renderPipelineState; } + +private: + MTL::RenderPipelineState* m_renderPipelineState; +};