mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-08 01:00:11 +00:00
vk: Fixup for RCB/RDB in special cases
- Images must be in TRANSFER_DST_OPTIMAL or GENERAL layouts to call the image upload routines.
This commit is contained in:
parent
be0e4e9879
commit
08f3460365
1 changed files with 8 additions and 0 deletions
|
@ -258,6 +258,9 @@ namespace vk
|
||||||
vk::image* content = nullptr;
|
vk::image* content = nullptr;
|
||||||
vk::image* final_dst = (samples() > 1) ? get_resolve_target_safe(cmd) : this;
|
vk::image* final_dst = (samples() > 1) ? get_resolve_target_safe(cmd) : this;
|
||||||
|
|
||||||
|
// Prepare dst image
|
||||||
|
final_dst->push_layout(cmd, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
|
||||||
|
|
||||||
if (final_dst->width() == subres.width_in_block && final_dst->height() == subres.height_in_block)
|
if (final_dst->width() == subres.width_in_block && final_dst->height() == subres.height_in_block)
|
||||||
{
|
{
|
||||||
// Possible if MSAA is enabled with 100% resolution scale or
|
// Possible if MSAA is enabled with 100% resolution scale or
|
||||||
|
@ -277,12 +280,17 @@ namespace vk
|
||||||
// Write into final image
|
// Write into final image
|
||||||
if (content != final_dst)
|
if (content != final_dst)
|
||||||
{
|
{
|
||||||
|
// Avoid layout push/pop on scratch memory by setting explicit layout here
|
||||||
|
content->change_layout(cmd, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
|
||||||
|
|
||||||
vk::copy_scaled_image(cmd, content->value, final_dst->value, content->current_layout, final_dst->current_layout,
|
vk::copy_scaled_image(cmd, content->value, final_dst->value, content->current_layout, final_dst->current_layout,
|
||||||
{ 0, 0, subres.width_in_block, subres.height_in_block }, { 0, 0, static_cast<s32>(final_dst->width()), static_cast<s32>(final_dst->height()) },
|
{ 0, 0, subres.width_in_block, subres.height_in_block }, { 0, 0, static_cast<s32>(final_dst->width()), static_cast<s32>(final_dst->height()) },
|
||||||
1, aspect(), true, aspect() == VK_IMAGE_ASPECT_COLOR_BIT ? VK_FILTER_LINEAR : VK_FILTER_NEAREST,
|
1, aspect(), true, aspect() == VK_IMAGE_ASPECT_COLOR_BIT ? VK_FILTER_LINEAR : VK_FILTER_NEAREST,
|
||||||
format(), format());
|
format(), format());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final_dst->pop_layout(cmd);
|
||||||
|
|
||||||
if (samples() > 1)
|
if (samples() > 1)
|
||||||
{
|
{
|
||||||
// Trigger unresolve
|
// Trigger unresolve
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue