Add a separate device memory manager (#6153)
* Add a separate device memory manager * Still need this * Device writes are always tracked * Device writes are always tracked (2) * Rename more instances of gmm to mm
This commit is contained in:
parent
90455a05e6
commit
f241f88558
33 changed files with 555 additions and 157 deletions
|
@ -1,5 +1,5 @@
|
|||
using Ryujinx.Common;
|
||||
using Ryujinx.Graphics.Gpu.Memory;
|
||||
using Ryujinx.Graphics.Device;
|
||||
using Ryujinx.Graphics.Texture;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System;
|
||||
|
@ -12,11 +12,11 @@ namespace Ryujinx.Graphics.Nvdec.Image
|
|||
{
|
||||
static class SurfaceWriter
|
||||
{
|
||||
public static void Write(MemoryManager gmm, ISurface surface, uint lumaOffset, uint chromaOffset)
|
||||
public static void Write(DeviceMemoryManager mm, ISurface surface, uint lumaOffset, uint chromaOffset)
|
||||
{
|
||||
int lumaSize = GetBlockLinearSize(surface.Width, surface.Height, 1);
|
||||
|
||||
using var luma = gmm.GetWritableRegion(ExtendOffset(lumaOffset), lumaSize);
|
||||
using var luma = mm.GetWritableRegion(ExtendOffset(lumaOffset), lumaSize);
|
||||
|
||||
WriteLuma(
|
||||
luma.Memory.Span,
|
||||
|
@ -27,7 +27,7 @@ namespace Ryujinx.Graphics.Nvdec.Image
|
|||
|
||||
int chromaSize = GetBlockLinearSize(surface.UvWidth, surface.UvHeight, 2);
|
||||
|
||||
using var chroma = gmm.GetWritableRegion(ExtendOffset(chromaOffset), chromaSize);
|
||||
using var chroma = mm.GetWritableRegion(ExtendOffset(chromaOffset), chromaSize);
|
||||
|
||||
WriteChroma(
|
||||
chroma.Memory.Span,
|
||||
|
@ -39,7 +39,7 @@ namespace Ryujinx.Graphics.Nvdec.Image
|
|||
}
|
||||
|
||||
public static void WriteInterlaced(
|
||||
MemoryManager gmm,
|
||||
DeviceMemoryManager mm,
|
||||
ISurface surface,
|
||||
uint lumaTopOffset,
|
||||
uint chromaTopOffset,
|
||||
|
@ -48,8 +48,8 @@ namespace Ryujinx.Graphics.Nvdec.Image
|
|||
{
|
||||
int lumaSize = GetBlockLinearSize(surface.Width, surface.Height / 2, 1);
|
||||
|
||||
using var lumaTop = gmm.GetWritableRegion(ExtendOffset(lumaTopOffset), lumaSize);
|
||||
using var lumaBottom = gmm.GetWritableRegion(ExtendOffset(lumaBottomOffset), lumaSize);
|
||||
using var lumaTop = mm.GetWritableRegion(ExtendOffset(lumaTopOffset), lumaSize);
|
||||
using var lumaBottom = mm.GetWritableRegion(ExtendOffset(lumaBottomOffset), lumaSize);
|
||||
|
||||
WriteLuma(
|
||||
lumaTop.Memory.Span,
|
||||
|
@ -67,8 +67,8 @@ namespace Ryujinx.Graphics.Nvdec.Image
|
|||
|
||||
int chromaSize = GetBlockLinearSize(surface.UvWidth, surface.UvHeight / 2, 2);
|
||||
|
||||
using var chromaTop = gmm.GetWritableRegion(ExtendOffset(chromaTopOffset), chromaSize);
|
||||
using var chromaBottom = gmm.GetWritableRegion(ExtendOffset(chromaBottomOffset), chromaSize);
|
||||
using var chromaTop = mm.GetWritableRegion(ExtendOffset(chromaTopOffset), chromaSize);
|
||||
using var chromaBottom = mm.GetWritableRegion(ExtendOffset(chromaBottomOffset), chromaSize);
|
||||
|
||||
WriteChroma(
|
||||
chromaTop.Memory.Span,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue