summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderState.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-09-09 00:10:40 +1000
committerStenzek <stenzek@gmail.com>2017-09-11 20:01:52 +1000
commit340aabbb06404481b8a496f506ebc9bae75fad6c (patch)
treebec229041a0bf943001d38f1ddbb6b6bde8ca7b0 /Source/Core/VideoCommon/RenderState.cpp
parentb7a099814a6cfcd1db4d7091e01bf4538be67e5e (diff)
VideoCommon: Add helpers for generating common render states
Diffstat (limited to 'Source/Core/VideoCommon/RenderState.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderState.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/RenderState.cpp b/Source/Core/VideoCommon/RenderState.cpp
index d019214206..d8cd5e7f11 100644
--- a/Source/Core/VideoCommon/RenderState.cpp
+++ b/Source/Core/VideoCommon/RenderState.cpp
@@ -144,3 +144,37 @@ void BlendingState::Generate(const BPMemory& bp)
}
}
}
+
+namespace RenderState
+{
+RasterizationState GetNoCullRasterizationState()
+{
+ RasterizationState state = {};
+ state.cullmode = GenMode::CULL_NONE;
+ return state;
+}
+
+DepthState GetNoDepthTestingDepthStencilState()
+{
+ DepthState state = {};
+ state.testenable = false;
+ state.updateenable = false;
+ state.func = ZMode::ALWAYS;
+ return state;
+}
+
+BlendingState GetNoBlendingBlendState()
+{
+ BlendingState state = {};
+ state.usedualsrc = false;
+ state.blendenable = false;
+ state.srcfactor = BlendMode::ONE;
+ state.srcfactoralpha = BlendMode::ONE;
+ state.dstfactor = BlendMode::ZERO;
+ state.dstfactoralpha = BlendMode::ZERO;
+ state.logicopenable = false;
+ state.colorupdate = true;
+ state.alphaupdate = true;
+ return state;
+}
+}