diff --git a/MobileGL/MG_Backend/DirectVulkan/DirectVulkan.cpp b/MobileGL/MG_Backend/DirectVulkan/DirectVulkan.cpp index 77819aaf..f63d5a7e 100644 --- a/MobileGL/MG_Backend/DirectVulkan/DirectVulkan.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/DirectVulkan.cpp @@ -936,7 +936,28 @@ namespace MobileGL::MG_Backend::DirectVulkan { static Bool BuildClosedLineLoopIndices(GLsizei count, GLenum type, const void* indices, Vector& outIndices) { #if MOBILEGL_BUILD_DISAGGREGATED - RejectWireLegacyBuffer(); + if (MG_Config::Transport != MG_Config::TransportMode::Monolith) { + const SizeT width = MG_Util::GetGLTypeSize(type); + if ((width != 1 && width != 2 && width != 4) || count < 2) return false; + const auto& bound = MG_Pipe::MGPipeApplier().IndexBuffer; + Vector owned; + const Uint8* bytes = static_cast(indices); + if (!MG_Pipe::MGPipeHandleIsNull(bound.Res)) { + owned.resize(static_cast(count) * width); + const Uint64 offset = bound.Offset + reinterpret_cast(indices); + if (offset < bound.Offset || !pVulkanRenderer->GetWireBufferManager().ReadWireBuffer( + bound.Res, offset, owned.size(), owned.data())) return false; + bytes = owned.data(); + } + if (!bytes) return false; + outIndices.resize(static_cast(count) + 1); + for (GLsizei i = 0; i < count; ++i) { + outIndices[i] = 0; + Memcpy(&outIndices[i], bytes + static_cast(i) * width, width); + } + outIndices[count] = outIndices[0]; + return true; + } #endif const SizeT indexSize = MG_Util::GetGLTypeSize(type); if (indexSize == 0 || count < 2) { diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkBufferManager.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkBufferManager.cpp index 59c4917d..f72b60fd 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkBufferManager.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkBufferManager.cpp @@ -562,7 +562,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { .usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | #if MOBILEGL_BUILD_DISAGGREGATED - (MG_Config::Transport != MG_Config::TransportMode::Monolith ? VK_BUFFER_USAGE_TRANSFER_DST_BIT : 0) | + (MG_Config::Transport != MG_Config::TransportMode::Monolith ? VkBufferUsageFlags{VK_BUFFER_USAGE_TRANSFER_DST_BIT} : 0u) | #endif VK_BUFFER_USAGE_TRANSFER_SRC_BIT, .memoryUsage = m_initInfo.transientMemoryUsage,