forked from H-uru/Plasma
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documeting/cleaning up pipeline state header
- Loading branch information
1 parent
e8f47d3
commit c70da8d
Showing
2 changed files
with
17 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "plMetalDevice.h" | ||
#include "plSurface/plShaderTable.h" | ||
|
||
//MARK: Base pipeline state | ||
|
||
class plMetalPipelineState | ||
{ | ||
public: | ||
|
@@ -89,6 +91,8 @@ class plMetalPipelineState | |
} | ||
}; | ||
|
||
//MARK: Abstract FVF vertex shader program parent type | ||
|
||
class plMetalRenderSpanPipelineState : public plMetalPipelineState | ||
{ | ||
public: | ||
|
@@ -121,6 +125,8 @@ class plMetalRenderSpanPipelineState : public plMetalPipelineState | |
} | ||
}; | ||
|
||
//MARK: Fixed function emulating material program | ||
|
||
struct plMetalFragmentShaderDescription | ||
{ | ||
uint8_t passTypes[8]; | ||
|
@@ -205,6 +211,8 @@ class plMetalMaterialPassPipelineState : public plMetalRenderSpanPipelineState | |
plMetalFragmentShaderDescription fFragmentShaderDescription; | ||
}; | ||
|
||
//MARK: Shadow casting program | ||
|
||
class plMetalRenderShadowCasterPipelineState : public plMetalRenderSpanPipelineState | ||
{ | ||
public: | ||
|
@@ -233,6 +241,8 @@ class plMetalRenderShadowCasterPipelineState : public plMetalRenderSpanPipelineS | |
} | ||
}; | ||
|
||
//MARK: Shadow rendering program | ||
|
||
class plMetalRenderShadowPipelineState : public plMetalMaterialPassPipelineState | ||
{ | ||
public: | ||
|
@@ -256,6 +266,8 @@ class plMetalRenderShadowPipelineState : public plMetalMaterialPassPipelineState | |
} | ||
}; | ||
|
||
//MARK: Shader based render programs | ||
|
||
class plMetalDynamicMaterialPipelineState : public plMetalRenderSpanPipelineState | ||
{ | ||
public: | ||
|
@@ -319,6 +331,8 @@ struct std::hash<plMetalPipelineState> | |
} | ||
}; | ||
|
||
//MARK: Clear buffer program | ||
|
||
class plMetalClearPipelineState : public plMetalPipelineState | ||
{ | ||
public: | ||
|
@@ -343,11 +357,11 @@ class plMetalClearPipelineState : public plMetalPipelineState | |
return new plMetalClearPipelineState(*this); | ||
}; | ||
|
||
// | ||
virtual const MTL::Function* GetVertexFunction(MTL::Library* library) override | ||
{ | ||
return library->newFunction(NS::MakeConstantString("clearVertex")); | ||
}; | ||
|
||
virtual const MTL::Function* GetFragmentFunction(MTL::Library* library) override | ||
{ | ||
return library->newFunction(NS::MakeConstantString("clearFragment"), | ||
|
@@ -362,13 +376,8 @@ class plMetalClearPipelineState : public plMetalPipelineState | |
|
||
virtual void ConfigureBlend(MTL::RenderPipelineColorAttachmentDescriptor* descriptor) override | ||
{ | ||
// if (fShouldClearColor) { | ||
descriptor->setSourceRGBBlendFactor(MTL::BlendFactorOne); | ||
descriptor->setDestinationRGBBlendFactor(MTL::BlendFactorZero); | ||
//} else { | ||
// descriptor->setSourceRGBBlendFactor(MTL::BlendFactorZero); | ||
// descriptor->setDestinationRGBBlendFactor(MTL::BlendFactorOne); | ||
//} | ||
}; | ||
|
||
virtual void ConfigureVertexDescriptor(MTL::VertexDescriptor* vertexDescriptor) override | ||
|