Improve linear texture compatibility rules (#2099)

* Improve linear texture compatibility rules

Fixes an issue where small or width-aligned (rather than byte aligned) textures would fail to create a view of existing data. Creates a copy dependency as size change may be risky.

* Minor cleanup

* Remove Size Change for Copy Depenedencies

The copy to the target (potentially different sized) texture can properly deal with cropping by itself.

* Move StrideAlignment and GobAlignment into Constants
This commit is contained in:
riperiperi 2021-03-19 01:17:38 +00:00 committed by GitHub
parent 39899c0407
commit 9b7335a63b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 15 deletions

View file

@ -8,9 +8,6 @@ namespace Ryujinx.Graphics.Gpu.Engine
{
partial class Methods
{
private const int StrideAlignment = 32;
private const int GobAlignment = 64;
enum CopyFlags
{
SrcLinear = 1 << 7,
@ -32,14 +29,14 @@ namespace Ryujinx.Graphics.Gpu.Engine
{
if (linear)
{
int alignWidth = StrideAlignment / bpp;
int alignWidth = Constants.StrideAlignment / bpp;
return tex.RegionX == 0 &&
tex.RegionY == 0 &&
stride / bpp == BitUtils.AlignUp(cbp.XCount, alignWidth);
}
else
{
int alignWidth = GobAlignment / bpp;
int alignWidth = Constants.GobAlignment / bpp;
return tex.RegionX == 0 &&
tex.RegionY == 0 &&
tex.Width == BitUtils.AlignUp(cbp.XCount, alignWidth) &&