Revert PRs 7226(1.1.1385), 7311(1.1.1392), and 7312 (1.1.1396).

* "Vulkan: Feedback loop detection and barriers (#7226)"

* "Change image format view handling to allow view incompatible formats (#7311)"

* "Add support for sampler sRGB disable (#7312)"

* These changes prevent slowdowns in several areas in Paper Mario: The Thousand Year Door, possibly other games.
This commit is contained in:
KeatonTheBot 2024-10-11 14:36:39 -05:00
parent a2c0035013
commit 02a5f75fab
49 changed files with 358 additions and 879 deletions

View file

@ -1,5 +1,6 @@
using OpenTK.Graphics.OpenGL;
using Ryujinx.Graphics.GAL;
using System;
namespace Ryujinx.Graphics.OpenGL.Image
{
@ -18,6 +19,14 @@ 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++)
@ -27,7 +36,6 @@ namespace Ryujinx.Graphics.OpenGL.Image
if (image is TextureBase imageBase)
{
_images[index + i].Handle = imageBase.Handle;
_images[index + i].Format = imageBase.Format;
}
else
{

View file

@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.OpenGL
private readonly Vector4<int>[] _fpIsBgra = new Vector4<int>[SupportBuffer.FragmentIsBgraCount];
private readonly TextureBase[] _images;
private readonly (TextureBase, Format)[] _images;
private TextureBase _unit0Texture;
private Sampler _unit0Sampler;
@ -78,7 +78,7 @@ namespace Ryujinx.Graphics.OpenGL
_fragmentOutputMap = uint.MaxValue;
_componentMasks = uint.MaxValue;
_images = new TextureBase[SavedImages];
_images = new (TextureBase, Format)[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)
public void SetImage(ShaderStage stage, int binding, ITexture texture, Format imageFormat)
{
if ((uint)binding < SavedImages)
{
_images[binding] = texture as TextureBase;
_images[binding] = (texture as TextureBase, imageFormat);
}
if (texture == null)
@ -950,7 +950,7 @@ namespace Ryujinx.Graphics.OpenGL
TextureBase texBase = (TextureBase)texture;
SizedInternalFormat format = FormatTable.GetImageFormat(texBase.Format);
SizedInternalFormat format = FormatTable.GetImageFormat(imageFormat);
if (format != 0)
{
@ -1622,11 +1622,11 @@ namespace Ryujinx.Graphics.OpenGL
{
for (int i = 0; i < SavedImages; i++)
{
TextureBase texBase = _images[i];
(TextureBase texBase, Format imageFormat) = _images[i];
if (texBase != null)
{
SizedInternalFormat format = FormatTable.GetImageFormat(texBase.Format);
SizedInternalFormat format = FormatTable.GetImageFormat(imageFormat);
if (format != 0)
{