2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #6728 from ReinUsesLisp/null-buffer-usage

vk_buffer_cache: Add transform feedback usage to null buffer
This commit is contained in:
Rodrigo Locatti 2021-07-26 18:30:45 -03:00 committed by GitHub
commit c6991fa900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -358,7 +358,7 @@ void BufferCacheRuntime::ReserveNullBuffer() {
if (null_buffer) { if (null_buffer) {
return; return;
} }
null_buffer = device.GetLogical().CreateBuffer(VkBufferCreateInfo{ VkBufferCreateInfo create_info{
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
.pNext = nullptr, .pNext = nullptr,
.flags = 0, .flags = 0,
@ -367,9 +367,13 @@ void BufferCacheRuntime::ReserveNullBuffer() {
.sharingMode = VK_SHARING_MODE_EXCLUSIVE, .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
.queueFamilyIndexCount = 0, .queueFamilyIndexCount = 0,
.pQueueFamilyIndices = nullptr, .pQueueFamilyIndices = nullptr,
}); };
if (device.IsExtTransformFeedbackSupported()) {
create_info.usage |= VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT;
}
null_buffer = device.GetLogical().CreateBuffer(create_info);
if (device.HasDebuggingToolAttached()) { if (device.HasDebuggingToolAttached()) {
null_buffer.SetObjectNameEXT("Null index buffer"); null_buffer.SetObjectNameEXT("Null buffer");
} }
null_buffer_commit = memory_allocator.Commit(null_buffer, MemoryUsage::DeviceLocal); null_buffer_commit = memory_allocator.Commit(null_buffer, MemoryUsage::DeviceLocal);