mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 10:48:36 +12:00
vk: Fix scratch allocation when doing GPU deswizzle
- We have to use double the memory because the transformation does not occur in-place like normal bswap
This commit is contained in:
parent
0aa1aff6ba
commit
ace187cdd0
1 changed files with 8 additions and 1 deletions
|
@ -969,7 +969,14 @@ namespace vk
|
|||
if (!scratch_buf)
|
||||
{
|
||||
// Calculate enough scratch memory. We need 2x the size of layer 0 to fit all the mip levels and an extra 128 bytes per level as alignment overhead.
|
||||
const auto scratch_buf_size = 128u * ::size32(subresource_layout) + image_linear_size + image_linear_size;
|
||||
auto scratch_buf_size = 128u * ::size32(subresource_layout) + image_linear_size + image_linear_size;
|
||||
if (opt.require_deswizzle)
|
||||
{
|
||||
// Double the memory if hw deswizzle is going to be used.
|
||||
// For GPU deswizzle, the memory is not transformed in-place, rather the decoded texture is placed at the end of the uploaded data.
|
||||
scratch_buf_size += scratch_buf_size;
|
||||
}
|
||||
|
||||
scratch_buf = vk::get_scratch_buffer(scratch_buf_size);
|
||||
buffer_copies.reserve(subresource_layout.size());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue