44 [[nodiscard]] MTL::RenderPipelineState*
raw()
const {
return _pipeline; }
47 MTL::RenderPipelineState*
get(
const Primitive& primitive,
const std::shared_ptr<VertexFormat>& vertexFormat0,
48 const std::shared_ptr<VertexFormat>& vertexFormat1,
int ibFormat,
const std::shared_ptr<Shader>& shader,
49 const std::shared_ptr<RenderTarget>& renderTarget,
50 const std::vector<std::shared_ptr<MetalBindGroupFormat>>& bindGroupFormats,
51 const std::shared_ptr<BlendState>& blendState,
const std::shared_ptr<DepthState>& depthState,
52 CullMode cullMode,
bool stencilEnabled,
53 const std::shared_ptr<StencilParameters>& stencilFront,
const std::shared_ptr<StencilParameters>& stencilBack,
54 const std::shared_ptr<VertexFormat>& instancingFormat =
nullptr);
58 MTL::RenderPipelineState* create(
59 const MTL::PrimitiveType primitiveTopology,
int ibFormat,
const std::shared_ptr<Shader>& shader,
61 std::shared_ptr<BlendState> blendState, std::shared_ptr<DepthState> depthState,
62 const std::vector<void*>& vertexBufferLayout,
CullMode cullMode,
bool stencilEnabled,
63 std::shared_ptr<StencilParameters> stencilFront, std::shared_ptr<StencilParameters> stencilBack,
64 int vertexStride = 56,
65 int instancingStride = 0
69 void setBlend(MTL::RenderPipelineColorAttachmentDescriptor* colorAttachment,
const std::shared_ptr<BlendState>& blendState);
71 MTL::RenderPipelineState* _pipeline;
74 std::vector<uint32_t> _lookupHashes;
77 std::unordered_map<uint32_t, std::vector<std::shared_ptr<CacheEntry>>> _cache;
80 std::unique_ptr<MetalVertexBufferLayout> _vertexBufferLayout;
83 static const MTL::PrimitiveType primitiveTopology[5];
84 static const MTL::BlendOperation blendOperation[5];
85 static const MTL::BlendFactor blendFactor[13];
std::vector< uint32_t > hashes
MTL::RenderPipelineState * pipeline