aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Image/Sampler.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Graphics.OpenGL/Image/Sampler.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Image/Sampler.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Image/Sampler.cs64
1 files changed, 0 insertions, 64 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Image/Sampler.cs b/Ryujinx.Graphics.OpenGL/Image/Sampler.cs
deleted file mode 100644
index f705aa3e..00000000
--- a/Ryujinx.Graphics.OpenGL/Image/Sampler.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using OpenTK.Graphics.OpenGL;
-using Ryujinx.Graphics.GAL;
-
-namespace Ryujinx.Graphics.OpenGL.Image
-{
- class Sampler : ISampler
- {
- public int Handle { get; private set; }
-
- public Sampler(SamplerCreateInfo info)
- {
- Handle = GL.GenSampler();
-
- GL.SamplerParameter(Handle, SamplerParameterName.TextureMinFilter, (int)info.MinFilter.Convert());
- GL.SamplerParameter(Handle, SamplerParameterName.TextureMagFilter, (int)info.MagFilter.Convert());
-
- if (HwCapabilities.SupportsSeamlessCubemapPerTexture)
- {
- GL.SamplerParameter(Handle, (SamplerParameterName)ArbSeamlessCubemapPerTexture.TextureCubeMapSeamless, info.SeamlessCubemap ? 1 : 0);
- }
-
- GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapS, (int)info.AddressU.Convert());
- GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapT, (int)info.AddressV.Convert());
- GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapR, (int)info.AddressP.Convert());
-
- GL.SamplerParameter(Handle, SamplerParameterName.TextureCompareMode, (int)info.CompareMode.Convert());
- GL.SamplerParameter(Handle, SamplerParameterName.TextureCompareFunc, (int)info.CompareOp.Convert());
-
- unsafe
- {
- float* borderColor = stackalloc float[4]
- {
- info.BorderColor.Red,
- info.BorderColor.Green,
- info.BorderColor.Blue,
- info.BorderColor.Alpha
- };
-
- GL.SamplerParameter(Handle, SamplerParameterName.TextureBorderColor, borderColor);
- }
-
- GL.SamplerParameter(Handle, SamplerParameterName.TextureMinLod, info.MinLod);
- GL.SamplerParameter(Handle, SamplerParameterName.TextureMaxLod, info.MaxLod);
- GL.SamplerParameter(Handle, SamplerParameterName.TextureLodBias, info.MipLodBias);
-
- GL.SamplerParameter(Handle, SamplerParameterName.TextureMaxAnisotropyExt, info.MaxAnisotropy);
- }
-
- public void Bind(int unit)
- {
- GL.BindSampler(unit, Handle);
- }
-
- public void Dispose()
- {
- if (Handle != 0)
- {
- GL.DeleteSampler(Handle);
-
- Handle = 0;
- }
- }
- }
-}