PipelineStateMTL.h 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2025 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #include <Renderer/PipelineState.h>
  6. #include <Renderer/MTL/VertexShaderMTL.h>
  7. #include <Renderer/MTL/PixelShaderMTL.h>
  8. class RendererMTL;
  9. /// Metal pipeline state object
  10. class PipelineStateMTL : public PipelineState
  11. {
  12. public:
  13. /// Constructor
  14. PipelineStateMTL(RendererMTL *inRenderer, const VertexShaderMTL *inVertexShader, const EInputDescription *inInputDescription, uint inInputDescriptionCount, const PixelShaderMTL *inPixelShader, EDrawPass inDrawPass, EFillMode inFillMode, ETopology inTopology, EDepthTest inDepthTest, EBlendMode inBlendMode, ECullMode inCullMode);
  15. virtual ~PipelineStateMTL() override;
  16. /// Make this pipeline state active (any primitives rendered after this will use this state)
  17. virtual void Activate() override;
  18. private:
  19. RendererMTL * mRenderer;
  20. RefConst<VertexShaderMTL> mVertexShader;
  21. RefConst<PixelShaderMTL> mPixelShader;
  22. id<MTLRenderPipelineState> mPipelineState;
  23. id<MTLDepthStencilState> mDepthState;
  24. MTLCullMode mCullMode;
  25. MTLTriangleFillMode mFillMode;
  26. };