mirror of https://github.com/PCSX2/pcsx2.git
VulkanHostDisplay: Fix uploading unaligned texture sizes
This commit is contained in:
parent
fa3bd58b7f
commit
f536584d7a
|
@ -195,8 +195,8 @@ std::string VulkanHostDisplay::GetDriverInfo() const
|
|||
static bool UploadBufferToTexture(
|
||||
Vulkan::Texture* texture, VkCommandBuffer cmdbuf, u32 width, u32 height, const void* data, u32 data_stride)
|
||||
{
|
||||
const u32 upload_stride = Common::AlignUpPow2(Vulkan::Util::GetTexelSize(texture->GetFormat()) * width,
|
||||
g_vulkan_context->GetBufferCopyRowPitchAlignment());
|
||||
const u32 texel_size = Vulkan::Util::GetTexelSize(texture->GetFormat());
|
||||
const u32 upload_stride = Common::AlignUpPow2(texel_size * width, g_vulkan_context->GetBufferCopyRowPitchAlignment());
|
||||
const u32 upload_size = upload_stride * height;
|
||||
|
||||
Vulkan::StreamBuffer& buf = g_vulkan_context->GetTextureUploadBuffer();
|
||||
|
@ -216,7 +216,7 @@ static bool UploadBufferToTexture(
|
|||
StringUtil::StrideMemCpy(buf.GetCurrentHostPointer(), upload_stride, data, data_stride, upload_stride, height);
|
||||
buf.CommitMemory(upload_size);
|
||||
|
||||
texture->UpdateFromBuffer(cmdbuf, 0, 0, 0, 0, width, height, width, buf.GetBuffer(), buf_offset);
|
||||
texture->UpdateFromBuffer(cmdbuf, 0, 0, 0, 0, width, height, upload_stride / texel_size, buf.GetBuffer(), buf_offset);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue