Improved and simplified window texture presentation

This commit is contained in:
gdk 2019-11-23 23:24:03 -03:00 committed by Thog
parent b2b2e04669
commit 16d88c21fc
11 changed files with 137 additions and 497 deletions

View file

@ -1,9 +1,6 @@
using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.GAL.Texture;
using Ryujinx.Graphics.Gpu.Engine;
using Ryujinx.Graphics.Gpu.Image;
using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.Graphics.Gpu.State;
using System;
namespace Ryujinx.Graphics.Gpu
@ -24,6 +21,8 @@ namespace Ryujinx.Graphics.Gpu
public DmaPusher DmaPusher { get; }
public Window Window { get; }
internal int SequenceNumber { get; private set; }
private Lazy<Capabilities> _caps;
@ -44,6 +43,8 @@ namespace Ryujinx.Graphics.Gpu
DmaPusher = new DmaPusher(this);
Window = new Window(this);
_caps = new Lazy<Capabilities>(GetCapabilities);
}
@ -52,37 +53,6 @@ namespace Ryujinx.Graphics.Gpu
SequenceNumber++;
}
public ITexture GetTexture(
ulong address,
int width,
int height,
int stride,
bool isLinear,
int gobBlocksInY,
Format format,
int bytesPerPixel)
{
FormatInfo formatInfo = new FormatInfo(format, 1, 1, bytesPerPixel);
TextureInfo info = new TextureInfo(
address,
width,
height,
1,
1,
1,
1,
stride,
isLinear,
gobBlocksInY,
1,
1,
Target.Texture2D,
formatInfo);
return Methods.GetTexture(address)?.HostTexture;
}
private Capabilities GetCapabilities()
{
return Renderer.GetCapabilities();