mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-14 06:33:15 +00:00
Fix image extent in buffer copy to image (#2961)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This commit is contained in:
parent
f9bbde9c79
commit
e518a7062c
1 changed files with 9 additions and 3 deletions
|
@ -538,10 +538,16 @@ void TextureCache::RefreshImage(Image& image, Vulkan::Scheduler* custom_schedule
|
||||||
image.mip_hashes[m] = hash;
|
image.mip_hashes[m] = hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto mip_pitch = static_cast<u32>(mip.pitch);
|
||||||
|
auto mip_height = static_cast<u32>(mip.height);
|
||||||
|
|
||||||
|
auto image_extent_width = mip_pitch ? std::min(mip_pitch, width) : width;
|
||||||
|
auto image_extent_height = mip_height ? std::min(mip_height, height) : height;
|
||||||
|
|
||||||
image_copy.push_back({
|
image_copy.push_back({
|
||||||
.bufferOffset = mip.offset,
|
.bufferOffset = mip.offset,
|
||||||
.bufferRowLength = static_cast<u32>(mip.pitch),
|
.bufferRowLength = mip_pitch,
|
||||||
.bufferImageHeight = static_cast<u32>(mip.height),
|
.bufferImageHeight = mip_height,
|
||||||
.imageSubresource{
|
.imageSubresource{
|
||||||
.aspectMask = image.aspect_mask & ~vk::ImageAspectFlagBits::eStencil,
|
.aspectMask = image.aspect_mask & ~vk::ImageAspectFlagBits::eStencil,
|
||||||
.mipLevel = m,
|
.mipLevel = m,
|
||||||
|
@ -549,7 +555,7 @@ void TextureCache::RefreshImage(Image& image, Vulkan::Scheduler* custom_schedule
|
||||||
.layerCount = num_layers,
|
.layerCount = num_layers,
|
||||||
},
|
},
|
||||||
.imageOffset = {0, 0, 0},
|
.imageOffset = {0, 0, 0},
|
||||||
.imageExtent = {width, height, depth},
|
.imageExtent = {image_extent_width, image_extent_height, depth},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue