Vulkan/Texture: Allow uploading non-zero layers/levels

This commit is contained in:
Connor McLaughlin
2022-09-26 21:05:44 +10:00
parent aff9f1c25f
commit 8d32547ec9
4 changed files with 14 additions and 12 deletions

View File

@ -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;
}

View File

@ -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<HostDisplayTexture> 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
{