diff options
author | quou <quou@disroot.org> | 2024-12-29 13:40:45 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-29 13:41:56 +1100 |
commit | 7383cfcbe8ade4dce057608e971e8cb7d4b1feb7 (patch) | |
tree | 6e00d45e89c46560b2a6de6729781e6079c678d7 /video.hpp | |
parent | c41a63370e54cc1e6e0c1b1dc20e219f3cac2845 (diff) |
allow binding only a portion of a cbuffer
Diffstat (limited to 'video.hpp')
-rw-r--r-- | video.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -44,7 +44,7 @@ struct Sampler_Id : public Primitive_Id<uint32_t> { using Primitive_Id<uint32_t>::Primitive_Id; }; -#define descriptor_payload_size 8 +#define descriptor_payload_size 16 struct Descriptor { enum class Type { @@ -61,6 +61,7 @@ struct Texture_Descriptor { }; struct Constant_Buffer_Descriptor { + int offset, size; Buffer_Id buffer; }; @@ -146,6 +147,8 @@ struct Pipeline { Constant_Buffer_Descriptor* cb = (Constant_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; } break; } } @@ -254,7 +257,12 @@ struct Pipeline_Builder { void shader(Shader_Id s); void vertex_format(Vertex_Format_Id vf); void texture(int binding, Texture_Id t, Sampler_Id s); - void cbuffer(int binding, Buffer_Id id); + void cbuffer( + int binding, + Buffer_Id id, + int offset = 0, + int size = 0 + ); Pipeline& build(); void validate(); }; |