Fast path for Inline-to-Memory texture data transfers (#3610)

* Fast path for Inline-to-Memory texture data transfers

* Only do it for block linear textures to be on the safe side
This commit is contained in:
gdkchan 2022-08-25 23:16:41 -03:00 committed by GitHub
parent d9aa15eb24
commit 923089a298
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 196 additions and 31 deletions

View file

@ -761,6 +761,24 @@ namespace Ryujinx.Graphics.Gpu.Image
_hasData = true;
}
/// <summary>
/// Uploads new texture data to the host GPU for a specific layer/level and 2D sub-region.
/// </summary>
/// <param name="data">New data</param>
/// <param name="layer">Target layer</param>
/// <param name="level">Target level</param>
/// <param name="region">Target sub-region of the texture to update</param>
public void SetData(ReadOnlySpan<byte> data, int layer, int level, Rectangle<int> region)
{
BlacklistScale();
HostTexture.SetData(data, layer, level, region);
_currentData = null;
_hasData = true;
}
/// <summary>
/// Converts texture data to a format and layout that is supported by the host GPU.
/// </summary>