summaryrefslogtreecommitdiff
path: root/video.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-02-09 19:29:28 +1100
committerquou <quou@disroot.org>2025-02-12 23:57:48 +1100
commit5d5a21dec0c865c35297cad03b7b5c61043ca8c3 (patch)
treec084e5433f8406e7275d0636660efd5b1add8e9f /video.hpp
parent0de071eb23d6774042e7f466591483b4e72e9473 (diff)
make the pipeline builder a bit cleaner to use
Diffstat (limited to 'video.hpp')
-rw-r--r--video.hpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/video.hpp b/video.hpp
index ccc1f11..b8293fa 100644
--- a/video.hpp
+++ b/video.hpp
@@ -298,21 +298,23 @@ struct Pipeline_Builder {
Pipeline_Builder(Arena* arena, Device* dev);
- void begin_rp();
- void rp_target(Texture_Id id, Colour clear_colour);
- void rp_target(Texture_Id id, Clear_Mode mode);
- void rp_depth_target(Texture_Id id, float clear_depth);
- void rp_depth_target(Texture_Id id, Clear_Mode mode);
+ using PB = Pipeline_Builder&;
+
+ PB& begin_rp();
+ PB& rp_target(Texture_Id id, Colour clear_colour);
+ PB& rp_target(Texture_Id id, Clear_Mode mode);
+ PB& rp_depth_target(Texture_Id id, float clear_depth);
+ PB& rp_depth_target(Texture_Id id, Clear_Mode mode);
Render_Pass& build_rp();
void validate_rp();
- void begin();
- void viewport(int x, int y, int w, int h);
- void scissor(int x, int y, int w, int h);
- void depth(bool test, bool write, Depth_Mode mode);
- void geo(Geo_Type type);
- void blend(Blend_Mode mode, Blend_Factor src, Blend_Factor dst);
- void blend(
+ PB& begin(const Render_Pass* p = 0);
+ PB& viewport(int x, int y, int w, int h);
+ PB& scissor(int x, int y, int w, int h);
+ PB& depth(bool test, bool write, Depth_Mode mode);
+ PB& geo(Geo_Type type);
+ PB& blend(Blend_Mode mode, Blend_Factor src, Blend_Factor dst);
+ PB& blend(
Blend_Mode mode_col,
Blend_Factor src_col,
Blend_Factor dst_col,
@@ -320,17 +322,17 @@ 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);
- void cbuffer(
+ PB& cull(Cull_Mode mode);
+ PB& shader(Shader_Id s);
+ PB& vertex_format(Vertex_Format_Id vf);
+ PB& texture(int binding, Texture_Id t, Sampler_Id s);
+ PB& cbuffer(
int binding,
Buffer_Id id,
int offset = 0,
int size = 0
);
- void sbuffer(
+ PB& sbuffer(
int binding,
Buffer_Id id,
int offset = 0,