Size hints for copy regions and viewport dimensions to avoid data loss (#1686)

* Size hints for copy regions and viewport dimensions to avoid data loss

* Reword comment.

* Use info for the rule rather than calculating aligned size.

* Reorder min/max, remove spaces
This commit is contained in:
riperiperi 2020-11-10 00:41:13 +00:00 committed by GitHub
parent c3d62bd078
commit 02872833b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 111 additions and 45 deletions

View file

@ -50,6 +50,12 @@ namespace Ryujinx.Graphics.Gpu.Image
/// </summary>
public bool IsModified { get; internal set; }
/// <summary>
/// Set when a texture has been changed size. This indicates that it may need to be
/// changed again when obtained as a sampler.
/// </summary>
public bool ChangedSize { get; internal set; }
private int _depth;
private int _layers;
private int _firstLayer;
@ -353,6 +359,8 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <param name="depthOrLayers">The new texture depth (for 3D textures) or layers (for layered textures)</param>
private void RecreateStorageOrView(int width, int height, int depthOrLayers)
{
ChangedSize = true;
SetInfo(new TextureInfo(
Info.Address,
width,