summaryrefslogtreecommitdiff
path: root/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pipeline.cpp')
-rw-r--r--pipeline.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/pipeline.cpp b/pipeline.cpp
index 30c110c..647ff49 100644
--- a/pipeline.cpp
+++ b/pipeline.cpp
@@ -232,10 +232,10 @@ void Pipeline_Builder::cbuffer(
int size
) {
Descriptor* d;
- Constant_Buffer_Descriptor* cd;
+ Buffer_Descriptor* cd;
assert(pip->descriptor_count < pipeline_max_descriptors);
d = &pip->descriptors[pip->descriptor_count++];
- cd = (Constant_Buffer_Descriptor*)d->payload;
+ cd = (Buffer_Descriptor*)d->payload;
d->slot = binding;
d->type = Descriptor::Type::constant_buffer;
cd->buffer = id;
@@ -243,6 +243,24 @@ void Pipeline_Builder::cbuffer(
cd->size = size;
}
+void Pipeline_Builder::sbuffer(
+ int binding,
+ Buffer_Id id,
+ int offset,
+ int size
+) {
+ Descriptor* d;
+ Buffer_Descriptor* cd;
+ assert(pip->descriptor_count < pipeline_max_descriptors);
+ d = &pip->descriptors[pip->descriptor_count++];
+ cd = (Buffer_Descriptor*)d->payload;
+ d->slot = binding;
+ d->type = Descriptor::Type::structured_buffer;
+ cd->buffer = id;
+ cd->offset = offset;
+ cd->size = size;
+}
+
void Pipeline_Builder::vertex_format(Vertex_Format_Id vf) {
pip->vertex_format = vf;
}
@@ -295,8 +313,9 @@ void Pipeline::hash() {
h(descriptor_resource_hash, td->sampler);
h(descriptor_resource_hash, td->texture);
} break;
- case Descriptor::Type::constant_buffer: {
- auto cd = (Constant_Buffer_Descriptor*)d->payload;
+ case Descriptor::Type::constant_buffer:
+ case Descriptor::Type::structured_buffer: {
+ auto cd = (Buffer_Descriptor*)d->payload;
h(descriptor_resource_hash, cd->buffer);
h(descriptor_resource_hash, cd->size);
h(descriptor_resource_hash, cd->offset);