Cemu/src/Cafe/HW/Latte/Renderer/Metal/MetalPipelineCompiler.h
2024-10-15 19:19:16 +02:00

39 lines
1.7 KiB
C++

#pragma once
#include "Cafe/HW/Latte/Renderer/Metal/MetalAttachmentsInfo.h"
#include "Cafe/HW/Latte/ISA/LatteReg.h"
#include "Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h"
class MetalPipelineCompiler
{
public:
MetalPipelineCompiler(class MetalRenderer* metalRenderer) : m_mtlr{metalRenderer} {}
~MetalPipelineCompiler();
void InitFromState(const LatteFetchShader* fetchShader, const LatteDecompilerShader* vertexShader, const LatteDecompilerShader* geometryShader, const LatteDecompilerShader* pixelShader, const class MetalAttachmentsInfo& lastUsedAttachmentsInfo, const class MetalAttachmentsInfo& activeAttachmentsInfo, const LatteContextRegister& lcr);
MTL::RenderPipelineState* Compile(bool forceCompile, bool isRenderThread, bool showInOverlay);
private:
class MetalRenderer* m_mtlr;
const class RendererShaderMtl* m_vertexShader;
const class RendererShaderMtl* m_geometryShader;
const class RendererShaderMtl* m_pixelShader;
bool m_usesGeometryShader;
/*
std::map<uint64, MTL::RenderPipelineState*> m_pipelineCache;
NS::URL* m_binaryArchiveURL;
MTL::BinaryArchive* m_binaryArchive;
*/
NS::Object* m_pipelineDescriptor;
void InitFromStateRender(const LatteFetchShader* fetchShader, const LatteDecompilerShader* vertexShader, const class MetalAttachmentsInfo& lastUsedAttachmentsInfo, const class MetalAttachmentsInfo& activeAttachmentsInfo, const LatteContextRegister& lcr);
void InitFromStateMesh(const LatteFetchShader* fetchShader, const class MetalAttachmentsInfo& lastUsedAttachmentsInfo, const class MetalAttachmentsInfo& activeAttachmentsInfo, const LatteContextRegister& lcr);
//void TryLoadBinaryArchive();
};