yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
6bcf92d28
master
1// metal-pipeline-state.h 2#pragma once 3 4#include "metal-base.h" 5 6namespace gfx 7{ 8 9using namespace Slang ; 10 11namespace metal 12{ 13 14class PipelineStateImpl :public PipelineStateBase 15{ 16public : 17DeviceImpl * m_device ; 18NS ::SharedPtr < MTL ::RenderPipelineState > m_renderPipelineState ; 19NS ::SharedPtr < MTL ::DepthStencilState > m_depthStencilState ; 20NS ::SharedPtr < MTL ::ComputePipelineState > m_computePipelineState ; 21MTL ::Size m_threadGroupSize ; 22NS ::UInteger m_vertexBufferOffset ; 23 24PipelineStateImpl (DeviceImpl * device ); 25 ~PipelineStateImpl (); 26 27void init (const GraphicsPipelineStateDesc & desc ); 28void init (const ComputePipelineStateDesc & desc ); 29void init (const RayTracingPipelineStateDesc & desc ); 30 31Result createMetalComputePipelineState (); 32Result createMetalRenderPipelineState (); 33 34virtual Result ensureAPIPipelineStateCreated ()override ; 35 36virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle ( InteropHandle * outHandle) override; 37}; 38 39class RayTracingPipelineStateImpl : public PipelineStateImpl 40{ 41public: 42Dictionary < String, Index > shaderGroupNameToIndex; 43Int shaderGroupCount; 44 45RayTracingPipelineStateImpl( DeviceImpl * device); 46 47virtual Result ensureAPIPipelineStateCreated () override; 48 49virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle ( InteropHandle * outHandle) override; 50}; 51 52} // namespace metal 53} // namespace gfx