summaryrefslogtreecommitdiff
path: root/video.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.hpp')
-rw-r--r--video.hpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/video.hpp b/video.hpp
index c93093e..ccc1f11 100644
--- a/video.hpp
+++ b/video.hpp
@@ -52,7 +52,8 @@ struct Sampler_Id : public Primitive_Id<uint32_t> {
struct Descriptor {
enum class Type {
texture,
- constant_buffer
+ constant_buffer,
+ structured_buffer
} type;
int slot;
uint8_t payload[descriptor_payload_size];
@@ -63,13 +64,13 @@ struct Texture_Descriptor {
Sampler_Id sampler;
};
-struct Constant_Buffer_Descriptor {
+struct Buffer_Descriptor {
int offset, size;
Buffer_Id buffer;
};
static_assert(sizeof(Texture_Descriptor) <= descriptor_payload_size);
-static_assert(sizeof(Constant_Buffer_Descriptor) <= descriptor_payload_size);
+static_assert(sizeof(Buffer_Descriptor) <= descriptor_payload_size);
#define pipeline_max_descriptors 16
@@ -195,11 +196,12 @@ struct Pipeline {
if (ta->texture != tb->texture) return false;
if (ta->sampler != tb->sampler) return false;
} break;
- case Descriptor::Type::constant_buffer: {
- Constant_Buffer_Descriptor* ca =
- (Constant_Buffer_Descriptor*)a.payload;
- Constant_Buffer_Descriptor* cb =
- (Constant_Buffer_Descriptor*)b.payload;
+ case Descriptor::Type::constant_buffer:
+ case Descriptor::Type::structured_buffer: {
+ Buffer_Descriptor* ca =
+ (Buffer_Descriptor*)a.payload;
+ Buffer_Descriptor* cb =
+ (Buffer_Descriptor*)b.payload;
if (ca->buffer != cb->buffer) return false;
if (ca->size != cb->size) return false;
if (ca->offset != cb->offset) return false;
@@ -328,6 +330,12 @@ struct Pipeline_Builder {
int offset = 0,
int size = 0
);
+ void sbuffer(
+ int binding,
+ Buffer_Id id,
+ int offset = 0,
+ int size = 0
+ );
Pipeline& build();
void validate();
};