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