summaryrefslogtreecommitdiff
path: root/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pipeline.cpp')
-rw-r--r--pipeline.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/pipeline.cpp b/pipeline.cpp
index 015a5dd..a3ea553 100644
--- a/pipeline.cpp
+++ b/pipeline.cpp
@@ -165,6 +165,38 @@ void Pipeline_Builder::depth(bool test, bool write, Depth_Mode mode) {
pip->depth_mode = mode;
}
+void Pipeline_Builder::blend(
+ Blend_Mode mode,
+ Blend_Factor src,
+ Blend_Factor dst
+) {
+ blend(
+ mode,
+ src,
+ dst,
+ mode,
+ src,
+ dst
+ );
+}
+
+void Pipeline_Builder::blend(
+ Blend_Mode mode_col,
+ Blend_Factor src_col,
+ Blend_Factor dst_col,
+ Blend_Mode mode_alpha,
+ Blend_Factor src_alpha,
+ Blend_Factor dst_alpha
+) {
+ pip->blend_enable = true;
+ pip->blend_mode = mode_col;
+ pip->blend_src = src_col;
+ pip->blend_dst = dst_col;
+ pip->blend_mode_alpha = mode_alpha;
+ pip->blend_src_alpha = src_alpha;
+ pip->blend_dst_alpha = dst_alpha;
+}
+
void Pipeline_Builder::shader(Shader_Id s) {
pip->shader = s;
}
@@ -226,6 +258,13 @@ Pipeline& Pipeline_Builder::build() {
h(pip->pipeline_hash, pip->depth_test);
h(pip->pipeline_hash, pip->depth_write);
h(pip->pipeline_hash, pip->depth_mode);
+ h(pip->pipeline_hash, pip->blend_enable);
+ h(pip->pipeline_hash, pip->blend_mode);
+ h(pip->pipeline_hash, pip->blend_mode_alpha);
+ h(pip->pipeline_hash, pip->blend_src);
+ h(pip->pipeline_hash, pip->blend_dst);
+ h(pip->pipeline_hash, pip->blend_src_alpha);
+ h(pip->pipeline_hash, pip->blend_dst_alpha);
{
int i, e = pip->descriptor_count;
pip->descriptor_resource_hash = fnv1a64(0, 0);