Add missing depth-color conversions in CopyTexture (#1474)

* Add missing depth-color conversions in CopyTexture

* Whitespace

* switch expression
This commit is contained in:
mageven 2020-08-14 15:33:19 +05:30 committed by GitHub
parent 0de5367369
commit 2a314f3c28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,10 +28,16 @@ namespace Ryujinx.Graphics.Gpu.Engine
// When the source texture that was found has a depth format, // When the source texture that was found has a depth format,
// we must enforce the target texture also has a depth format, // we must enforce the target texture also has a depth format,
// as copies between depth and color formats are not allowed. // as copies between depth and color formats are not allowed.
if (srcTexture.Format == Format.D32Float) dstCopyTexture.Format = srcTexture.Format switch
{ {
dstCopyTexture.Format = RtFormat.D32Float; Format.S8Uint => RtFormat.S8Uint,
} Format.D16Unorm => RtFormat.D16Unorm,
Format.D24X8Unorm => RtFormat.D24Unorm,
Format.D32Float => RtFormat.D32Float,
Format.D24UnormS8Uint => RtFormat.D24UnormS8Uint,
Format.D32FloatS8Uint => RtFormat.D32FloatS8Uint,
_ => dstCopyTexture.Format
};
Texture dstTexture = TextureManager.FindOrCreateTexture(dstCopyTexture, srcTexture.ScaleMode == Image.TextureScaleMode.Scaled); Texture dstTexture = TextureManager.FindOrCreateTexture(dstCopyTexture, srcTexture.ScaleMode == Image.TextureScaleMode.Scaled);