Multisampling: Use resolve if src samples count > dst samples count

This commit is contained in:
gdk 2022-02-20 19:00:06 -03:00 committed by riperiperi
parent 6810796638
commit 5efe0167ea
2 changed files with 13 additions and 3 deletions

View file

@ -316,9 +316,18 @@ namespace Ryujinx.Graphics.Vulkan
var extent = new Extent3D((uint)copyWidth, (uint)copyHeight, (uint)srcDepth);
var region = new ImageCopy(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent);
if (srcInfo.Samples > 1 && srcInfo.Samples != dstInfo.Samples)
{
var region = new ImageResolve(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent);
api.CmdCopyImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region);
api.CmdResolveImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region);
}
else
{
var region = new ImageCopy(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent);
api.CmdCopyImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region);
}
width = Math.Max(1, width >> 1);
height = Math.Max(1, height >> 1);

View file

@ -266,7 +266,8 @@ namespace Ryujinx.Graphics.Vulkan
dstRegion.Y2 == dst.Height &&
src.Width == dst.Width &&
src.Height == dst.Height &&
src.VkFormat == dst.VkFormat)
src.VkFormat == dst.VkFormat &&
src.Info.Samples == 1)
{
TextureCopy.Copy(
_gd.Api,