summaryrefslogtreecommitdiff
path: root/video.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.hpp')
-rw-r--r--video.hpp45
1 files changed, 44 insertions, 1 deletions
diff --git a/video.hpp b/video.hpp
index 9a5dbe3..9b64543 100644
--- a/video.hpp
+++ b/video.hpp
@@ -83,13 +83,40 @@ enum class Depth_Mode {
never
};
+enum class Blend_Factor {
+ zero,
+ one,
+ src_colour,
+ inv_src_colour,
+ dst_colour,
+ inv_dst_colour,
+ src_alpha,
+ inv_src_alpha,
+ dst_alpha,
+ inv_dst_alpha
+};
+
+enum class Blend_Mode {
+ add,
+ subtract,
+ reverse_subtract,
+ min,
+ max
+};
+
+
struct Pipeline {
uint64_t pipeline_hash;
uint64_t descriptor_resource_hash;
int viewport[4];
int scissor[4];
bool depth_test, depth_write;
+ bool blend_enable;
Depth_Mode depth_mode;
+ Blend_Factor blend_src, blend_dst;
+ Blend_Mode blend_mode;
+ Blend_Factor blend_src_alpha, blend_dst_alpha;
+ Blend_Mode blend_mode_alpha;
Vertex_Format_Id vertex_format;
Shader_Id shader;
Descriptor descriptors[pipeline_max_descriptors];
@@ -109,7 +136,14 @@ struct Pipeline {
scissor[3] == other.scissor[3] &&
depth_test == other.depth_test &&
depth_write == other.depth_write &&
- depth_mode == other.depth_mode;
+ depth_mode == other.depth_mode &&
+ blend_enable == other.blend_enable &&
+ blend_src == other.blend_src &&
+ blend_dst == other.blend_dst &&
+ blend_src_alpha == other.blend_src_alpha &&
+ blend_dst_alpha == other.blend_dst_alpha &&
+ blend_mode == other.blend_mode &&
+ blend_mode_alpha == other.blend_mode_alpha;
}
bool desc_layout_eq(const Pipeline& other) const {
@@ -257,6 +291,15 @@ struct Pipeline_Builder {
void viewport(float x, float y, float w, float h);
void scissor(float x, float y, float w, float h);
void depth(bool test, bool write, Depth_Mode mode);
+ void blend(Blend_Mode mode, Blend_Factor src, Blend_Factor dst);
+ void 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
+ );
void shader(Shader_Id s);
void vertex_format(Vertex_Format_Id vf);
void texture(int binding, Texture_Id t, Sampler_Id s);