Flush buffers and texture data through a persistent mapped buffer. (#2481)
* Use persistent buffers to flush texture data * Flush buffers via copy to persistent buffers. * Log error when timing out, small refactoring.
This commit is contained in:
parent
bb6fab2009
commit
ca5ac37cd6
5 changed files with 135 additions and 23 deletions
|
@ -358,7 +358,7 @@ namespace Ryujinx.Graphics.Texture
|
|||
};
|
||||
}
|
||||
|
||||
public static Span<byte> ConvertLinearToBlockLinear(
|
||||
public static ReadOnlySpan<byte> ConvertLinearToBlockLinear(
|
||||
int width,
|
||||
int height,
|
||||
int depth,
|
||||
|
@ -499,7 +499,7 @@ namespace Ryujinx.Graphics.Texture
|
|||
return output;
|
||||
}
|
||||
|
||||
public static Span<byte> ConvertLinearToLinearStrided(
|
||||
public static ReadOnlySpan<byte> ConvertLinearToLinearStrided(
|
||||
int width,
|
||||
int height,
|
||||
int blockWidth,
|
||||
|
@ -514,6 +514,11 @@ namespace Ryujinx.Graphics.Texture
|
|||
int inStride = BitUtils.AlignUp(w * bytesPerPixel, HostStrideAlignment);
|
||||
int lineSize = width * bytesPerPixel;
|
||||
|
||||
if (inStride == stride)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
Span<byte> output = new byte[h * stride];
|
||||
|
||||
int inOffs = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue