summaryrefslogtreecommitdiff
path: root/video.cpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-29 13:40:45 +1100
committerquou <quou@disroot.org>2024-12-29 13:41:56 +1100
commit7383cfcbe8ade4dce057608e971e8cb7d4b1feb7 (patch)
tree6e00d45e89c46560b2a6de6729781e6079c678d7 /video.cpp
parentc41a63370e54cc1e6e0c1b1dc20e219f3cac2845 (diff)
allow binding only a portion of a cbuffer
Diffstat (limited to 'video.cpp')
-rw-r--r--video.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/video.cpp b/video.cpp
index 5d88d0c..d0720f5 100644
--- a/video.cpp
+++ b/video.cpp
@@ -2760,8 +2760,8 @@ void Descriptor_Set_Vk::init(
Buffer_Vk& b = *(Buffer_Vk*)&dev->get_buffer(cd->buffer);
assert(cd->buffer);
buf.buffer = b.buf;
- buf.offset = 0;
- buf.range = b.size;
+ buf.offset = cd->offset;
+ buf.range = cd->size? cd->size: b.size;
wd.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
wd.pBufferInfo = &buf;
} break;