diff --git a/src/common/vulkan/texture.cpp b/src/common/vulkan/texture.cpp index 5cfcb7047..b1b8276b3 100644 --- a/src/common/vulkan/texture.cpp +++ b/src/common/vulkan/texture.cpp @@ -422,7 +422,7 @@ bool Vulkan::Texture::BeginUpdate(u32 width, u32 height, void** out_buffer, u32* return true; } -void Vulkan::Texture::EndUpdate(u32 x, u32 y, u32 width, u32 height) +void Vulkan::Texture::EndUpdate(u32 x, u32 y, u32 width, u32 height, u32 level, u32 layer) { const u32 pitch = CalcUpdatePitch(width); const u32 required_size = pitch * height; @@ -431,11 +431,12 @@ void Vulkan::Texture::EndUpdate(u32 x, u32 y, u32 width, u32 height) const u32 buffer_offset = buffer.GetCurrentOffset(); buffer.CommitMemory(required_size); - UpdateFromBuffer(g_vulkan_context->GetCurrentCommandBuffer(), 0, 0, x, y, width, height, buffer.GetBuffer(), + UpdateFromBuffer(g_vulkan_context->GetCurrentCommandBuffer(), level, layer, x, y, width, height, buffer.GetBuffer(), buffer_offset, CalcUpdateRowLength(pitch)); } -bool Vulkan::Texture::Update(u32 x, u32 y, u32 width, u32 height, const void* data, u32 data_pitch) +bool Vulkan::Texture::Update(u32 x, u32 y, u32 width, u32 height, u32 level, u32 layer, const void* data, + u32 data_pitch) { const u32 pitch = CalcUpdatePitch(width); const u32 row_length = CalcUpdateRowLength(pitch); @@ -479,7 +480,8 @@ bool Vulkan::Texture::Update(u32 x, u32 y, u32 width, u32 height, const void* da StringUtil::StrideMemCpy(ai.pMappedData, pitch, data, data_pitch, std::min(data_pitch, pitch), height); vmaFlushAllocation(g_vulkan_context->GetAllocator(), allocation, 0, size); - UpdateFromBuffer(g_vulkan_context->GetCurrentCommandBuffer(), 0, 0, x, y, width, height, buffer, 0, row_length); + UpdateFromBuffer(g_vulkan_context->GetCurrentCommandBuffer(), level, layer, x, y, width, height, buffer, 0, + row_length); return true; } else @@ -499,8 +501,8 @@ bool Vulkan::Texture::Update(u32 x, u32 y, u32 width, u32 height, const void* da height); sbuffer.CommitMemory(required_size); - UpdateFromBuffer(g_vulkan_context->GetCurrentCommandBuffer(), 0, 0, x, y, width, height, sbuffer.GetBuffer(), - buffer_offset, row_length); + UpdateFromBuffer(g_vulkan_context->GetCurrentCommandBuffer(), level, layer, x, y, width, height, + sbuffer.GetBuffer(), buffer_offset, row_length); return true; } } diff --git a/src/common/vulkan/texture.h b/src/common/vulkan/texture.h index fdcab5f8e..5f72bd30a 100644 --- a/src/common/vulkan/texture.h +++ b/src/common/vulkan/texture.h @@ -61,8 +61,8 @@ public: u32 CalcUpdatePitch(u32 width) const; u32 CalcUpdateRowLength(u32 pitch) const; bool BeginUpdate(u32 width, u32 height, void** out_buffer, u32* out_pitch); - void EndUpdate(u32 x, u32 y, u32 width, u32 height); - bool Update(u32 x, u32 y, u32 width, u32 height, const void* data, u32 data_pitch); + void EndUpdate(u32 x, u32 y, u32 width, u32 height, u32 level, u32 layer); + bool Update(u32 x, u32 y, u32 width, u32 height, u32 level, u32 layer, const void* data, u32 data_pitch); private: u32 m_width = 0; diff --git a/src/frontend-common/imgui_impl_vulkan.cpp b/src/frontend-common/imgui_impl_vulkan.cpp index 2f89493d6..b8391a1e1 100644 --- a/src/frontend-common/imgui_impl_vulkan.cpp +++ b/src/frontend-common/imgui_impl_vulkan.cpp @@ -412,7 +412,7 @@ bool ImGui_ImplVulkan_CreateFontsTexture() } // Store our identifier - bd->FontTexture.Update(0, 0, width, height, pixels, sizeof(u32) * width); + bd->FontTexture.Update(0, 0, width, height, 0, 0, pixels, sizeof(u32) * width); io.Fonts->SetTexID((ImTextureID)&bd->FontTexture); return true; } diff --git a/src/frontend-common/vulkan_host_display.cpp b/src/frontend-common/vulkan_host_display.cpp index fa383b4a9..76b36e738 100644 --- a/src/frontend-common/vulkan_host_display.cpp +++ b/src/frontend-common/vulkan_host_display.cpp @@ -40,11 +40,11 @@ public: return m_texture.BeginUpdate(width, height, out_buffer, out_pitch); } - void EndUpdate(u32 x, u32 y, u32 width, u32 height) override { m_texture.EndUpdate(x, y, width, height); } + void EndUpdate(u32 x, u32 y, u32 width, u32 height) override { m_texture.EndUpdate(x, y, width, height, 0, 0); } bool Update(u32 x, u32 y, u32 width, u32 height, const void* data, u32 pitch) override { - return m_texture.Update(x, y, width, height, data, pitch); + return m_texture.Update(x, y, width, height, 0, 0, data, pitch); } const Vulkan::Texture& GetTexture() const { return m_texture; } @@ -203,7 +203,7 @@ std::unique_ptr VulkanHostDisplay::CreateTexture(u32 width, if (data) { - texture.Update(0, 0, width, height, data, data_stride); + texture.Update(0, 0, width, height, 0, 0, data, data_stride); } else {