summaryrefslogtreecommitdiff
path: root/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pipeline.cpp')
-rw-r--r--pipeline.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/pipeline.cpp b/pipeline.cpp
index 8867a8d..8750db0 100644
--- a/pipeline.cpp
+++ b/pipeline.cpp
@@ -185,7 +185,12 @@ void Pipeline_Builder::texture(
td->texture = t;
}
-void Pipeline_Builder::cbuffer(int binding, Buffer_Id id) {
+void Pipeline_Builder::cbuffer(
+ int binding,
+ Buffer_Id id,
+ int offset,
+ int size
+) {
Descriptor* d;
Constant_Buffer_Descriptor* cd;
assert(pip->descriptor_count < pipeline_max_descriptors);
@@ -194,6 +199,8 @@ void Pipeline_Builder::cbuffer(int binding, Buffer_Id id) {
d->slot = binding;
d->type = Descriptor::Type::constant_buffer;
cd->buffer = id;
+ cd->offset = offset;
+ cd->size = size;
}
void Pipeline_Builder::vertex_format(Vertex_Format_Id vf) {
@@ -237,6 +244,8 @@ Pipeline& Pipeline_Builder::build() {
case Descriptor::Type::constant_buffer: {
auto cd = (Constant_Buffer_Descriptor*)d->payload;
h(pip->descriptor_resource_hash, cd->buffer);
+ h(pip->descriptor_resource_hash, cd->size);
+ h(pip->descriptor_resource_hash, cd->offset);
} break;
}
}