vk_buffer_cache: Respect max vertex bindings in BindVertexBuffers (#11471)

This commit is contained in:
GPUCode 2023-09-10 03:19:45 +03:00 committed by GitHub
parent bbfd9eb428
commit 24ab10c2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -529,17 +529,20 @@ void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bi
buffer_handles.push_back(handle);
}
if (device.IsExtExtendedDynamicStateSupported()) {
scheduler.Record([bindings_ = std::move(bindings),
scheduler.Record([this, bindings_ = std::move(bindings),
buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) {
cmdbuf.BindVertexBuffers2EXT(bindings_.min_index,
bindings_.max_index - bindings_.min_index,
std::min(bindings_.max_index - bindings_.min_index,
device.GetMaxVertexInputBindings()),
buffer_handles_.data(), bindings_.offsets.data(),
bindings_.sizes.data(), bindings_.strides.data());
});
} else {
scheduler.Record([bindings_ = std::move(bindings),
scheduler.Record([this, bindings_ = std::move(bindings),
buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) {
cmdbuf.BindVertexBuffers(bindings_.min_index, bindings_.max_index - bindings_.min_index,
cmdbuf.BindVertexBuffers(bindings_.min_index,
std::min(bindings_.max_index - bindings_.min_index,
device.GetMaxVertexInputBindings()),
buffer_handles_.data(), bindings_.offsets.data());
});
}