|
|
|
@ -501,11 +501,10 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings& bindings) {
|
|
|
|
|
void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings) {
|
|
|
|
|
boost::container::small_vector<VkBuffer, 32> buffer_handles;
|
|
|
|
|
for (u32 index = 0; index < bindings.buffers.size(); index++) {
|
|
|
|
|
auto& buffer = *reinterpret_cast<Buffer*>(bindings.buffers[index]);
|
|
|
|
|
auto handle = buffer.Handle();
|
|
|
|
|
for (u32 index = 0; index < bindings.buffers.size(); ++index) {
|
|
|
|
|
auto handle = bindings.buffers[index]->Handle();
|
|
|
|
|
if (handle == VK_NULL_HANDLE) {
|
|
|
|
|
bindings.offsets[index] = 0;
|
|
|
|
|
bindings.sizes[index] = VK_WHOLE_SIZE;
|
|
|
|
@ -521,16 +520,13 @@ void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings& bindings)
|
|
|
|
|
buffer_handles = buffer_handles](vk::CommandBuffer cmdbuf) {
|
|
|
|
|
cmdbuf.BindVertexBuffers2EXT(
|
|
|
|
|
bindings.min_index, bindings.max_index - bindings.min_index, buffer_handles.data(),
|
|
|
|
|
reinterpret_cast<const VkDeviceSize*>(bindings.offsets.data()),
|
|
|
|
|
reinterpret_cast<const VkDeviceSize*>(bindings.sizes.data()),
|
|
|
|
|
reinterpret_cast<const VkDeviceSize*>(bindings.strides.data()));
|
|
|
|
|
bindings.offsets.data(), bindings.sizes.data(), bindings.strides.data());
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
scheduler.Record([bindings = bindings,
|
|
|
|
|
buffer_handles = buffer_handles](vk::CommandBuffer cmdbuf) {
|
|
|
|
|
cmdbuf.BindVertexBuffers(
|
|
|
|
|
bindings.min_index, bindings.max_index - bindings.min_index, buffer_handles.data(),
|
|
|
|
|
reinterpret_cast<const VkDeviceSize*>(bindings.offsets.data()));
|
|
|
|
|
cmdbuf.BindVertexBuffers(bindings.min_index, bindings.max_index - bindings.min_index,
|
|
|
|
|
buffer_handles.data(), bindings.offsets.data());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -556,22 +552,20 @@ void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, VkBuffer buffer,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings& bindings) {
|
|
|
|
|
void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings<Buffer>& bindings) {
|
|
|
|
|
if (!device.IsExtTransformFeedbackSupported()) {
|
|
|
|
|
// Already logged in the rasterizer
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
boost::container::small_vector<VkBuffer, 4> buffer_handles;
|
|
|
|
|
for (u32 index = 0; index < bindings.buffers.size(); index++) {
|
|
|
|
|
auto& buffer = *reinterpret_cast<Buffer*>(bindings.buffers[index]);
|
|
|
|
|
buffer_handles.push_back(buffer.Handle());
|
|
|
|
|
for (u32 index = 0; index < bindings.buffers.size(); ++index) {
|
|
|
|
|
buffer_handles.push_back(bindings.buffers[index]->Handle());
|
|
|
|
|
}
|
|
|
|
|
scheduler.Record(
|
|
|
|
|
[bindings = bindings, buffer_handles = buffer_handles](vk::CommandBuffer cmdbuf) {
|
|
|
|
|
cmdbuf.BindTransformFeedbackBuffersEXT(
|
|
|
|
|
0, static_cast<u32>(buffer_handles.size()), buffer_handles.data(),
|
|
|
|
|
reinterpret_cast<const VkDeviceSize*>(bindings.offsets.data()),
|
|
|
|
|
reinterpret_cast<const VkDeviceSize*>(bindings.sizes.data()));
|
|
|
|
|
cmdbuf.BindTransformFeedbackBuffersEXT(0, static_cast<u32>(buffer_handles.size()),
|
|
|
|
|
buffer_handles.data(), bindings.offsets.data(),
|
|
|
|
|
bindings.sizes.data());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|