rename hybrid pipeline to void vertex pipeline

This commit is contained in:
Samuliak 2024-09-30 19:43:53 +02:00
parent c65123bbbe
commit 5d01c77efc
8 changed files with 32 additions and 39 deletions

View File

@ -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

View File

@ -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;
};

View File

@ -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"

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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();
}

View File

@ -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;
};