diff options
Diffstat (limited to 'pipeline.cpp')
-rw-r--r-- | pipeline.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pipeline.cpp b/pipeline.cpp index 527c1e7..89f606d 100644 --- a/pipeline.cpp +++ b/pipeline.cpp @@ -56,6 +56,17 @@ void Pipeline_Builder::texture( td->texture = t; } +void Pipeline_Builder::cbuffer(int binding, Buffer_Id id) { + Descriptor* d; + Constant_Buffer_Descriptor* cd; + assert(pip->descriptor_count < pipeline_max_descriptors); + d = &pip->descriptors[pip->descriptor_count++]; + cd = (Constant_Buffer_Descriptor*)d->payload; + d->slot = binding; + d->type = Descriptor::Type::constant_buffer; + cd->buffer = id; +} + void Pipeline_Builder::vertex_format(Vertex_Format_Id vf) { pip->vertex_format = vf; } @@ -83,6 +94,10 @@ Pipeline& Pipeline_Builder::build() { h(pip->descriptor_resource_hash, td->sampler); h(pip->descriptor_resource_hash, td->texture); } break; + case Descriptor::Type::constant_buffer: { + auto cd = (Constant_Buffer_Descriptor*)d->payload; + h(pip->descriptor_resource_hash, cd->buffer); + } break; } } } |