From b27cc55aa631c52dae4a1a9c8c6888fc063fe022 Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 30 Dec 2024 10:25:26 +1100 Subject: backface culling --- video.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'video.hpp') diff --git a/video.hpp b/video.hpp index 60127f3..13dbf16 100644 --- a/video.hpp +++ b/video.hpp @@ -104,6 +104,11 @@ enum class Blend_Mode { max }; +enum class Cull_Mode { + none, + back, + front +}; struct Pipeline { uint64_t pipeline_hash; @@ -117,6 +122,7 @@ struct Pipeline { Blend_Mode blend_mode; Blend_Factor blend_src_alpha, blend_dst_alpha; Blend_Mode blend_mode_alpha; + Cull_Mode cull_mode; Vertex_Format_Id vertex_format; Shader_Id shader; Descriptor descriptors[pipeline_max_descriptors]; @@ -143,7 +149,8 @@ struct Pipeline { 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; + blend_mode_alpha == other.blend_mode_alpha && + cull_mode == other.cull_mode; } bool desc_layout_eq(const Pipeline& other) const { @@ -300,6 +307,7 @@ struct Pipeline_Builder { Blend_Factor src_alpha, Blend_Factor dst_alpha ); + void cull(Cull_Mode mode); void shader(Shader_Id s); void vertex_format(Vertex_Format_Id vf); void texture(int binding, Texture_Id t, Sampler_Id s); -- cgit v1.2.3-54-g00ecf