Support safe blit on non-2D textures (#4374)

* Support safe blit on non-2D textures (except multisample)

* Change safe blit with different levels and layers to match CmdBlitImage path

* Remove now unused variables

* Multisample safe blit support
This commit is contained in:
gdkchan 2023-02-07 13:55:59 -03:00 committed by GitHub
parent cb250162cb
commit f8beeeb7d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 436 additions and 74 deletions

View file

@ -368,20 +368,16 @@ namespace Ryujinx.Graphics.Vulkan
bool isDepthOrStencil = dst.Info.Format.IsDepthOrStencil();
if (VulkanConfiguration.UseSlowSafeBlitOnAmd &&
(_gd.Vendor == Vendor.Amd || _gd.IsMoltenVk) &&
src.Info.Target == Target.Texture2D &&
dst.Info.Target == Target.Texture2D)
if (VulkanConfiguration.UseSlowSafeBlitOnAmd && (_gd.Vendor == Vendor.Amd || _gd.IsMoltenVk))
{
_gd.HelperShader.Blit(
_gd,
src,
dst.GetIdentityImageView(),
dst.Width,
dst.Height,
dst.VkFormat,
dst,
srcRegion,
dstRegion,
layers,
levels,
isDepthOrStencil,
linearFilter);
@ -501,7 +497,7 @@ namespace Ryujinx.Graphics.Vulkan
return CreateViewImpl(info, firstLayer, firstLevel);
}
private TextureView CreateViewImpl(TextureCreateInfo info, int firstLayer, int firstLevel)
public TextureView CreateViewImpl(TextureCreateInfo info, int firstLayer, int firstLevel)
{
return new TextureView(_gd, _device, info, Storage, FirstLayer + firstLayer, FirstLevel + firstLevel);
}