diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs')
| -rw-r--r-- | Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs b/Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs deleted file mode 100644 index 4f167e89..00000000 --- a/Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Ryujinx.Graphics.GAL; -using System; -using System.Collections.Generic; - -namespace Ryujinx.Graphics.OpenGL.Image -{ - class IntermediatePool : IDisposable - { - private readonly OpenGLRenderer _renderer; - private readonly List<TextureView> _entries; - - public IntermediatePool(OpenGLRenderer renderer) - { - _renderer = renderer; - _entries = new List<TextureView>(); - } - - public TextureView GetOrCreateWithAtLeast( - Target target, - int blockWidth, - int blockHeight, - int bytesPerPixel, - Format format, - int width, - int height, - int depth, - int levels, - int samples) - { - TextureView entry; - - for (int i = 0; i < _entries.Count; i++) - { - entry = _entries[i]; - - if (entry.Target == target && entry.Format == format && entry.Info.Samples == samples) - { - if (entry.Width < width || - entry.Height < height || - entry.Info.Depth < depth || - entry.Info.Levels < levels) - { - width = Math.Max(width, entry.Width); - height = Math.Max(height, entry.Height); - depth = Math.Max(depth, entry.Info.Depth); - levels = Math.Max(levels, entry.Info.Levels); - - entry.Dispose(); - entry = CreateNew(target, blockWidth, blockHeight, bytesPerPixel, format, width, height, depth, levels, samples); - _entries[i] = entry; - } - - return entry; - } - } - - entry = CreateNew(target, blockWidth, blockHeight, bytesPerPixel, format, width, height, depth, levels, samples); - _entries.Add(entry); - - return entry; - } - - private TextureView CreateNew( - Target target, - int blockWidth, - int blockHeight, - int bytesPerPixel, - Format format, - int width, - int height, - int depth, - int levels, - int samples) - { - return (TextureView)_renderer.CreateTexture(new TextureCreateInfo( - width, - height, - depth, - levels, - samples, - blockWidth, - blockHeight, - bytesPerPixel, - format, - DepthStencilMode.Depth, - target, - SwizzleComponent.Red, - SwizzleComponent.Green, - SwizzleComponent.Blue, - SwizzleComponent.Alpha), 1f); - } - - public void Dispose() - { - foreach (TextureView entry in _entries) - { - entry.Dispose(); - } - - _entries.Clear(); - } - } -}
\ No newline at end of file |
