mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 08:56:24 +02:00
parent
417df486b1
commit
361d0c5632
622 changed files with 3080 additions and 2652 deletions
|
@ -84,6 +84,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
{
|
||||
Logger.Debug?.Print(LogClass.Gpu, $"{type} {severity}: {msg}", "GLDEBUG");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,14 +228,14 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
|
||||
public static bool IsPackedDepthStencil(Format format)
|
||||
{
|
||||
return format == Format.D24UnormS8Uint ||
|
||||
format == Format.D32FloatS8Uint ||
|
||||
format == Format.S8UintD24Unorm;
|
||||
return format is Format.D24UnormS8Uint or
|
||||
Format.D32FloatS8Uint or
|
||||
Format.S8UintD24Unorm;
|
||||
}
|
||||
|
||||
public static bool IsDepthOnly(Format format)
|
||||
{
|
||||
return format == Format.D16Unorm || format == Format.D32Float || format == Format.X8UintD24Unorm;
|
||||
return format is Format.D16Unorm or Format.D32Float or Format.X8UintD24Unorm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,13 +43,13 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
|
||||
private static readonly Lazy<GpuVendor> _gpuVendor = new(GetGpuVendor);
|
||||
|
||||
private static bool IsIntel => _gpuVendor.Value == GpuVendor.IntelWindows || _gpuVendor.Value == GpuVendor.IntelUnix;
|
||||
private static bool IsIntel => _gpuVendor.Value is GpuVendor.IntelWindows or GpuVendor.IntelUnix;
|
||||
|
||||
public static GpuVendor Vendor => _gpuVendor.Value;
|
||||
|
||||
private static readonly Lazy<float> _maxSupportedAnisotropy = new(GL.GetFloat((GetPName)All.MaxTextureMaxAnisotropy));
|
||||
|
||||
public static bool UsePersistentBufferForFlush => _gpuVendor.Value == GpuVendor.AmdWindows || _gpuVendor.Value == GpuVendor.Nvidia;
|
||||
public static bool UsePersistentBufferForFlush => _gpuVendor.Value is GpuVendor.AmdWindows or GpuVendor.Nvidia;
|
||||
|
||||
public static bool SupportsAlphaToCoverageDitherControl => _supportsAlphaToCoverageDitherControl.Value;
|
||||
public static bool SupportsAstcCompression => _supportsAstcCompression.Value;
|
||||
|
@ -73,7 +73,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
public static bool SupportsTextureShadowLod => _supportsTextureShadowLod.Value;
|
||||
public static bool SupportsViewportSwizzle => _supportsViewportSwizzle.Value;
|
||||
|
||||
public static bool SupportsMismatchingViewFormat => _gpuVendor.Value != GpuVendor.AmdWindows && _gpuVendor.Value != GpuVendor.IntelWindows;
|
||||
public static bool SupportsMismatchingViewFormat => _gpuVendor.Value is not GpuVendor.AmdWindows and not GpuVendor.IntelWindows;
|
||||
public static bool SupportsNonConstantTextureOffset => _gpuVendor.Value == GpuVendor.Nvidia;
|
||||
public static bool RequiresSyncFlush => _gpuVendor.Value == GpuVendor.AmdWindows || IsIntel;
|
||||
|
||||
|
@ -117,11 +117,11 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
|
||||
return renderer.Contains("mesa") ? GpuVendor.IntelUnix : GpuVendor.IntelWindows;
|
||||
}
|
||||
else if (vendor == "ati technologies inc." || vendor == "advanced micro devices, inc.")
|
||||
else if (vendor is "ati technologies inc." or "advanced micro devices, inc.")
|
||||
{
|
||||
return GpuVendor.AmdWindows;
|
||||
}
|
||||
else if (vendor == "amd" || vendor == "x.org")
|
||||
else if (vendor is "amd" or "x.org")
|
||||
{
|
||||
return GpuVendor.AmdUnix;
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
|
||||
private static FramebufferAttachment AttachmentForFormat(Format format)
|
||||
{
|
||||
if (format == Format.D24UnormS8Uint || format == Format.D32FloatS8Uint)
|
||||
if (format is Format.D24UnormS8Uint or Format.D32FloatS8Uint)
|
||||
{
|
||||
return FramebufferAttachment.DepthStencilAttachment;
|
||||
}
|
||||
|
|
|
@ -358,7 +358,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
PixelFormat pixelFormat = format.PixelFormat;
|
||||
PixelType pixelType = format.PixelType;
|
||||
|
||||
if (target == TextureTarget.TextureCubeMap || target == TextureTarget.TextureCubeMapArray)
|
||||
if (target is TextureTarget.TextureCubeMap or TextureTarget.TextureCubeMapArray)
|
||||
{
|
||||
target = TextureTarget.TextureCubeMapPositiveX + (layer % 6);
|
||||
}
|
||||
|
@ -568,6 +568,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Target.Texture1DArray:
|
||||
|
@ -597,6 +598,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Target.Texture2D:
|
||||
|
@ -626,6 +628,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Target.Texture2DArray:
|
||||
|
@ -661,6 +664,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Target.Cubemap:
|
||||
|
@ -690,6 +694,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -756,6 +761,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Target.Texture1DArray:
|
||||
|
@ -786,6 +792,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Target.Texture2DArray:
|
||||
|
@ -821,6 +828,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
format.PixelType,
|
||||
data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Target.Cubemap:
|
||||
|
@ -855,6 +863,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
data + faceOffset);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
|||
long defaultValue = DefaultValue;
|
||||
GL.BufferStorage(BufferTarget.QueryBuffer, sizeof(long), (nint)(&defaultValue), BufferStorageFlags.MapReadBit | BufferStorageFlags.MapWriteBit | BufferStorageFlags.MapPersistentBit);
|
||||
}
|
||||
|
||||
_bufferMap = GL.MapBufferRange(BufferTarget.QueryBuffer, nint.Zero, sizeof(long), BufferAccessMask.MapReadBit | BufferAccessMask.MapWriteBit | BufferAccessMask.MapPersistentBit);
|
||||
}
|
||||
|
||||
|
|
|
@ -172,6 +172,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
|||
{
|
||||
return; // If not blocking, then return when we encounter an event that is not ready yet.
|
||||
}
|
||||
|
||||
_events.Dequeue();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,6 +108,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
texture.View.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
_textures.Clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
Handle = GL.FenceSync(SyncCondition.SyncGpuCommandsComplete, WaitSyncFlags.None),
|
||||
};
|
||||
|
||||
|
||||
if (HwCapabilities.RequiresSyncFlush)
|
||||
{
|
||||
// Force commands to flush up to the syncpoint.
|
||||
|
|
|
@ -104,8 +104,8 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
int offset = attrib.Offset;
|
||||
int size = fmtInfo.Components;
|
||||
|
||||
bool isFloat = fmtInfo.PixelType == PixelType.Float ||
|
||||
fmtInfo.PixelType == PixelType.HalfFloat;
|
||||
bool isFloat = fmtInfo.PixelType is PixelType.Float or
|
||||
PixelType.HalfFloat;
|
||||
|
||||
if (isFloat || fmtInfo.Normalized || fmtInfo.Scaled)
|
||||
{
|
||||
|
|
|
@ -340,6 +340,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
_antiAliasing?.Dispose();
|
||||
_antiAliasing = new SmaaPostProcessingEffect(_renderer, quality);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -371,6 +372,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
_scalingFilter?.Dispose();
|
||||
_scalingFilter = new FsrScalingFilter(_renderer);
|
||||
}
|
||||
|
||||
_isLinear = false;
|
||||
_scalingFilter.Level = _scalingFilterLevel;
|
||||
|
||||
|
@ -382,6 +384,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
_scalingFilter?.Dispose();
|
||||
_scalingFilter = new AreaScalingFilter(_renderer);
|
||||
}
|
||||
|
||||
_isLinear = false;
|
||||
|
||||
RecreateUpscalingTexture();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue