diff options
author | quou <quou@disroot.org> | 2024-12-30 10:25:26 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-30 10:25:26 +1100 |
commit | b27cc55aa631c52dae4a1a9c8c6888fc063fe022 (patch) | |
tree | efdb66a4c4e8a223f77da9eab100c21c468f1a2a /video.hpp | |
parent | 693a133cb1a0356f3257f2879be4e23cbb67cbe3 (diff) |
backface culling
Diffstat (limited to 'video.hpp')
-rw-r--r-- | video.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |