summaryrefslogtreecommitdiff
path: root/pipeline.cpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-23 21:30:13 +1100
committerquou <quou@disroot.org>2024-12-23 21:30:13 +1100
commit078b97e48b5ad5fcf3f5a16bb081ea0efb1f931b (patch)
treed04bfb2d25952b214a4df303823ff7c5d2743681 /pipeline.cpp
parentb293168cc158d65f1a5146f155921ff82119d1bc (diff)
send textures to shaders
Diffstat (limited to 'pipeline.cpp')
-rw-r--r--pipeline.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/pipeline.cpp b/pipeline.cpp
index ce95672..1715930 100644
--- a/pipeline.cpp
+++ b/pipeline.cpp
@@ -32,12 +32,30 @@ void Pipeline_Builder::begin() {
pip = (Pipeline*)arena_alloc(arena, sizeof *pip);
pip->vertex_format = 0;
pip->shader = 0;
+ pip->descriptors = 0;
}
void Pipeline_Builder::shader(Shader_Id s) {
pip->shader = s;
}
+void Pipeline_Builder::texture(
+ int binding,
+ Texture_Id t,
+ Sampler_Id s
+) {
+ Texture_Descriptor* d = (Texture_Descriptor*)arena_alloc(
+ arena,
+ sizeof *d
+ );
+ d->slot = binding;
+ d->type = Descriptor::Type::texture;
+ d->sampler = s;
+ d->texture = t;
+ d->next = pip->descriptors;
+ pip->descriptors = d;
+}
+
void Pipeline_Builder::vertex_format(Vertex_Format_Id vf) {
pip->vertex_format = vf;
}