aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.OpenGL
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-09-17 15:52:30 -0300
committerGitHub <noreply@github.com>2024-09-17 15:52:30 -0300
commiteb8132b627d3c0285dd199f4e40c6f3800bdb22d (patch)
tree970a119909a0dd901bbd8cb5454b725a08e329b3 /src/Ryujinx.Graphics.OpenGL
parentccf96bf5e673456ec80f72725e4c9afa4e4c5a85 (diff)
Change image format view handling to allow view incompatible formats (#7311)
* Allow creating texture aliases on texture pool * Delete old image format override code * New format incompatible alias * Missing bounds check * GetForBinding now takes FormatInfo * Make FormatInfo struct more compact
Diffstat (limited to 'src/Ryujinx.Graphics.OpenGL')
-rw-r--r--src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs10
-rw-r--r--src/Ryujinx.Graphics.OpenGL/Pipeline.cs14
2 files changed, 8 insertions, 16 deletions
diff --git a/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs b/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs
index 6198823d..3486f29d 100644
--- a/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs
+++ b/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs
@@ -1,6 +1,5 @@
using OpenTK.Graphics.OpenGL;
using Ryujinx.Graphics.GAL;
-using System;
namespace Ryujinx.Graphics.OpenGL.Image
{
@@ -19,14 +18,6 @@ namespace Ryujinx.Graphics.OpenGL.Image
_images = new TextureRef[size];
}
- public void SetFormats(int index, GAL.Format[] imageFormats)
- {
- for (int i = 0; i < imageFormats.Length; i++)
- {
- _images[index + i].Format = imageFormats[i];
- }
- }
-
public void SetImages(int index, ITexture[] images)
{
for (int i = 0; i < images.Length; i++)
@@ -36,6 +27,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
if (image is TextureBase imageBase)
{
_images[index + i].Handle = imageBase.Handle;
+ _images[index + i].Format = imageBase.Format;
}
else
{
diff --git a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs
index 54f6b3f7..27aacac1 100644
--- a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs
+++ b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs
@@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.OpenGL
private readonly Vector4<int>[] _fpIsBgra = new Vector4<int>[SupportBuffer.FragmentIsBgraCount];
- private readonly (TextureBase, Format)[] _images;
+ private readonly TextureBase[] _images;
private TextureBase _unit0Texture;
private Sampler _unit0Sampler;
@@ -78,7 +78,7 @@ namespace Ryujinx.Graphics.OpenGL
_fragmentOutputMap = uint.MaxValue;
_componentMasks = uint.MaxValue;
- _images = new (TextureBase, Format)[SavedImages];
+ _images = new TextureBase[SavedImages];
_tfbs = new BufferHandle[Constants.MaxTransformFeedbackBuffers];
_tfbTargets = new BufferRange[Constants.MaxTransformFeedbackBuffers];
@@ -935,11 +935,11 @@ namespace Ryujinx.Graphics.OpenGL
SetFrontFace(_frontFace = frontFace.Convert());
}
- public void SetImage(ShaderStage stage, int binding, ITexture texture, Format imageFormat)
+ public void SetImage(ShaderStage stage, int binding, ITexture texture)
{
if ((uint)binding < SavedImages)
{
- _images[binding] = (texture as TextureBase, imageFormat);
+ _images[binding] = texture as TextureBase;
}
if (texture == null)
@@ -950,7 +950,7 @@ namespace Ryujinx.Graphics.OpenGL
TextureBase texBase = (TextureBase)texture;
- SizedInternalFormat format = FormatTable.GetImageFormat(imageFormat);
+ SizedInternalFormat format = FormatTable.GetImageFormat(texBase.Format);
if (format != 0)
{
@@ -1622,11 +1622,11 @@ namespace Ryujinx.Graphics.OpenGL
{
for (int i = 0; i < SavedImages; i++)
{
- (TextureBase texBase, Format imageFormat) = _images[i];
+ TextureBase texBase = _images[i];
if (texBase != null)
{
- SizedInternalFormat format = FormatTable.GetImageFormat(imageFormat);
+ SizedInternalFormat format = FormatTable.GetImageFormat(texBase.Format);
if (format != 0)
{