vk_update_descriptor: Inline and improve code for binding buffers

Allow compilers with our settings inline hot code.
This commit is contained in:
ReinUsesLisp
2021-01-18 21:35:47 -03:00
parent 95722823b9
commit 21b40de318
4 changed files with 24 additions and 24 deletions

View File

@@ -20,20 +20,20 @@ VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const Device& device_, VKSchedu
VKUpdateDescriptorQueue::~VKUpdateDescriptorQueue() = default;
void VKUpdateDescriptorQueue::TickFrame() {
payload.clear();
payload_cursor = payload.data();
}
void VKUpdateDescriptorQueue::Acquire() {
// Minimum number of entries required.
// This is the maximum number of entries a single draw call migth use.
static constexpr std::size_t MIN_ENTRIES = 0x400;
static constexpr size_t MIN_ENTRIES = 0x400;
if (payload.size() + MIN_ENTRIES >= payload.max_size()) {
if (std::distance(payload.data(), payload_cursor) + MIN_ENTRIES >= payload.max_size()) {
LOG_WARNING(Render_Vulkan, "Payload overflow, waiting for worker thread");
scheduler.WaitWorker();
payload.clear();
payload_cursor = payload.data();
}
upload_start = &*payload.end();
upload_start = payload_cursor;
}
void VKUpdateDescriptorQueue::Send(VkDescriptorUpdateTemplateKHR update_template,