mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-12 21:59:12 +00:00
Format style
This commit is contained in:
parent
419d61ef23
commit
29f3df5bd8
14 changed files with 23 additions and 27 deletions
|
@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||||
{
|
{
|
||||||
struct RegisterBindlessSamplerCommand : IGALCommand, IGALCommand<RegisterBindlessSamplerCommand>
|
struct RegisterBindlessSamplerCommand : IGALCommand, IGALCommand<RegisterBindlessSamplerCommand>
|
||||||
{
|
{
|
||||||
public CommandType CommandType => CommandType.RegisterBindlessSampler;
|
public readonly CommandType CommandType => CommandType.RegisterBindlessSampler;
|
||||||
private int _samplerId;
|
private int _samplerId;
|
||||||
private TableRef<ISampler> _sampler;
|
private TableRef<ISampler> _sampler;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||||
{
|
{
|
||||||
struct RegisterBindlessTextureAndSamplerCommand : IGALCommand, IGALCommand<RegisterBindlessTextureAndSamplerCommand>
|
struct RegisterBindlessTextureAndSamplerCommand : IGALCommand, IGALCommand<RegisterBindlessTextureAndSamplerCommand>
|
||||||
{
|
{
|
||||||
public CommandType CommandType => CommandType.RegisterBindlessTextureAndSampler;
|
public readonly CommandType CommandType => CommandType.RegisterBindlessTextureAndSampler;
|
||||||
private int _textureId;
|
private int _textureId;
|
||||||
private int _samplerId;
|
private int _samplerId;
|
||||||
private TableRef<ITexture> _texture;
|
private TableRef<ITexture> _texture;
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||||
{
|
{
|
||||||
struct RegisterBindlessTextureCommand : IGALCommand, IGALCommand<RegisterBindlessTextureCommand>
|
struct RegisterBindlessTextureCommand : IGALCommand, IGALCommand<RegisterBindlessTextureCommand>
|
||||||
{
|
{
|
||||||
public CommandType CommandType => CommandType.RegisterBindlessTexture;
|
public readonly CommandType CommandType => CommandType.RegisterBindlessTexture;
|
||||||
private int _textureId;
|
private int _textureId;
|
||||||
private TableRef<ITexture> _texture;
|
private TableRef<ITexture> _texture;
|
||||||
private float _textureScale;
|
private float _textureScale;
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
/// Unpacks the font filter width.
|
/// Unpacks the font filter width.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Font filter width</returns>
|
/// <returns>Font filter width</returns>
|
||||||
public int UnpackFontFilterWidth()
|
public readonly int UnpackFontFilterWidth()
|
||||||
{
|
{
|
||||||
return (int)(Word0 >> 14) & 7;
|
return (int)(Word0 >> 14) & 7;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
/// Unpacks the font filter height.
|
/// Unpacks the font filter height.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Font filter height</returns>
|
/// <returns>Font filter height</returns>
|
||||||
public int UnpackFontFilterHeight()
|
public readonly int UnpackFontFilterHeight()
|
||||||
{
|
{
|
||||||
return (int)(Word0 >> 17) & 7;
|
return (int)(Word0 >> 17) & 7;
|
||||||
}
|
}
|
||||||
|
|
|
@ -813,7 +813,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
// Ensure that the buffer texture is using the correct buffer as storage.
|
// Ensure that the buffer texture is using the correct buffer as storage.
|
||||||
// Buffers are frequently re-created to accomodate larger data, so we need to re-bind
|
// Buffers are frequently re-created to accomodate larger data, so we need to re-bind
|
||||||
// to ensure we're not using a old buffer that was already deleted.
|
// to ensure we're not using a old buffer that was already deleted.
|
||||||
TextureBindingInfo bindingInfo = new TextureBindingInfo(texture.Target, texture.Format, 0, 0, 0, TextureUsageFlags.None);
|
TextureBindingInfo bindingInfo = new(texture.Target, texture.Format, 0, 0, 0, TextureUsageFlags.None);
|
||||||
ulong address = texture.Range.GetSubRange(0).Address;
|
ulong address = texture.Range.GetSubRange(0).Address;
|
||||||
ulong size = texture.Size;
|
ulong size = texture.Size;
|
||||||
_channel.BufferManager.SetBufferTextureStorage(texture.HostTexture, address, size, bindingInfo, texture.Format, false, textureId);
|
_channel.BufferManager.SetBufferTextureStorage(texture.HostTexture, address, size, bindingInfo, texture.Format, false, textureId);
|
||||||
|
|
|
@ -275,7 +275,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureInfo info = GetInfo(descriptor, out int layerSize);
|
TextureInfo info = GetInfo(descriptor, out _);
|
||||||
TextureValidationResult validationResult = TextureValidation.Validate(ref info);
|
TextureValidationResult validationResult = TextureValidation.Validate(ref info);
|
||||||
|
|
||||||
if (validationResult != TextureValidationResult.Valid)
|
if (validationResult != TextureValidationResult.Valid)
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
{
|
{
|
||||||
static class HwCapabilities
|
static class HwCapabilities
|
||||||
{
|
{
|
||||||
private static readonly Lazy<bool> _supportsArbBindlessTexture = new Lazy<bool>(() => HasExtension("GL_ARB_bindless_texture"));
|
private static readonly Lazy<bool> _supportsArbBindlessTexture = new(() => HasExtension("GL_ARB_bindless_texture"));
|
||||||
private static readonly Lazy<bool> _supportsAlphaToCoverageDitherControl = new(() => HasExtension("GL_NV_alpha_to_coverage_dither_control"));
|
private static readonly Lazy<bool> _supportsAlphaToCoverageDitherControl = new(() => HasExtension("GL_NV_alpha_to_coverage_dither_control"));
|
||||||
private static readonly Lazy<bool> _supportsAstcCompression = new(() => HasExtension("GL_KHR_texture_compression_astc_ldr"));
|
private static readonly Lazy<bool> _supportsAstcCompression = new(() => HasExtension("GL_KHR_texture_compression_astc_ldr"));
|
||||||
private static readonly Lazy<bool> _supportsBlendEquationAdvanced = new(() => HasExtension("GL_NV_blend_equation_advanced"));
|
private static readonly Lazy<bool> _supportsBlendEquationAdvanced = new(() => HasExtension("GL_NV_blend_equation_advanced"));
|
||||||
|
@ -15,7 +15,7 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
private static readonly Lazy<bool> _supportsGeometryShaderPassthrough = new(() => HasExtension("GL_NV_geometry_shader_passthrough"));
|
private static readonly Lazy<bool> _supportsGeometryShaderPassthrough = new(() => HasExtension("GL_NV_geometry_shader_passthrough"));
|
||||||
private static readonly Lazy<bool> _supportsImageLoadFormatted = new(() => HasExtension("GL_EXT_shader_image_load_formatted"));
|
private static readonly Lazy<bool> _supportsImageLoadFormatted = new(() => HasExtension("GL_EXT_shader_image_load_formatted"));
|
||||||
private static readonly Lazy<bool> _supportsIndirectParameters = new(() => HasExtension("GL_ARB_indirect_parameters"));
|
private static readonly Lazy<bool> _supportsIndirectParameters = new(() => HasExtension("GL_ARB_indirect_parameters"));
|
||||||
private static readonly Lazy<bool> _supportsNvBindlessTexture = new Lazy<bool>(() => HasExtension("GL_NV_bindless_texture"));
|
private static readonly Lazy<bool> _supportsNvBindlessTexture = new(() => HasExtension("GL_NV_bindless_texture"));
|
||||||
private static readonly Lazy<bool> _supportsParallelShaderCompile = new(() => HasExtension("GL_ARB_parallel_shader_compile"));
|
private static readonly Lazy<bool> _supportsParallelShaderCompile = new(() => HasExtension("GL_ARB_parallel_shader_compile"));
|
||||||
private static readonly Lazy<bool> _supportsPolygonOffsetClamp = new(() => HasExtension("GL_EXT_polygon_offset_clamp"));
|
private static readonly Lazy<bool> _supportsPolygonOffsetClamp = new(() => HasExtension("GL_EXT_polygon_offset_clamp"));
|
||||||
private static readonly Lazy<bool> _supportsQuads = new(SupportsQuadsCheck);
|
private static readonly Lazy<bool> _supportsQuads = new(SupportsQuadsCheck);
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
||||||
private readonly Dictionary<int, (ITexture, float)> _separateTextures;
|
private readonly Dictionary<int, (ITexture, float)> _separateTextures;
|
||||||
private readonly Dictionary<int, ISampler> _separateSamplers;
|
private readonly Dictionary<int, ISampler> _separateSamplers;
|
||||||
|
|
||||||
private readonly HashSet<long> _handles = new HashSet<long>();
|
private readonly HashSet<long> _handles = new();
|
||||||
|
|
||||||
public BindlessManager(OpenGLRenderer renderer)
|
public BindlessManager(OpenGLRenderer renderer)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
||||||
|
|
||||||
if (hasDeletedSamplers)
|
if (hasDeletedSamplers)
|
||||||
{
|
{
|
||||||
List<int> toRemove = new List<int>();
|
List<int> toRemove = new();
|
||||||
|
|
||||||
foreach ((int samplerId, ISampler sampler) in _separateSamplers)
|
foreach ((int samplerId, ISampler sampler) in _separateSamplers)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1262,7 +1262,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
||||||
}
|
}
|
||||||
|
|
||||||
SpvInstruction pCoords = AssemblePVector(pCount);
|
SpvInstruction pCoords = AssemblePVector(pCount);
|
||||||
SpvInstruction bindlessIndex = isBindless ? GenerateBindlessTextureHandleToIndex(context, bindlessHandle) : null;
|
|
||||||
|
_ = isBindless ? GenerateBindlessTextureHandleToIndex(context, bindlessHandle) : null;
|
||||||
|
|
||||||
SpvInstruction AssembleDerivativesVector(int count)
|
SpvInstruction AssembleDerivativesVector(int count)
|
||||||
{
|
{
|
||||||
|
|
|
@ -497,7 +497,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Operand GetBindlessScale(EmitterContext context, Operand nvHandle)
|
private static Operand GetBindlessScale(EmitterContext context, Operand nvHandle)
|
||||||
{
|
{
|
||||||
int bindlessTableBinding = SetBindingPair.Pack(Constants.BindlessTextureSetIndex, Constants.BindlessTableBinding);
|
int bindlessTableBinding = SetBindingPair.Pack(Constants.BindlessTextureSetIndex, Constants.BindlessTableBinding);
|
||||||
int bindlessScalesBinding = SetBindingPair.Pack(Constants.BindlessTextureSetIndex, Constants.BindlessScalesBinding);
|
int bindlessScalesBinding = SetBindingPair.Pack(Constants.BindlessTextureSetIndex, Constants.BindlessScalesBinding);
|
||||||
|
|
|
@ -870,7 +870,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Transforms
|
||||||
// Try to detect a indexed access.
|
// Try to detect a indexed access.
|
||||||
// The access is considered indexed if the handle is loaded with a LDC instruction
|
// The access is considered indexed if the handle is loaded with a LDC instruction
|
||||||
// from the driver reserved constant buffer used for texture handles.
|
// from the driver reserved constant buffer used for texture handles.
|
||||||
if (!(texOp.GetSource(0).AsgOp is Operation handleAsgOp))
|
if (texOp.GetSource(0).AsgOp is not Operation handleAsgOp)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ using Ryujinx.Common;
|
||||||
using Ryujinx.Graphics.GAL;
|
using Ryujinx.Graphics.GAL;
|
||||||
using Silk.NET.Vulkan;
|
using Silk.NET.Vulkan;
|
||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Numerics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Vulkan
|
namespace Ryujinx.Graphics.Vulkan
|
||||||
|
@ -187,10 +187,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
int idMapBufferSizeInBytes = _idMap.Length * sizeof(int);
|
int idMapBufferSizeInBytes = _idMap.Length * sizeof(int);
|
||||||
|
|
||||||
if (_idMapBuffer == null)
|
_idMapBuffer ??= gd.BufferManager.Create(gd, idMapBufferSizeInBytes);
|
||||||
{
|
|
||||||
_idMapBuffer = gd.BufferManager.Create(gd, idMapBufferSizeInBytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_idMapDataDirty)
|
if (_idMapDataDirty)
|
||||||
{
|
{
|
||||||
|
@ -324,7 +321,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Bind(
|
private static void Bind(
|
||||||
VulkanRenderer gd,
|
VulkanRenderer gd,
|
||||||
ShaderCollection program,
|
ShaderCollection program,
|
||||||
CommandBufferScoped cbs,
|
CommandBufferScoped cbs,
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Vulkan
|
namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
struct PipelineLayoutUsageInfo : IEquatable<PipelineLayoutUsageInfo>
|
readonly struct PipelineLayoutUsageInfo : IEquatable<PipelineLayoutUsageInfo>
|
||||||
{
|
{
|
||||||
public readonly uint BindlessTexturesCount;
|
public readonly uint BindlessTexturesCount;
|
||||||
public readonly uint BindlessSamplersCount;
|
public readonly uint BindlessSamplersCount;
|
||||||
|
@ -20,14 +20,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
return obj is PipelineLayoutUsageInfo other && Equals(other);
|
return obj is PipelineLayoutUsageInfo other && Equals(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(PipelineLayoutUsageInfo other)
|
public readonly bool Equals(PipelineLayoutUsageInfo other)
|
||||||
{
|
{
|
||||||
return BindlessTexturesCount == other.BindlessTexturesCount &&
|
return BindlessTexturesCount == other.BindlessTexturesCount &&
|
||||||
BindlessSamplersCount == other.BindlessSamplersCount &&
|
BindlessSamplersCount == other.BindlessSamplersCount &&
|
||||||
UsePushDescriptors == other.UsePushDescriptors;
|
UsePushDescriptors == other.UsePushDescriptors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override readonly int GetHashCode()
|
||||||
{
|
{
|
||||||
return HashCode.Combine(BindlessTexturesCount, BindlessSamplersCount, UsePushDescriptors);
|
return HashCode.Combine(BindlessTexturesCount, BindlessSamplersCount, UsePushDescriptors);
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,14 +312,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint BindlessTexturesCount
|
public uint BindlessTexturesCount
|
||||||
{
|
{ readonly get => (uint)((Internal.Id10 >> 0) & 0xFFFFFFFF);
|
||||||
get => (uint)((Internal.Id10 >> 0) & 0xFFFFFFFF);
|
|
||||||
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF00000000) | ((ulong)value << 0);
|
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF00000000) | ((ulong)value << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint BindlessSamplersCount
|
public uint BindlessSamplersCount
|
||||||
{
|
{ readonly get => (uint)((Internal.Id10 >> 32) & 0xFFFFFFFF);
|
||||||
get => (uint)((Internal.Id10 >> 32) & 0xFFFFFFFF);
|
|
||||||
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF) | ((ulong)value << 32);
|
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF) | ((ulong)value << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue