mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-08-19 15:18:43 +02:00
* PBO single layer copy, part 1 Still needs ability to take and set width/height slices. (using pack paramaters) * PBO Copies pt 2 * Some fixes and cleanup. * Misc Cleanup * Move handle into the TextureInfo interface. This interface is shared between texture storages and views. * Move unscaled copy to the TextureCopy class. * Address feedback.
39 lines
950 B
C#
39 lines
950 B
C#
using OpenTK.Graphics.OpenGL;
|
|
using Ryujinx.Graphics.GAL;
|
|
|
|
namespace Ryujinx.Graphics.OpenGL.Image
|
|
{
|
|
class TextureBase : ITextureInfo
|
|
{
|
|
public int Handle { get; protected set; }
|
|
|
|
public TextureCreateInfo Info { get; }
|
|
|
|
public int Width => Info.Width;
|
|
public int Height => Info.Height;
|
|
public float ScaleFactor { get; }
|
|
|
|
public Target Target => Info.Target;
|
|
public Format Format => Info.Format;
|
|
|
|
public TextureBase(TextureCreateInfo info, float scaleFactor = 1f)
|
|
{
|
|
Info = info;
|
|
ScaleFactor = scaleFactor;
|
|
|
|
Handle = GL.GenTexture();
|
|
}
|
|
|
|
public void Bind(int unit)
|
|
{
|
|
Bind(Target.Convert(), unit);
|
|
}
|
|
|
|
protected void Bind(TextureTarget target, int unit)
|
|
{
|
|
GL.ActiveTexture(TextureUnit.Texture0 + unit);
|
|
GL.BindTexture(target, Handle);
|
|
}
|
|
}
|
|
}
|