Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9daf029f35 | ||
|
51a27032f0 | ||
|
a6a67a2b7a | ||
|
c6d05301aa |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-dotnet@v3
|
- uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 6.0.x
|
dotnet-version: 7.0.x
|
||||||
- name: Ensure NuGet Source
|
- name: Ensure NuGet Source
|
||||||
uses: fabriciomurta/ensure-nuget-source@v1
|
uses: fabriciomurta/ensure-nuget-source@v1
|
||||||
- name: Get git short hash
|
- name: Get git short hash
|
||||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-dotnet@v3
|
- uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 6.0.x
|
dotnet-version: 7.0.x
|
||||||
- name: Ensure NuGet Source
|
- name: Ensure NuGet Source
|
||||||
uses: fabriciomurta/ensure-nuget-source@v1
|
uses: fabriciomurta/ensure-nuget-source@v1
|
||||||
- name: Clear
|
- name: Clear
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ The latest automatic build for Windows, macOS, and Linux can be found on the [Of
|
|||||||
If you wish to build the emulator yourself, follow these steps:
|
If you wish to build the emulator yourself, follow these steps:
|
||||||
|
|
||||||
### Step 1
|
### Step 1
|
||||||
Install the X64 version of [.NET 6.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/6.0).
|
Install the X64 version of [.NET 7.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/7.0).
|
||||||
|
|
||||||
### Step 2
|
### Step 2
|
||||||
Either use `git clone https://github.com/Ryujinx/Ryujinx` on the command line to clone the repository or use Code --> Download zip button to get the files.
|
Either use `git clone https://github.com/Ryujinx/Ryujinx` on the command line to clone the repository or use Code --> Download zip button to get the files.
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<RuntimeIdentifiers>win10-x64;linux-x64;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win10-x64;linux-x64;osx-x64</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -150,7 +150,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputHeader">The splitter header.</param>
|
/// <param name="inputHeader">The splitter header.</param>
|
||||||
/// <param name="input">The raw data after the splitter header.</param>
|
/// <param name="input">The raw data after the splitter header.</param>
|
||||||
private void UpdateState(ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
|
private void UpdateState(scoped ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < inputHeader.SplitterCount; i++)
|
for (int i = 0; i < inputHeader.SplitterCount; i++)
|
||||||
{
|
{
|
||||||
@@ -177,7 +177,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputHeader">The splitter header.</param>
|
/// <param name="inputHeader">The splitter header.</param>
|
||||||
/// <param name="input">The raw data after the splitter header.</param>
|
/// <param name="input">The raw data after the splitter header.</param>
|
||||||
private void UpdateData(ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
|
private void UpdateData(scoped ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < inputHeader.SplitterDestinationCount; i++)
|
for (int i = 0; i < inputHeader.SplitterDestinationCount; i++)
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
@@ -8,11 +8,13 @@
|
|||||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
||||||
<RootNamespace>Ryujinx.Ava</RootNamespace>
|
<RootNamespace>Ryujinx.Ava</RootNamespace>
|
||||||
<ApplicationIcon>Ryujinx.ico</ApplicationIcon>
|
<ApplicationIcon>Ryujinx.ico</ApplicationIcon>
|
||||||
|
<TieredPGO>true</TieredPGO>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
|
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
|
<TrimMode>partial</TrimMode>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -53,5 +53,11 @@ namespace Ryujinx.Common
|
|||||||
|
|
||||||
writer.Write(data);
|
writer.Write(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Write(this BinaryWriter writer, UInt128 value)
|
||||||
|
{
|
||||||
|
writer.Write((ulong)value);
|
||||||
|
writer.Write((ulong)(value >> 64));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -7,19 +7,19 @@ namespace Ryujinx.Common.Utilities
|
|||||||
public static class SpanHelpers
|
public static class SpanHelpers
|
||||||
{
|
{
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static Span<T> CreateSpan<T>(ref T reference, int length)
|
public static Span<T> CreateSpan<T>(scoped ref T reference, int length)
|
||||||
{
|
{
|
||||||
return MemoryMarshal.CreateSpan(ref reference, length);
|
return MemoryMarshal.CreateSpan(ref reference, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static Span<T> AsSpan<T>(ref T reference) where T : unmanaged
|
public static Span<T> AsSpan<T>(scoped ref T reference) where T : unmanaged
|
||||||
{
|
{
|
||||||
return CreateSpan(ref reference, 1);
|
return CreateSpan(ref reference, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static Span<TSpan> AsSpan<TStruct, TSpan>(ref TStruct reference)
|
public static Span<TSpan> AsSpan<TStruct, TSpan>(scoped ref TStruct reference)
|
||||||
where TStruct : unmanaged where TSpan : unmanaged
|
where TStruct : unmanaged where TSpan : unmanaged
|
||||||
{
|
{
|
||||||
return CreateSpan(ref Unsafe.As<TStruct, TSpan>(ref reference),
|
return CreateSpan(ref Unsafe.As<TStruct, TSpan>(ref reference),
|
||||||
@@ -27,25 +27,25 @@ namespace Ryujinx.Common.Utilities
|
|||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static Span<byte> AsByteSpan<T>(ref T reference) where T : unmanaged
|
public static Span<byte> AsByteSpan<T>(scoped ref T reference) where T : unmanaged
|
||||||
{
|
{
|
||||||
return CreateSpan(ref Unsafe.As<T, byte>(ref reference), Unsafe.SizeOf<T>());
|
return CreateSpan(ref Unsafe.As<T, byte>(ref reference), Unsafe.SizeOf<T>());
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static ReadOnlySpan<T> CreateReadOnlySpan<T>(ref T reference, int length)
|
public static ReadOnlySpan<T> CreateReadOnlySpan<T>(scoped ref T reference, int length)
|
||||||
{
|
{
|
||||||
return MemoryMarshal.CreateReadOnlySpan(ref reference, length);
|
return MemoryMarshal.CreateReadOnlySpan(ref reference, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static ReadOnlySpan<T> AsReadOnlySpan<T>(ref T reference) where T : unmanaged
|
public static ReadOnlySpan<T> AsReadOnlySpan<T>(scoped ref T reference) where T : unmanaged
|
||||||
{
|
{
|
||||||
return CreateReadOnlySpan(ref reference, 1);
|
return CreateReadOnlySpan(ref reference, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static ReadOnlySpan<TSpan> AsReadOnlySpan<TStruct, TSpan>(ref TStruct reference)
|
public static ReadOnlySpan<TSpan> AsReadOnlySpan<TStruct, TSpan>(scoped ref TStruct reference)
|
||||||
where TStruct : unmanaged where TSpan : unmanaged
|
where TStruct : unmanaged where TSpan : unmanaged
|
||||||
{
|
{
|
||||||
return CreateReadOnlySpan(ref Unsafe.As<TStruct, TSpan>(ref reference),
|
return CreateReadOnlySpan(ref Unsafe.As<TStruct, TSpan>(ref reference),
|
||||||
@@ -53,7 +53,7 @@ namespace Ryujinx.Common.Utilities
|
|||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static ReadOnlySpan<byte> AsReadOnlyByteSpan<T>(ref T reference) where T : unmanaged
|
public static ReadOnlySpan<byte> AsReadOnlyByteSpan<T>(scoped ref T reference) where T : unmanaged
|
||||||
{
|
{
|
||||||
return CreateReadOnlySpan(ref Unsafe.As<T, byte>(ref reference), Unsafe.SizeOf<T>());
|
return CreateReadOnlySpan(ref Unsafe.As<T, byte>(ref reference), Unsafe.SizeOf<T>());
|
||||||
}
|
}
|
||||||
|
17
Ryujinx.Common/Utilities/UInt128Utils.cs
Normal file
17
Ryujinx.Common/Utilities/UInt128Utils.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Common.Utilities
|
||||||
|
{
|
||||||
|
public static class UInt128Utils
|
||||||
|
{
|
||||||
|
public static UInt128 FromHex(string hex)
|
||||||
|
{
|
||||||
|
return new UInt128((ulong)Convert.ToInt64(hex.Substring(0, 16), 16), (ulong)Convert.ToInt64(hex.Substring(16), 16));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UInt128 CreateRandom()
|
||||||
|
{
|
||||||
|
return new UInt128((ulong)Random.Shared.NextInt64(), (ulong)Random.Shared.NextInt64());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
|
@@ -708,11 +708,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool dataMatches = _currentData != null && data.SequenceEqual(_currentData);
|
bool dataMatches = _currentData != null && data.SequenceEqual(_currentData);
|
||||||
_currentData = data.ToArray();
|
|
||||||
if (dataMatches)
|
if (dataMatches)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_currentData = data.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -413,10 +413,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private void UpdateCachedBuffer(
|
private void UpdateCachedBuffer(
|
||||||
int stageIndex,
|
int stageIndex,
|
||||||
ref int cachedTextureBufferIndex,
|
scoped ref int cachedTextureBufferIndex,
|
||||||
ref int cachedSamplerBufferIndex,
|
scoped ref int cachedSamplerBufferIndex,
|
||||||
ref ReadOnlySpan<int> cachedTextureBuffer,
|
scoped ref ReadOnlySpan<int> cachedTextureBuffer,
|
||||||
ref ReadOnlySpan<int> cachedSamplerBuffer,
|
scoped ref ReadOnlySpan<int> cachedSamplerBuffer,
|
||||||
int textureBufferIndex,
|
int textureBufferIndex,
|
||||||
int samplerBufferIndex)
|
int samplerBufferIndex)
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
|
|||||||
private const ushort FileFormatVersionMajor = 1;
|
private const ushort FileFormatVersionMajor = 1;
|
||||||
private const ushort FileFormatVersionMinor = 2;
|
private const ushort FileFormatVersionMinor = 2;
|
||||||
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
|
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
|
||||||
private const uint CodeGenVersion = 3807;
|
private const uint CodeGenVersion = 3831;
|
||||||
|
|
||||||
private const string SharedTocFileName = "shared.toc";
|
private const string SharedTocFileName = "shared.toc";
|
||||||
private const string SharedDataFileName = "shared.data";
|
private const string SharedDataFileName = "shared.data";
|
||||||
|
@@ -350,7 +350,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.HashTable
|
|||||||
/// <param name="item">The item on the table, if found, otherwise unmodified</param>
|
/// <param name="item">The item on the table, if found, otherwise unmodified</param>
|
||||||
/// <param name="data">The data on the table, if found, otherwise unmodified</param>
|
/// <param name="data">The data on the table, if found, otherwise unmodified</param>
|
||||||
/// <returns>Table lookup result</returns>
|
/// <returns>Table lookup result</returns>
|
||||||
public SearchResult TryFindItem(ref SmartDataAccessor dataAccessor, int size, ref T item, ref byte[] data)
|
public SearchResult TryFindItem(scoped ref SmartDataAccessor dataAccessor, int size, scoped ref T item, scoped ref byte[] data)
|
||||||
{
|
{
|
||||||
if (_count == 0)
|
if (_count == 0)
|
||||||
{
|
{
|
||||||
|
@@ -91,7 +91,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.HashTable
|
|||||||
/// <param name="item">The item on the table, if found, otherwise unmodified</param>
|
/// <param name="item">The item on the table, if found, otherwise unmodified</param>
|
||||||
/// <param name="data">The data on the table, if found, otherwise unmodified</param>
|
/// <param name="data">The data on the table, if found, otherwise unmodified</param>
|
||||||
/// <returns>Table lookup result</returns>
|
/// <returns>Table lookup result</returns>
|
||||||
public PartitionHashTable<T>.SearchResult TryFindItem(ref SmartDataAccessor dataAccessor, ref T item, ref byte[] data)
|
public PartitionHashTable<T>.SearchResult TryFindItem(scoped ref SmartDataAccessor dataAccessor, scoped ref T item, scoped ref byte[] data)
|
||||||
{
|
{
|
||||||
return _table.TryFindItem(ref dataAccessor, Size, ref item, ref data);
|
return _table.TryFindItem(ref dataAccessor, Size, ref item, ref data);
|
||||||
}
|
}
|
||||||
|
@@ -552,11 +552,11 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||||||
private static void UpdateCachedBuffer(
|
private static void UpdateCachedBuffer(
|
||||||
GpuChannel channel,
|
GpuChannel channel,
|
||||||
bool isCompute,
|
bool isCompute,
|
||||||
ref int cachedTextureBufferIndex,
|
scoped ref int cachedTextureBufferIndex,
|
||||||
ref int cachedSamplerBufferIndex,
|
scoped ref int cachedSamplerBufferIndex,
|
||||||
ref ReadOnlySpan<int> cachedTextureBuffer,
|
scoped ref ReadOnlySpan<int> cachedTextureBuffer,
|
||||||
ref ReadOnlySpan<int> cachedSamplerBuffer,
|
scoped ref ReadOnlySpan<int> cachedSamplerBuffer,
|
||||||
ref int cachedStageIndex,
|
scoped ref int cachedStageIndex,
|
||||||
int textureBufferIndex,
|
int textureBufferIndex,
|
||||||
int samplerBufferIndex,
|
int samplerBufferIndex,
|
||||||
int stageIndex)
|
int stageIndex)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -34,5 +34,11 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||||||
GL.ActiveTexture(TextureUnit.Texture0 + unit);
|
GL.ActiveTexture(TextureUnit.Texture0 + unit);
|
||||||
GL.BindTexture(target, Handle);
|
GL.BindTexture(target, Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ClearBinding(int unit)
|
||||||
|
{
|
||||||
|
GL.ActiveTexture(TextureUnit.Texture0 + unit);
|
||||||
|
GL.BindTextureUnit(unit, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -919,6 +919,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||||||
|
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
{
|
{
|
||||||
|
GL.BindImageTexture(binding, 0, 0, true, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1275,6 +1276,10 @@ namespace Ryujinx.Graphics.OpenGL
|
|||||||
((TextureBase)texture).Bind(binding);
|
((TextureBase)texture).Bind(binding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextureBase.ClearBinding(binding);
|
||||||
|
}
|
||||||
|
|
||||||
Sampler glSampler = (Sampler)sampler;
|
Sampler glSampler = (Sampler)sampler;
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -10,12 +10,12 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
|
|
||||||
public StructuredFunction CurrentFunction { get; set; }
|
public StructuredFunction CurrentFunction { get; set; }
|
||||||
|
|
||||||
|
public StructuredProgramInfo Info { get; }
|
||||||
|
|
||||||
public ShaderConfig Config { get; }
|
public ShaderConfig Config { get; }
|
||||||
|
|
||||||
public OperandManager OperandManager { get; }
|
public OperandManager OperandManager { get; }
|
||||||
|
|
||||||
private readonly StructuredProgramInfo _info;
|
|
||||||
|
|
||||||
private readonly StringBuilder _sb;
|
private readonly StringBuilder _sb;
|
||||||
|
|
||||||
private int _level;
|
private int _level;
|
||||||
@@ -24,7 +24,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
|
|
||||||
public CodeGenContext(StructuredProgramInfo info, ShaderConfig config)
|
public CodeGenContext(StructuredProgramInfo info, ShaderConfig config)
|
||||||
{
|
{
|
||||||
_info = info;
|
Info = info;
|
||||||
Config = config;
|
Config = config;
|
||||||
|
|
||||||
OperandManager = new OperandManager();
|
OperandManager = new OperandManager();
|
||||||
@@ -72,19 +72,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
|
|
||||||
public StructuredFunction GetFunction(int id)
|
public StructuredFunction GetFunction(int id)
|
||||||
{
|
{
|
||||||
return _info.Functions[id];
|
return Info.Functions[id];
|
||||||
}
|
|
||||||
|
|
||||||
public TransformFeedbackOutput GetTransformFeedbackOutput(int location, int component)
|
|
||||||
{
|
|
||||||
int index = (AttributeConsts.UserAttributeBase / 4) + location * 4 + component;
|
|
||||||
return _info.TransformFeedbackOutputs[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
public TransformFeedbackOutput GetTransformFeedbackOutput(int location)
|
|
||||||
{
|
|
||||||
int index = location / 4;
|
|
||||||
return _info.TransformFeedbackOutputs[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateIndentation()
|
private void UpdateIndentation()
|
||||||
|
@@ -210,7 +210,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
|
|
||||||
if (context.Config.TransformFeedbackEnabled && context.Config.LastInVertexPipeline)
|
if (context.Config.TransformFeedbackEnabled && context.Config.LastInVertexPipeline)
|
||||||
{
|
{
|
||||||
var tfOutput = context.GetTransformFeedbackOutput(AttributeConsts.PositionX);
|
var tfOutput = context.Info.GetTransformFeedbackOutput(AttributeConsts.PositionX);
|
||||||
if (tfOutput.Valid)
|
if (tfOutput.Valid)
|
||||||
{
|
{
|
||||||
context.AppendLine($"layout (xfb_buffer = {tfOutput.Buffer}, xfb_offset = {tfOutput.Offset}, xfb_stride = {tfOutput.Stride}) out gl_PerVertex");
|
context.AppendLine($"layout (xfb_buffer = {tfOutput.Buffer}, xfb_offset = {tfOutput.Offset}, xfb_stride = {tfOutput.Stride}) out gl_PerVertex");
|
||||||
@@ -603,6 +603,31 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
string name = $"{DefaultNames.OAttributePrefix}{attr}{suffix}";
|
string name = $"{DefaultNames.OAttributePrefix}{attr}{suffix}";
|
||||||
|
|
||||||
if (context.Config.TransformFeedbackEnabled && context.Config.LastInVertexPipeline)
|
if (context.Config.TransformFeedbackEnabled && context.Config.LastInVertexPipeline)
|
||||||
|
{
|
||||||
|
int attrOffset = AttributeConsts.UserAttributeBase + attr * 16;
|
||||||
|
int components = context.Config.LastInPipeline ? context.Info.GetTransformFeedbackOutputComponents(attrOffset) : 1;
|
||||||
|
|
||||||
|
if (components > 1)
|
||||||
|
{
|
||||||
|
string type = components switch
|
||||||
|
{
|
||||||
|
2 => "vec2",
|
||||||
|
3 => "vec3",
|
||||||
|
4 => "vec4",
|
||||||
|
_ => "float"
|
||||||
|
};
|
||||||
|
|
||||||
|
string xfb = string.Empty;
|
||||||
|
|
||||||
|
var tfOutput = context.Info.GetTransformFeedbackOutput(attrOffset);
|
||||||
|
if (tfOutput.Valid)
|
||||||
|
{
|
||||||
|
xfb = $", xfb_buffer = {tfOutput.Buffer}, xfb_offset = {tfOutput.Offset}, xfb_stride = {tfOutput.Stride}";
|
||||||
|
}
|
||||||
|
|
||||||
|
context.AppendLine($"layout (location = {attr}{xfb}) out {type} {name};");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (int c = 0; c < 4; c++)
|
for (int c = 0; c < 4; c++)
|
||||||
{
|
{
|
||||||
@@ -610,7 +635,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
|
|
||||||
string xfb = string.Empty;
|
string xfb = string.Empty;
|
||||||
|
|
||||||
var tfOutput = context.GetTransformFeedbackOutput(attr, c);
|
var tfOutput = context.Info.GetTransformFeedbackOutput(attrOffset + c * 4);
|
||||||
if (tfOutput.Valid)
|
if (tfOutput.Valid)
|
||||||
{
|
{
|
||||||
xfb = $", xfb_buffer = {tfOutput.Buffer}, xfb_offset = {tfOutput.Offset}, xfb_stride = {tfOutput.Stride}";
|
xfb = $", xfb_buffer = {tfOutput.Buffer}, xfb_offset = {tfOutput.Offset}, xfb_stride = {tfOutput.Stride}";
|
||||||
@@ -619,6 +644,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
context.AppendLine($"layout (location = {attr}, component = {c}{xfb}) out float {name}_{swzMask};");
|
context.AppendLine($"layout (location = {attr}, component = {c}{xfb}) out float {name}_{swzMask};");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context.AppendLine($"layout (location = {attr}) out vec4 {name};");
|
context.AppendLine($"layout (location = {attr}) out vec4 {name};");
|
||||||
|
@@ -134,7 +134,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
if (assignment.Destination is AstOperand operand && operand.Type.IsAttribute())
|
if (assignment.Destination is AstOperand operand && operand.Type.IsAttribute())
|
||||||
{
|
{
|
||||||
bool perPatch = operand.Type == OperandType.AttributePerPatch;
|
bool perPatch = operand.Type == OperandType.AttributePerPatch;
|
||||||
dest = OperandManager.GetOutAttributeName(operand.Value, context.Config, perPatch);
|
dest = OperandManager.GetOutAttributeName(context, operand.Value, perPatch);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
|
|||||||
}
|
}
|
||||||
else if (node is AstOperand operand)
|
else if (node is AstOperand operand)
|
||||||
{
|
{
|
||||||
return context.OperandManager.GetExpression(operand, context.Config);
|
return context.OperandManager.GetExpression(context, operand);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new ArgumentException($"Invalid node type \"{node?.GetType().Name ?? "null"}\".");
|
throw new ArgumentException($"Invalid node type \"{node?.GetType().Name ?? "null"}\".");
|
||||||
|
@@ -205,7 +205,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
|
|||||||
if (src2 is AstOperand operand && operand.Type == OperandType.Constant)
|
if (src2 is AstOperand operand && operand.Type == OperandType.Constant)
|
||||||
{
|
{
|
||||||
int attrOffset = baseAttr.Value + (operand.Value << 2);
|
int attrOffset = baseAttr.Value + (operand.Value << 2);
|
||||||
return OperandManager.GetAttributeName(attrOffset, context.Config, perPatch: false, isOutAttr: false, indexExpr);
|
return OperandManager.GetAttributeName(context, attrOffset, perPatch: false, isOutAttr: false, indexExpr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -332,7 +332,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
|
|||||||
if (src2 is AstOperand operand && operand.Type == OperandType.Constant)
|
if (src2 is AstOperand operand && operand.Type == OperandType.Constant)
|
||||||
{
|
{
|
||||||
int attrOffset = baseAttr.Value + (operand.Value << 2);
|
int attrOffset = baseAttr.Value + (operand.Value << 2);
|
||||||
attrName = OperandManager.GetAttributeName(attrOffset, context.Config, perPatch: false, isOutAttr: true);
|
attrName = OperandManager.GetAttributeName(context, attrOffset, perPatch: false, isOutAttr: true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -48,6 +48,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
{ AttributeConsts.TessCoordY, new BuiltInAttribute("gl_TessCoord.y", VariableType.F32) },
|
{ AttributeConsts.TessCoordY, new BuiltInAttribute("gl_TessCoord.y", VariableType.F32) },
|
||||||
{ AttributeConsts.InstanceId, new BuiltInAttribute("gl_InstanceID", VariableType.S32) },
|
{ AttributeConsts.InstanceId, new BuiltInAttribute("gl_InstanceID", VariableType.S32) },
|
||||||
{ AttributeConsts.VertexId, new BuiltInAttribute("gl_VertexID", VariableType.S32) },
|
{ AttributeConsts.VertexId, new BuiltInAttribute("gl_VertexID", VariableType.S32) },
|
||||||
|
{ AttributeConsts.BaseInstance, new BuiltInAttribute("gl_BaseInstance", VariableType.S32) },
|
||||||
|
{ AttributeConsts.BaseVertex, new BuiltInAttribute("gl_BaseVertex", VariableType.S32) },
|
||||||
|
{ AttributeConsts.InstanceIndex, new BuiltInAttribute("gl_InstanceIndex", VariableType.S32) },
|
||||||
|
{ AttributeConsts.VertexIndex, new BuiltInAttribute("gl_VertexIndex", VariableType.S32) },
|
||||||
{ AttributeConsts.FrontFacing, new BuiltInAttribute("gl_FrontFacing", VariableType.Bool) },
|
{ AttributeConsts.FrontFacing, new BuiltInAttribute("gl_FrontFacing", VariableType.Bool) },
|
||||||
|
|
||||||
// Special.
|
// Special.
|
||||||
@@ -99,15 +103,15 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetExpression(AstOperand operand, ShaderConfig config)
|
public string GetExpression(CodeGenContext context, AstOperand operand)
|
||||||
{
|
{
|
||||||
return operand.Type switch
|
return operand.Type switch
|
||||||
{
|
{
|
||||||
OperandType.Argument => GetArgumentName(operand.Value),
|
OperandType.Argument => GetArgumentName(operand.Value),
|
||||||
OperandType.Attribute => GetAttributeName(operand.Value, config, perPatch: false),
|
OperandType.Attribute => GetAttributeName(context, operand.Value, perPatch: false),
|
||||||
OperandType.AttributePerPatch => GetAttributeName(operand.Value, config, perPatch: true),
|
OperandType.AttributePerPatch => GetAttributeName(context, operand.Value, perPatch: true),
|
||||||
OperandType.Constant => NumberFormatter.FormatInt(operand.Value),
|
OperandType.Constant => NumberFormatter.FormatInt(operand.Value),
|
||||||
OperandType.ConstantBuffer => GetConstantBufferName(operand, config),
|
OperandType.ConstantBuffer => GetConstantBufferName(operand, context.Config),
|
||||||
OperandType.LocalVariable => _locals[operand],
|
OperandType.LocalVariable => _locals[operand],
|
||||||
OperandType.Undefined => DefaultNames.UndefinedName,
|
OperandType.Undefined => DefaultNames.UndefinedName,
|
||||||
_ => throw new ArgumentException($"Invalid operand type \"{operand.Type}\".")
|
_ => throw new ArgumentException($"Invalid operand type \"{operand.Type}\".")
|
||||||
@@ -149,13 +153,15 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
return GetVec4Indexed(GetUbName(stage, slotExpr) + $"[{offsetExpr} >> 2]", offsetExpr + " & 3", indexElement);
|
return GetVec4Indexed(GetUbName(stage, slotExpr) + $"[{offsetExpr} >> 2]", offsetExpr + " & 3", indexElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetOutAttributeName(int value, ShaderConfig config, bool perPatch)
|
public static string GetOutAttributeName(CodeGenContext context, int value, bool perPatch)
|
||||||
{
|
{
|
||||||
return GetAttributeName(value, config, perPatch, isOutAttr: true);
|
return GetAttributeName(context, value, perPatch, isOutAttr: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetAttributeName(int value, ShaderConfig config, bool perPatch, bool isOutAttr = false, string indexExpr = "0")
|
public static string GetAttributeName(CodeGenContext context, int value, bool perPatch, bool isOutAttr = false, string indexExpr = "0")
|
||||||
{
|
{
|
||||||
|
ShaderConfig config = context.Config;
|
||||||
|
|
||||||
if ((value & AttributeConsts.LoadOutputMask) != 0)
|
if ((value & AttributeConsts.LoadOutputMask) != 0)
|
||||||
{
|
{
|
||||||
isOutAttr = true;
|
isOutAttr = true;
|
||||||
@@ -188,6 +194,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
}
|
}
|
||||||
else if (value >= AttributeConsts.UserAttributeBase && value < AttributeConsts.UserAttributeEnd)
|
else if (value >= AttributeConsts.UserAttributeBase && value < AttributeConsts.UserAttributeEnd)
|
||||||
{
|
{
|
||||||
|
int attrOffset = value;
|
||||||
value -= AttributeConsts.UserAttributeBase;
|
value -= AttributeConsts.UserAttributeBase;
|
||||||
|
|
||||||
string prefix = isOutAttr
|
string prefix = isOutAttr
|
||||||
@@ -211,14 +218,15 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||||||
((config.LastInVertexPipeline && isOutAttr) ||
|
((config.LastInVertexPipeline && isOutAttr) ||
|
||||||
(config.Stage == ShaderStage.Fragment && !isOutAttr)))
|
(config.Stage == ShaderStage.Fragment && !isOutAttr)))
|
||||||
{
|
{
|
||||||
string name = $"{prefix}{(value >> 4)}_{swzMask}";
|
int components = config.LastInPipeline ? context.Info.GetTransformFeedbackOutputComponents(attrOffset) : 1;
|
||||||
|
string name = components > 1 ? $"{prefix}{(value >> 4)}" : $"{prefix}{(value >> 4)}_{swzMask}";
|
||||||
|
|
||||||
if (AttributeInfo.IsArrayAttributeGlsl(config.Stage, isOutAttr))
|
if (AttributeInfo.IsArrayAttributeGlsl(config.Stage, isOutAttr))
|
||||||
{
|
{
|
||||||
name += isOutAttr ? "[gl_InvocationID]" : $"[{indexExpr}]";
|
name += isOutAttr ? "[gl_InvocationID]" : $"[{indexExpr}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return components > 1 ? name + '.' + swzMask : name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
private const uint SpirvVersionRevision = 0;
|
private const uint SpirvVersionRevision = 0;
|
||||||
private const uint SpirvVersionPacked = (SpirvVersionMajor << 16) | (SpirvVersionMinor << 8) | SpirvVersionRevision;
|
private const uint SpirvVersionPacked = (SpirvVersionMajor << 16) | (SpirvVersionMinor << 8) | SpirvVersionRevision;
|
||||||
|
|
||||||
private readonly StructuredProgramInfo _info;
|
public StructuredProgramInfo Info { get; }
|
||||||
|
|
||||||
public ShaderConfig Config { get; }
|
public ShaderConfig Config { get; }
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
GeneratorPool<Instruction> instPool,
|
GeneratorPool<Instruction> instPool,
|
||||||
GeneratorPool<LiteralInteger> integerPool) : base(SpirvVersionPacked, instPool, integerPool)
|
GeneratorPool<LiteralInteger> integerPool) : base(SpirvVersionPacked, instPool, integerPool)
|
||||||
{
|
{
|
||||||
_info = info;
|
Info = info;
|
||||||
Config = config;
|
Config = config;
|
||||||
|
|
||||||
if (config.Stage == ShaderStage.Geometry)
|
if (config.Stage == ShaderStage.Geometry)
|
||||||
@@ -317,6 +317,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
{
|
{
|
||||||
attrOffset = attr;
|
attrOffset = attr;
|
||||||
type = elemType;
|
type = elemType;
|
||||||
|
|
||||||
|
if (Config.LastInPipeline && isOutAttr)
|
||||||
|
{
|
||||||
|
int components = Info.GetTransformFeedbackOutputComponents(attr);
|
||||||
|
|
||||||
|
if (components > 1)
|
||||||
|
{
|
||||||
|
attrOffset &= ~0xf;
|
||||||
|
type = AggregateType.Vector | AggregateType.FP32;
|
||||||
|
attrInfo = new AttributeInfo(attrOffset, (attr - attrOffset) / 4, components, type, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ioVariable = isOutAttr ? Outputs[attrOffset] : Inputs[attrOffset];
|
ioVariable = isOutAttr ? Outputs[attrOffset] : Inputs[attrOffset];
|
||||||
@@ -536,18 +548,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
return _functions[funcIndex];
|
return _functions[funcIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransformFeedbackOutput GetTransformFeedbackOutput(int location, int component)
|
|
||||||
{
|
|
||||||
int index = (AttributeConsts.UserAttributeBase / 4) + location * 4 + component;
|
|
||||||
return _info.TransformFeedbackOutputs[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
public TransformFeedbackOutput GetTransformFeedbackOutput(int location)
|
|
||||||
{
|
|
||||||
int index = location / 4;
|
|
||||||
return _info.TransformFeedbackOutputs[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
public Instruction GetType(AggregateType type, int length = 1)
|
public Instruction GetType(AggregateType type, int length = 1)
|
||||||
{
|
{
|
||||||
if (type.HasFlag(AggregateType.Array))
|
if (type.HasFlag(AggregateType.Array))
|
||||||
|
@@ -440,12 +440,23 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
{
|
{
|
||||||
PixelImap iq = PixelImap.Unused;
|
PixelImap iq = PixelImap.Unused;
|
||||||
|
|
||||||
if (context.Config.Stage == ShaderStage.Fragment &&
|
if (context.Config.Stage == ShaderStage.Fragment)
|
||||||
attr >= AttributeConsts.UserAttributeBase &&
|
{
|
||||||
attr < AttributeConsts.UserAttributeEnd)
|
if (attr >= AttributeConsts.UserAttributeBase && attr < AttributeConsts.UserAttributeEnd)
|
||||||
{
|
{
|
||||||
iq = context.Config.ImapTypes[(attr - AttributeConsts.UserAttributeBase) / 16].GetFirstUsedType();
|
iq = context.Config.ImapTypes[(attr - AttributeConsts.UserAttributeBase) / 16].GetFirstUsedType();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AttributeInfo attrInfo = AttributeInfo.From(context.Config, attr, isOutAttr: false);
|
||||||
|
AggregateType elemType = attrInfo.Type & AggregateType.ElementTypeMask;
|
||||||
|
|
||||||
|
if (attrInfo.IsBuiltin && (elemType == AggregateType.S32 || elemType == AggregateType.U32))
|
||||||
|
{
|
||||||
|
iq = PixelImap.Constant;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DeclareInputOrOutput(context, attr, perPatch, isOutAttr: false, iq);
|
DeclareInputOrOutput(context, attr, perPatch, isOutAttr: false, iq);
|
||||||
}
|
}
|
||||||
@@ -516,7 +527,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
((isOutAttr && context.Config.LastInVertexPipeline) ||
|
((isOutAttr && context.Config.LastInVertexPipeline) ||
|
||||||
(!isOutAttr && context.Config.Stage == ShaderStage.Fragment)))
|
(!isOutAttr && context.Config.Stage == ShaderStage.Fragment)))
|
||||||
{
|
{
|
||||||
DeclareInputOrOutput(context, attr, (attr >> 2) & 3, isOutAttr, iq);
|
DeclareTransformFeedbackInputOrOutput(context, attr, isOutAttr, iq);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,7 +583,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
|
|
||||||
if (context.Config.TransformFeedbackEnabled && context.Config.LastInVertexPipeline && isOutAttr)
|
if (context.Config.TransformFeedbackEnabled && context.Config.LastInVertexPipeline && isOutAttr)
|
||||||
{
|
{
|
||||||
var tfOutput = context.GetTransformFeedbackOutput(attrInfo.BaseValue);
|
var tfOutput = context.Info.GetTransformFeedbackOutput(attrInfo.BaseValue);
|
||||||
if (tfOutput.Valid)
|
if (tfOutput.Valid)
|
||||||
{
|
{
|
||||||
context.Decorate(spvVar, Decoration.XfbBuffer, (LiteralInteger)tfOutput.Buffer);
|
context.Decorate(spvVar, Decoration.XfbBuffer, (LiteralInteger)tfOutput.Buffer);
|
||||||
@@ -595,15 +606,22 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
|
|
||||||
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
|
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
|
||||||
|
|
||||||
if (!isOutAttr)
|
if (!isOutAttr &&
|
||||||
{
|
!perPatch &&
|
||||||
if (!perPatch &&
|
|
||||||
(context.Config.PassthroughAttributes & (1 << location)) != 0 &&
|
(context.Config.PassthroughAttributes & (1 << location)) != 0 &&
|
||||||
context.Config.GpuAccessor.QueryHostSupportsGeometryShaderPassthrough())
|
context.Config.GpuAccessor.QueryHostSupportsGeometryShaderPassthrough())
|
||||||
{
|
{
|
||||||
context.Decorate(spvVar, Decoration.PassthroughNV);
|
context.Decorate(spvVar, Decoration.PassthroughNV);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (attr >= AttributeConsts.FragmentOutputColorBase && attr < AttributeConsts.FragmentOutputColorEnd)
|
||||||
|
{
|
||||||
|
int location = (attr - AttributeConsts.FragmentOutputColorBase) / 16;
|
||||||
|
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isOutAttr)
|
||||||
|
{
|
||||||
switch (iq)
|
switch (iq)
|
||||||
{
|
{
|
||||||
case PixelImap.Constant:
|
case PixelImap.Constant:
|
||||||
@@ -614,29 +632,40 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (attr >= AttributeConsts.FragmentOutputColorBase && attr < AttributeConsts.FragmentOutputColorEnd)
|
|
||||||
{
|
|
||||||
int location = (attr - AttributeConsts.FragmentOutputColorBase) / 16;
|
|
||||||
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
|
|
||||||
}
|
|
||||||
|
|
||||||
context.AddGlobalVariable(spvVar);
|
context.AddGlobalVariable(spvVar);
|
||||||
dict.Add(attrInfo.BaseValue, spvVar);
|
dict.Add(attrInfo.BaseValue, spvVar);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DeclareInputOrOutput(CodeGenContext context, int attr, int component, bool isOutAttr, PixelImap iq = PixelImap.Unused)
|
private static void DeclareTransformFeedbackInputOrOutput(CodeGenContext context, int attr, bool isOutAttr, PixelImap iq = PixelImap.Unused)
|
||||||
{
|
{
|
||||||
var dict = isOutAttr ? context.Outputs : context.Inputs;
|
var dict = isOutAttr ? context.Outputs : context.Inputs;
|
||||||
var attrInfo = AttributeInfo.From(context.Config, attr, isOutAttr);
|
var attrInfo = AttributeInfo.From(context.Config, attr, isOutAttr);
|
||||||
|
|
||||||
|
bool hasComponent = true;
|
||||||
|
int component = (attr >> 2) & 3;
|
||||||
|
int components = 1;
|
||||||
|
var type = attrInfo.Type & AggregateType.ElementTypeMask;
|
||||||
|
|
||||||
|
if (context.Config.LastInPipeline && isOutAttr)
|
||||||
|
{
|
||||||
|
components = context.Info.GetTransformFeedbackOutputComponents(attr);
|
||||||
|
|
||||||
|
if (components > 1)
|
||||||
|
{
|
||||||
|
attr &= ~0xf;
|
||||||
|
type = AggregateType.Vector | AggregateType.FP32;
|
||||||
|
hasComponent = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (dict.ContainsKey(attr))
|
if (dict.ContainsKey(attr))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var storageClass = isOutAttr ? StorageClass.Output : StorageClass.Input;
|
var storageClass = isOutAttr ? StorageClass.Output : StorageClass.Input;
|
||||||
var attrType = context.GetType(attrInfo.Type & AggregateType.ElementTypeMask);
|
var attrType = context.GetType(type, components);
|
||||||
|
|
||||||
if (AttributeInfo.IsArrayAttributeSpirv(context.Config.Stage, isOutAttr) && (!attrInfo.IsBuiltin || AttributeInfo.IsArrayBuiltIn(attr)))
|
if (AttributeInfo.IsArrayAttributeSpirv(context.Config.Stage, isOutAttr) && (!attrInfo.IsBuiltin || AttributeInfo.IsArrayBuiltIn(attr)))
|
||||||
{
|
{
|
||||||
@@ -656,11 +685,15 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
int location = (attr - AttributeConsts.UserAttributeBase) / 16;
|
int location = (attr - AttributeConsts.UserAttributeBase) / 16;
|
||||||
|
|
||||||
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
|
context.Decorate(spvVar, Decoration.Location, (LiteralInteger)location);
|
||||||
|
|
||||||
|
if (hasComponent)
|
||||||
|
{
|
||||||
context.Decorate(spvVar, Decoration.Component, (LiteralInteger)component);
|
context.Decorate(spvVar, Decoration.Component, (LiteralInteger)component);
|
||||||
|
}
|
||||||
|
|
||||||
if (isOutAttr)
|
if (isOutAttr)
|
||||||
{
|
{
|
||||||
var tfOutput = context.GetTransformFeedbackOutput(location, component);
|
var tfOutput = context.Info.GetTransformFeedbackOutput(attr);
|
||||||
if (tfOutput.Valid)
|
if (tfOutput.Valid)
|
||||||
{
|
{
|
||||||
context.Decorate(spvVar, Decoration.XfbBuffer, (LiteralInteger)tfOutput.Buffer);
|
context.Decorate(spvVar, Decoration.XfbBuffer, (LiteralInteger)tfOutput.Buffer);
|
||||||
@@ -704,8 +737,12 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
AttributeConsts.ClipDistance0 => BuiltIn.ClipDistance,
|
AttributeConsts.ClipDistance0 => BuiltIn.ClipDistance,
|
||||||
AttributeConsts.PointCoordX => BuiltIn.PointCoord,
|
AttributeConsts.PointCoordX => BuiltIn.PointCoord,
|
||||||
AttributeConsts.TessCoordX => BuiltIn.TessCoord,
|
AttributeConsts.TessCoordX => BuiltIn.TessCoord,
|
||||||
AttributeConsts.InstanceId => BuiltIn.InstanceId, // FIXME: Invalid
|
AttributeConsts.InstanceId => BuiltIn.InstanceId,
|
||||||
AttributeConsts.VertexId => BuiltIn.VertexId, // FIXME: Invalid
|
AttributeConsts.VertexId => BuiltIn.VertexId,
|
||||||
|
AttributeConsts.BaseInstance => BuiltIn.BaseInstance,
|
||||||
|
AttributeConsts.BaseVertex => BuiltIn.BaseVertex,
|
||||||
|
AttributeConsts.InstanceIndex => BuiltIn.InstanceIndex,
|
||||||
|
AttributeConsts.VertexIndex => BuiltIn.VertexIndex,
|
||||||
AttributeConsts.FrontFacing => BuiltIn.FrontFacing,
|
AttributeConsts.FrontFacing => BuiltIn.FrontFacing,
|
||||||
AttributeConsts.FragmentOutputDepth => BuiltIn.FragDepth,
|
AttributeConsts.FragmentOutputDepth => BuiltIn.FragDepth,
|
||||||
AttributeConsts.ThreadKill => BuiltIn.HelperInvocation,
|
AttributeConsts.ThreadKill => BuiltIn.HelperInvocation,
|
||||||
|
@@ -62,11 +62,19 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||||||
context.AddCapability(Capability.TransformFeedback);
|
context.AddCapability(Capability.TransformFeedback);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.Stage == ShaderStage.Fragment && context.Config.GpuAccessor.QueryHostSupportsFragmentShaderInterlock())
|
if (config.Stage == ShaderStage.Fragment)
|
||||||
|
{
|
||||||
|
if (context.Info.Inputs.Contains(AttributeConsts.Layer))
|
||||||
|
{
|
||||||
|
context.AddCapability(Capability.Geometry);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context.Config.GpuAccessor.QueryHostSupportsFragmentShaderInterlock())
|
||||||
{
|
{
|
||||||
context.AddCapability(Capability.FragmentShaderPixelInterlockEXT);
|
context.AddCapability(Capability.FragmentShaderPixelInterlockEXT);
|
||||||
context.AddExtension("SPV_EXT_fragment_shader_interlock");
|
context.AddExtension("SPV_EXT_fragment_shader_interlock");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (config.Stage == ShaderStage.Geometry)
|
else if (config.Stage == ShaderStage.Geometry)
|
||||||
{
|
{
|
||||||
context.AddCapability(Capability.Geometry);
|
context.AddCapability(Capability.Geometry);
|
||||||
|
@@ -51,7 +51,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||||||
offset |= AttributeConsts.LoadOutputMask;
|
offset |= AttributeConsts.LoadOutputMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
Operand src = op.P ? AttributePerPatch(offset) : Attribute(offset);
|
Operand src = op.P ? AttributePerPatch(offset) : CreateInputAttribute(context, offset);
|
||||||
|
|
||||||
context.Copy(Register(rd), src);
|
context.Copy(Register(rd), src);
|
||||||
}
|
}
|
||||||
@@ -312,5 +312,22 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||||||
|
|
||||||
return attr;
|
return attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Operand CreateInputAttribute(EmitterContext context, int attr)
|
||||||
|
{
|
||||||
|
if (context.Config.Options.TargetApi == TargetApi.Vulkan)
|
||||||
|
{
|
||||||
|
if (attr == AttributeConsts.InstanceId)
|
||||||
|
{
|
||||||
|
return context.ISubtract(Attribute(AttributeConsts.InstanceIndex), Attribute(AttributeConsts.BaseInstance));
|
||||||
|
}
|
||||||
|
else if (attr == AttributeConsts.VertexId)
|
||||||
|
{
|
||||||
|
return Attribute(AttributeConsts.VertexIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Attribute(attr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -71,12 +71,12 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
|||||||
var locations = config.GpuAccessor.QueryTransformFeedbackVaryingLocations(tfbIndex);
|
var locations = config.GpuAccessor.QueryTransformFeedbackVaryingLocations(tfbIndex);
|
||||||
var stride = config.GpuAccessor.QueryTransformFeedbackStride(tfbIndex);
|
var stride = config.GpuAccessor.QueryTransformFeedbackStride(tfbIndex);
|
||||||
|
|
||||||
for (int j = 0; j < locations.Length; j++)
|
for (int i = 0; i < locations.Length; i++)
|
||||||
{
|
{
|
||||||
byte location = locations[j];
|
byte location = locations[i];
|
||||||
if (location < 0xc0)
|
if (location < 0xc0)
|
||||||
{
|
{
|
||||||
context.Info.TransformFeedbackOutputs[location] = new TransformFeedbackOutput(tfbIndex, j * 4, stride);
|
context.Info.TransformFeedbackOutputs[location] = new TransformFeedbackOutput(tfbIndex, i * 4, stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -42,5 +42,40 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
|||||||
|
|
||||||
TransformFeedbackOutputs = new TransformFeedbackOutput[0xc0];
|
TransformFeedbackOutputs = new TransformFeedbackOutput[0xc0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TransformFeedbackOutput GetTransformFeedbackOutput(int attr)
|
||||||
|
{
|
||||||
|
int index = attr / 4;
|
||||||
|
return TransformFeedbackOutputs[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetTransformFeedbackOutputComponents(int attr)
|
||||||
|
{
|
||||||
|
int index = attr / 4;
|
||||||
|
int baseIndex = index & ~3;
|
||||||
|
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
for (; count < 4; count++)
|
||||||
|
{
|
||||||
|
ref var prev = ref TransformFeedbackOutputs[baseIndex + count - 1];
|
||||||
|
ref var curr = ref TransformFeedbackOutputs[baseIndex + count];
|
||||||
|
|
||||||
|
int prevOffset = prev.Offset;
|
||||||
|
int currOffset = curr.Offset;
|
||||||
|
|
||||||
|
if (!prev.Valid || !curr.Valid || prevOffset + 4 != currOffset)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (baseIndex + count <= index)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -95,5 +95,10 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
public const int LtMask = 0x2000040;
|
public const int LtMask = 0x2000040;
|
||||||
|
|
||||||
public const int ThreadKill = 0x2000044;
|
public const int ThreadKill = 0x2000044;
|
||||||
|
|
||||||
|
public const int BaseInstance = 0x2000050;
|
||||||
|
public const int BaseVertex = 0x2000054;
|
||||||
|
public const int InstanceIndex = 0x2000058;
|
||||||
|
public const int VertexIndex = 0x200005c;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -27,6 +27,10 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
{ AttributeConsts.TessCoordY, new AttributeInfo(AttributeConsts.TessCoordX, 1, 3, AggregateType.Vector | AggregateType.FP32) },
|
{ AttributeConsts.TessCoordY, new AttributeInfo(AttributeConsts.TessCoordX, 1, 3, AggregateType.Vector | AggregateType.FP32) },
|
||||||
{ AttributeConsts.InstanceId, new AttributeInfo(AttributeConsts.InstanceId, 0, 1, AggregateType.S32) },
|
{ AttributeConsts.InstanceId, new AttributeInfo(AttributeConsts.InstanceId, 0, 1, AggregateType.S32) },
|
||||||
{ AttributeConsts.VertexId, new AttributeInfo(AttributeConsts.VertexId, 0, 1, AggregateType.S32) },
|
{ AttributeConsts.VertexId, new AttributeInfo(AttributeConsts.VertexId, 0, 1, AggregateType.S32) },
|
||||||
|
{ AttributeConsts.BaseInstance, new AttributeInfo(AttributeConsts.BaseInstance, 0, 1, AggregateType.S32) },
|
||||||
|
{ AttributeConsts.BaseVertex, new AttributeInfo(AttributeConsts.BaseVertex, 0, 1, AggregateType.S32) },
|
||||||
|
{ AttributeConsts.InstanceIndex, new AttributeInfo(AttributeConsts.InstanceIndex, 0, 1, AggregateType.S32) },
|
||||||
|
{ AttributeConsts.VertexIndex, new AttributeInfo(AttributeConsts.VertexIndex, 0, 1, AggregateType.S32) },
|
||||||
{ AttributeConsts.FrontFacing, new AttributeInfo(AttributeConsts.FrontFacing, 0, 1, AggregateType.Bool) },
|
{ AttributeConsts.FrontFacing, new AttributeInfo(AttributeConsts.FrontFacing, 0, 1, AggregateType.Bool) },
|
||||||
|
|
||||||
// Special.
|
// Special.
|
||||||
|
@@ -17,6 +17,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
public ShaderStage Stage { get; }
|
public ShaderStage Stage { get; }
|
||||||
|
|
||||||
public bool GpPassthrough { get; }
|
public bool GpPassthrough { get; }
|
||||||
|
public bool LastInPipeline { get; private set; }
|
||||||
public bool LastInVertexPipeline { get; private set; }
|
public bool LastInVertexPipeline { get; private set; }
|
||||||
|
|
||||||
public int ThreadsPerInputPrimitive { get; }
|
public int ThreadsPerInputPrimitive { get; }
|
||||||
@@ -143,6 +144,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
OmapSampleMask = header.OmapSampleMask;
|
OmapSampleMask = header.OmapSampleMask;
|
||||||
OmapDepth = header.OmapDepth;
|
OmapDepth = header.OmapDepth;
|
||||||
TransformFeedbackEnabled = gpuAccessor.QueryTransformFeedbackEnabled();
|
TransformFeedbackEnabled = gpuAccessor.QueryTransformFeedbackEnabled();
|
||||||
|
LastInPipeline = true;
|
||||||
LastInVertexPipeline = header.Stage < ShaderStage.Fragment;
|
LastInVertexPipeline = header.Stage < ShaderStage.Fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +256,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
|
|
||||||
UsedInputAttributes |= mask;
|
UsedInputAttributes |= mask;
|
||||||
_thisUsedInputAttributes |= mask;
|
_thisUsedInputAttributes |= mask;
|
||||||
ThisInputAttributesComponents |= UInt128.Pow2(index * 4 + component);
|
ThisInputAttributesComponents |= UInt128.One << (index * 4 + component);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetInputUserAttributePerPatch(int index)
|
public void SetInputUserAttributePerPatch(int index)
|
||||||
@@ -306,6 +308,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
config._perPatchAttributeLocations = locationsMap;
|
config._perPatchAttributeLocations = locationsMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LastInPipeline = false;
|
||||||
|
|
||||||
// We don't consider geometry shaders using the geometry shader passthrough feature
|
// We don't consider geometry shaders using the geometry shader passthrough feature
|
||||||
// as being the last because when this feature is used, it can't actually modify any of the outputs,
|
// as being the last because when this feature is used, it can't actually modify any of the outputs,
|
||||||
// so the stage that comes before it is the last one that can do modifications.
|
// so the stage that comes before it is the last one that can do modifications.
|
||||||
|
@@ -190,10 +190,10 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
UInt128 usedAttributes = context.Config.NextInputAttributesComponents;
|
UInt128 usedAttributes = context.Config.NextInputAttributesComponents;
|
||||||
while (usedAttributes != UInt128.Zero)
|
while (usedAttributes != UInt128.Zero)
|
||||||
{
|
{
|
||||||
int index = usedAttributes.TrailingZeroCount();
|
int index = (int)UInt128.TrailingZeroCount(usedAttributes);
|
||||||
int vecIndex = index / 4;
|
int vecIndex = index / 4;
|
||||||
|
|
||||||
usedAttributes &= ~UInt128.Pow2(index);
|
usedAttributes &= ~(UInt128.One << index);
|
||||||
|
|
||||||
// We don't need to initialize passthrough attributes.
|
// We don't need to initialize passthrough attributes.
|
||||||
if ((context.Config.PassthroughAttributes & (1 << vecIndex)) != 0)
|
if ((context.Config.PassthroughAttributes & (1 << vecIndex)) != 0)
|
||||||
|
@@ -1,112 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Numerics;
|
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Shader.Translation
|
|
||||||
{
|
|
||||||
struct UInt128 : IEquatable<UInt128>
|
|
||||||
{
|
|
||||||
public static UInt128 Zero => new UInt128() { _v0 = 0, _v1 = 0 };
|
|
||||||
|
|
||||||
private ulong _v0;
|
|
||||||
private ulong _v1;
|
|
||||||
|
|
||||||
public UInt128(ulong low, ulong high)
|
|
||||||
{
|
|
||||||
_v0 = low;
|
|
||||||
_v1 = high;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int TrailingZeroCount()
|
|
||||||
{
|
|
||||||
int count = BitOperations.TrailingZeroCount(_v0);
|
|
||||||
if (count == 64)
|
|
||||||
{
|
|
||||||
count += BitOperations.TrailingZeroCount(_v1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UInt128 Pow2(int x)
|
|
||||||
{
|
|
||||||
if (x >= 64)
|
|
||||||
{
|
|
||||||
return new UInt128(0, 1UL << (x - 64));
|
|
||||||
}
|
|
||||||
|
|
||||||
return new UInt128(1UL << x, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UInt128 operator ~(UInt128 x)
|
|
||||||
{
|
|
||||||
return new UInt128(~x._v0, ~x._v1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UInt128 operator &(UInt128 x, UInt128 y)
|
|
||||||
{
|
|
||||||
return new UInt128(x._v0 & y._v0, x._v1 & y._v1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UInt128 operator |(UInt128 x, UInt128 y)
|
|
||||||
{
|
|
||||||
return new UInt128(x._v0 | y._v0, x._v1 | y._v1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UInt128 operator <<(UInt128 x, int shift)
|
|
||||||
{
|
|
||||||
if (shift == 0)
|
|
||||||
{
|
|
||||||
return new UInt128(x._v0, x._v1);
|
|
||||||
}
|
|
||||||
else if (shift >= 64)
|
|
||||||
{
|
|
||||||
return new UInt128(0, x._v0 << (shift - 64));
|
|
||||||
}
|
|
||||||
|
|
||||||
ulong shiftOut = x._v0 >> (64 - shift);
|
|
||||||
|
|
||||||
return new UInt128(x._v0 << shift, (x._v1 << shift) | shiftOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UInt128 operator >>(UInt128 x, int shift)
|
|
||||||
{
|
|
||||||
if (shift == 0)
|
|
||||||
{
|
|
||||||
return new UInt128(x._v0, x._v1);
|
|
||||||
}
|
|
||||||
else if (shift >= 64)
|
|
||||||
{
|
|
||||||
return new UInt128(x._v1 >> (shift - 64), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ulong shiftOut = x._v1 & ((1UL << shift) - 1);
|
|
||||||
|
|
||||||
return new UInt128((x._v0 >> shift) | (shiftOut << (64 - shift)), x._v1 >> shift);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator ==(UInt128 x, UInt128 y)
|
|
||||||
{
|
|
||||||
return x.Equals(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator !=(UInt128 x, UInt128 y)
|
|
||||||
{
|
|
||||||
return !x.Equals(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
|
||||||
{
|
|
||||||
return obj is UInt128 other && Equals(other);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Equals(UInt128 other)
|
|
||||||
{
|
|
||||||
return _v0 == other._v0 && _v1 == other._v1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return HashCode.Combine(_v0, _v1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -229,8 +229,8 @@ namespace Ryujinx.Graphics.Vic.Image
|
|||||||
|
|
||||||
private static RentedBuffer ReadBuffer(
|
private static RentedBuffer ReadBuffer(
|
||||||
ResourceManager rm,
|
ResourceManager rm,
|
||||||
ref SlotConfig config,
|
scoped ref SlotConfig config,
|
||||||
ref Array8<PlaneOffsets> offsets,
|
scoped ref Array8<PlaneOffsets> offsets,
|
||||||
bool linear,
|
bool linear,
|
||||||
int plane,
|
int plane,
|
||||||
int width,
|
int width,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -138,11 +138,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
public void SetImage(int binding, ITexture image, GAL.Format imageFormat)
|
public void SetImage(int binding, ITexture image, GAL.Format imageFormat)
|
||||||
{
|
{
|
||||||
if (image == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (image is TextureBuffer imageBuffer)
|
if (image is TextureBuffer imageBuffer)
|
||||||
{
|
{
|
||||||
_bufferImageRefs[binding] = imageBuffer;
|
_bufferImageRefs[binding] = imageBuffer;
|
||||||
@@ -152,6 +147,12 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
_imageRefs[binding] = view.GetView(imageFormat).GetIdentityImageView();
|
_imageRefs[binding] = view.GetView(imageFormat).GetIdentityImageView();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_imageRefs[binding] = null;
|
||||||
|
_bufferImageRefs[binding] = null;
|
||||||
|
_bufferImageFormats[binding] = default;
|
||||||
|
}
|
||||||
|
|
||||||
SignalDirty(DirtyFlags.Image);
|
SignalDirty(DirtyFlags.Image);
|
||||||
}
|
}
|
||||||
@@ -215,24 +216,23 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
public void SetTextureAndSampler(CommandBufferScoped cbs, ShaderStage stage, int binding, ITexture texture, ISampler sampler)
|
public void SetTextureAndSampler(CommandBufferScoped cbs, ShaderStage stage, int binding, ITexture texture, ISampler sampler)
|
||||||
{
|
{
|
||||||
if (texture == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texture is TextureBuffer textureBuffer)
|
if (texture is TextureBuffer textureBuffer)
|
||||||
{
|
{
|
||||||
_bufferTextureRefs[binding] = textureBuffer;
|
_bufferTextureRefs[binding] = textureBuffer;
|
||||||
}
|
}
|
||||||
else
|
else if (texture is TextureView view)
|
||||||
{
|
{
|
||||||
TextureView view = (TextureView)texture;
|
|
||||||
|
|
||||||
view.Storage.InsertBarrier(cbs, AccessFlags.AccessShaderReadBit, stage.ConvertToPipelineStageFlags());
|
view.Storage.InsertBarrier(cbs, AccessFlags.AccessShaderReadBit, stage.ConvertToPipelineStageFlags());
|
||||||
|
|
||||||
_textureRefs[binding] = view.GetImageView();
|
_textureRefs[binding] = view.GetImageView();
|
||||||
_samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();
|
_samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_textureRefs[binding] = null;
|
||||||
|
_samplerRefs[binding] = null;
|
||||||
|
_bufferTextureRefs[binding] = null;
|
||||||
|
}
|
||||||
|
|
||||||
SignalDirty(DirtyFlags.Texture);
|
SignalDirty(DirtyFlags.Texture);
|
||||||
}
|
}
|
||||||
|
@@ -81,232 +81,208 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
set => Internal.Id5 = (Internal.Id5 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
set => Internal.Id5 = (Internal.Id5 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float BlendConstantR
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id6 >> 0) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFFF00000000) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float BlendConstantG
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id6 >> 32) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float BlendConstantB
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id7 >> 0) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFF00000000) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float BlendConstantA
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id7 >> 32) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PolygonMode PolygonMode
|
public PolygonMode PolygonMode
|
||||||
{
|
{
|
||||||
get => (PolygonMode)((Internal.Id8 >> 0) & 0x3FFFFFFF);
|
get => (PolygonMode)((Internal.Id6 >> 0) & 0x3FFFFFFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFFFC0000000) | ((ulong)value << 0);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFFFC0000000) | ((ulong)value << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint StagesCount
|
public uint StagesCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 30) & 0xFF);
|
get => (byte)((Internal.Id6 >> 30) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFC03FFFFFFF) | ((ulong)value << 30);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFC03FFFFFFF) | ((ulong)value << 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint VertexAttributeDescriptionsCount
|
public uint VertexAttributeDescriptionsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 38) & 0xFF);
|
get => (byte)((Internal.Id6 >> 38) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFFFC03FFFFFFFFF) | ((ulong)value << 38);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFFFC03FFFFFFFFF) | ((ulong)value << 38);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint VertexBindingDescriptionsCount
|
public uint VertexBindingDescriptionsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 46) & 0xFF);
|
get => (byte)((Internal.Id6 >> 46) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFC03FFFFFFFFFFF) | ((ulong)value << 46);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFC03FFFFFFFFFFF) | ((ulong)value << 46);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint ViewportsCount
|
public uint ViewportsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 54) & 0xFF);
|
get => (byte)((Internal.Id6 >> 54) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xC03FFFFFFFFFFFFF) | ((ulong)value << 54);
|
set => Internal.Id6 = (Internal.Id6 & 0xC03FFFFFFFFFFFFF) | ((ulong)value << 54);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint ScissorsCount
|
public uint ScissorsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id9 >> 0) & 0xFF);
|
get => (byte)((Internal.Id7 >> 0) & 0xFF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFFFF00) | ((ulong)value << 0);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFFFFFF00) | ((ulong)value << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint ColorBlendAttachmentStateCount
|
public uint ColorBlendAttachmentStateCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id9 >> 8) & 0xFF);
|
get => (byte)((Internal.Id7 >> 8) & 0xFF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFF00FF) | ((ulong)value << 8);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFFFF00FF) | ((ulong)value << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PrimitiveTopology Topology
|
public PrimitiveTopology Topology
|
||||||
{
|
{
|
||||||
get => (PrimitiveTopology)((Internal.Id9 >> 16) & 0xF);
|
get => (PrimitiveTopology)((Internal.Id7 >> 16) & 0xF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFF0FFFF) | ((ulong)value << 16);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFFF0FFFF) | ((ulong)value << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogicOp LogicOp
|
public LogicOp LogicOp
|
||||||
{
|
{
|
||||||
get => (LogicOp)((Internal.Id9 >> 20) & 0xF);
|
get => (LogicOp)((Internal.Id7 >> 20) & 0xF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFF0FFFFF) | ((ulong)value << 20);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFF0FFFFF) | ((ulong)value << 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompareOp DepthCompareOp
|
public CompareOp DepthCompareOp
|
||||||
{
|
{
|
||||||
get => (CompareOp)((Internal.Id9 >> 24) & 0x7);
|
get => (CompareOp)((Internal.Id7 >> 24) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFF8FFFFFF) | ((ulong)value << 24);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFF8FFFFFF) | ((ulong)value << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilFrontFailOp
|
public StencilOp StencilFrontFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 27) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 27) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFC7FFFFFF) | ((ulong)value << 27);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFC7FFFFFF) | ((ulong)value << 27);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilFrontPassOp
|
public StencilOp StencilFrontPassOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 30) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 30) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFE3FFFFFFF) | ((ulong)value << 30);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFE3FFFFFFF) | ((ulong)value << 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilFrontDepthFailOp
|
public StencilOp StencilFrontDepthFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 33) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 33) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFF1FFFFFFFF) | ((ulong)value << 33);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFF1FFFFFFFF) | ((ulong)value << 33);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompareOp StencilFrontCompareOp
|
public CompareOp StencilFrontCompareOp
|
||||||
{
|
{
|
||||||
get => (CompareOp)((Internal.Id9 >> 36) & 0x7);
|
get => (CompareOp)((Internal.Id7 >> 36) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFF8FFFFFFFFF) | ((ulong)value << 36);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFF8FFFFFFFFF) | ((ulong)value << 36);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilBackFailOp
|
public StencilOp StencilBackFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 39) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 39) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFC7FFFFFFFFF) | ((ulong)value << 39);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFC7FFFFFFFFF) | ((ulong)value << 39);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilBackPassOp
|
public StencilOp StencilBackPassOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 42) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 42) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFE3FFFFFFFFFF) | ((ulong)value << 42);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFE3FFFFFFFFFF) | ((ulong)value << 42);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilBackDepthFailOp
|
public StencilOp StencilBackDepthFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 45) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 45) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFF1FFFFFFFFFFF) | ((ulong)value << 45);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFF1FFFFFFFFFFF) | ((ulong)value << 45);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompareOp StencilBackCompareOp
|
public CompareOp StencilBackCompareOp
|
||||||
{
|
{
|
||||||
get => (CompareOp)((Internal.Id9 >> 48) & 0x7);
|
get => (CompareOp)((Internal.Id7 >> 48) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFF8FFFFFFFFFFFF) | ((ulong)value << 48);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFF8FFFFFFFFFFFF) | ((ulong)value << 48);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CullModeFlags CullMode
|
public CullModeFlags CullMode
|
||||||
{
|
{
|
||||||
get => (CullModeFlags)((Internal.Id9 >> 51) & 0x3);
|
get => (CullModeFlags)((Internal.Id7 >> 51) & 0x3);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFE7FFFFFFFFFFFF) | ((ulong)value << 51);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFE7FFFFFFFFFFFF) | ((ulong)value << 51);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool PrimitiveRestartEnable
|
public bool PrimitiveRestartEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 53) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 53) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFDFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 53);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFDFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 53);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthClampEnable
|
public bool DepthClampEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 54) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 54) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFBFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 54);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFBFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 54);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RasterizerDiscardEnable
|
public bool RasterizerDiscardEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 55) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 55) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFF7FFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 55);
|
set => Internal.Id7 = (Internal.Id7 & 0xFF7FFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 55);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FrontFace FrontFace
|
public FrontFace FrontFace
|
||||||
{
|
{
|
||||||
get => (FrontFace)((Internal.Id9 >> 56) & 0x1);
|
get => (FrontFace)((Internal.Id7 >> 56) & 0x1);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFEFFFFFFFFFFFFFF) | ((ulong)value << 56);
|
set => Internal.Id7 = (Internal.Id7 & 0xFEFFFFFFFFFFFFFF) | ((ulong)value << 56);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthBiasEnable
|
public bool DepthBiasEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 57) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 57) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFDFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 57);
|
set => Internal.Id7 = (Internal.Id7 & 0xFDFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 57);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthTestEnable
|
public bool DepthTestEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 58) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 58) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFBFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 58);
|
set => Internal.Id7 = (Internal.Id7 & 0xFBFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 58);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthWriteEnable
|
public bool DepthWriteEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 59) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 59) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xF7FFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 59);
|
set => Internal.Id7 = (Internal.Id7 & 0xF7FFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 59);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthBoundsTestEnable
|
public bool DepthBoundsTestEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 60) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 60) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xEFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 60);
|
set => Internal.Id7 = (Internal.Id7 & 0xEFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool StencilTestEnable
|
public bool StencilTestEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 61) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 61) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xDFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 61);
|
set => Internal.Id7 = (Internal.Id7 & 0xDFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 61);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LogicOpEnable
|
public bool LogicOpEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 62) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 62) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xBFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 62);
|
set => Internal.Id7 = (Internal.Id7 & 0xBFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 62);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasDepthStencil
|
public bool HasDepthStencil
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 63) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 63) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0x7FFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 63);
|
set => Internal.Id7 = (Internal.Id7 & 0x7FFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 63);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint PatchControlPoints
|
public uint PatchControlPoints
|
||||||
{
|
{
|
||||||
get => (uint)((Internal.Id10 >> 0) & 0xFFFFFFFF);
|
get => (uint)((Internal.Id8 >> 0) & 0xFFFFFFFF);
|
||||||
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF00000000) | ((ulong)value << 0);
|
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFFF00000000) | ((ulong)value << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint SamplesCount
|
public uint SamplesCount
|
||||||
{
|
{
|
||||||
get => (uint)((Internal.Id10 >> 32) & 0xFFFFFFFF);
|
get => (uint)((Internal.Id8 >> 32) & 0xFFFFFFFF);
|
||||||
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF) | ((ulong)value << 32);
|
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFFF) | ((ulong)value << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AlphaToCoverageEnable
|
public bool AlphaToCoverageEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id11 >> 0) & 0x1) != 0UL;
|
get => ((Internal.Id9 >> 0) & 0x1) != 0UL;
|
||||||
set => Internal.Id11 = (Internal.Id11 & 0xFFFFFFFFFFFFFFFE) | ((value ? 1UL : 0UL) << 0);
|
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFFFFFE) | ((value ? 1UL : 0UL) << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AlphaToOneEnable
|
public bool AlphaToOneEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id11 >> 1) & 0x1) != 0UL;
|
get => ((Internal.Id9 >> 1) & 0x1) != 0UL;
|
||||||
set => Internal.Id11 = (Internal.Id11 & 0xFFFFFFFFFFFFFFFD) | ((value ? 1UL : 0UL) << 1);
|
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFFFFFD) | ((value ? 1UL : 0UL) << 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
||||||
@@ -510,11 +486,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
PAttachments = pColorBlendAttachmentState
|
PAttachments = pColorBlendAttachmentState
|
||||||
};
|
};
|
||||||
|
|
||||||
colorBlendState.BlendConstants[0] = BlendConstantR;
|
|
||||||
colorBlendState.BlendConstants[1] = BlendConstantG;
|
|
||||||
colorBlendState.BlendConstants[2] = BlendConstantB;
|
|
||||||
colorBlendState.BlendConstants[3] = BlendConstantA;
|
|
||||||
|
|
||||||
bool supportsExtDynamicState = gd.Capabilities.SupportsExtendedDynamicState;
|
bool supportsExtDynamicState = gd.Capabilities.SupportsExtendedDynamicState;
|
||||||
int dynamicStatesCount = supportsExtDynamicState ? 9 : 8;
|
int dynamicStatesCount = supportsExtDynamicState ? 9 : 8;
|
||||||
|
|
||||||
|
@@ -21,15 +21,13 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
public ulong Id8;
|
public ulong Id8;
|
||||||
public ulong Id9;
|
public ulong Id9;
|
||||||
public ulong Id10;
|
|
||||||
public ulong Id11;
|
|
||||||
|
|
||||||
private uint VertexAttributeDescriptionsCount => (byte)((Id8 >> 38) & 0xFF);
|
private uint VertexAttributeDescriptionsCount => (byte)((Id6 >> 38) & 0xFF);
|
||||||
private uint VertexBindingDescriptionsCount => (byte)((Id8 >> 46) & 0xFF);
|
private uint VertexBindingDescriptionsCount => (byte)((Id6 >> 46) & 0xFF);
|
||||||
private uint ViewportsCount => (byte)((Id8 >> 54) & 0xFF);
|
private uint ViewportsCount => (byte)((Id6 >> 54) & 0xFF);
|
||||||
private uint ScissorsCount => (byte)((Id9 >> 0) & 0xFF);
|
private uint ScissorsCount => (byte)((Id7 >> 0) & 0xFF);
|
||||||
private uint ColorBlendAttachmentStateCount => (byte)((Id9 >> 8) & 0xFF);
|
private uint ColorBlendAttachmentStateCount => (byte)((Id7 >> 8) & 0xFF);
|
||||||
private bool HasDepthStencil => ((Id9 >> 63) & 0x1) != 0UL;
|
private bool HasDepthStencil => ((Id7 >> 63) & 0x1) != 0UL;
|
||||||
|
|
||||||
public Array32<VertexInputAttributeDescription> VertexAttributeDescriptions;
|
public Array32<VertexInputAttributeDescription> VertexAttributeDescriptions;
|
||||||
public Array33<VertexInputBindingDescription> VertexBindingDescriptions;
|
public Array33<VertexInputBindingDescription> VertexBindingDescriptions;
|
||||||
@@ -47,7 +45,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
if (!Unsafe.As<ulong, Vector256<byte>>(ref Id0).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id0)) ||
|
if (!Unsafe.As<ulong, Vector256<byte>>(ref Id0).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id0)) ||
|
||||||
!Unsafe.As<ulong, Vector256<byte>>(ref Id4).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id4)) ||
|
!Unsafe.As<ulong, Vector256<byte>>(ref Id4).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id4)) ||
|
||||||
!Unsafe.As<ulong, Vector256<byte>>(ref Id8).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id8)))
|
!Unsafe.As<ulong, Vector128<byte>>(ref Id8).Equals(Unsafe.As<ulong, Vector128<byte>>(ref other.Id8)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -91,9 +89,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
Id6 * 23 ^
|
Id6 * 23 ^
|
||||||
Id7 * 23 ^
|
Id7 * 23 ^
|
||||||
Id8 * 23 ^
|
Id8 * 23 ^
|
||||||
Id9 * 23 ^
|
Id9 * 23;
|
||||||
Id10 * 23 ^
|
|
||||||
Id11 * 23;
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)VertexAttributeDescriptionsCount; i++)
|
for (int i = 0; i < (int)VertexAttributeDescriptionsCount; i++)
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
|
@@ -9,10 +9,10 @@ using LibHac.Tools.FsSystem;
|
|||||||
using LibHac.Tools.FsSystem.NcaUtils;
|
using LibHac.Tools.FsSystem.NcaUtils;
|
||||||
using LibHac.Tools.Ncm;
|
using LibHac.Tools.Ncm;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.HLE.Exceptions;
|
using Ryujinx.HLE.Exceptions;
|
||||||
using Ryujinx.HLE.HOS.Services.Ssl;
|
using Ryujinx.HLE.HOS.Services.Ssl;
|
||||||
using Ryujinx.HLE.HOS.Services.Time;
|
using Ryujinx.HLE.HOS.Services.Time;
|
||||||
using Ryujinx.HLE.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -354,7 +354,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||||||
{
|
{
|
||||||
if (_contentDictionary.ContainsKey((titleId, contentType)))
|
if (_contentDictionary.ContainsKey((titleId, contentType)))
|
||||||
{
|
{
|
||||||
return new UInt128(_contentDictionary[(titleId, contentType)]);
|
return UInt128Utils.FromHex(_contentDictionary[(titleId, contentType)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ using Ryujinx.Audio.Integration;
|
|||||||
using Ryujinx.Audio.Output;
|
using Ryujinx.Audio.Output;
|
||||||
using Ryujinx.Audio.Renderer.Device;
|
using Ryujinx.Audio.Renderer.Device;
|
||||||
using Ryujinx.Audio.Renderer.Server;
|
using Ryujinx.Audio.Renderer.Server;
|
||||||
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.Cpu;
|
using Ryujinx.Cpu;
|
||||||
using Ryujinx.Cpu.Jit;
|
using Ryujinx.Cpu.Jit;
|
||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
@@ -35,7 +36,6 @@ using Ryujinx.HLE.HOS.Services.SurfaceFlinger;
|
|||||||
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
||||||
using Ryujinx.HLE.HOS.SystemState;
|
using Ryujinx.HLE.HOS.SystemState;
|
||||||
using Ryujinx.HLE.Loaders.Executables;
|
using Ryujinx.HLE.Loaders.Executables;
|
||||||
using Ryujinx.HLE.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
|
|
||||||
// TODO: use set:sys (and get external clock source id from settings)
|
// TODO: use set:sys (and get external clock source id from settings)
|
||||||
// TODO: use "time!standard_steady_clock_rtc_update_interval_minutes" and implement a worker thread to be accurate.
|
// TODO: use "time!standard_steady_clock_rtc_update_interval_minutes" and implement a worker thread to be accurate.
|
||||||
UInt128 clockSourceId = new UInt128(Guid.NewGuid().ToByteArray());
|
UInt128 clockSourceId = UInt128Utils.CreateRandom();
|
||||||
IRtcManager.GetExternalRtcValue(out ulong rtcValue);
|
IRtcManager.GetExternalRtcValue(out ulong rtcValue);
|
||||||
|
|
||||||
// We assume the rtc is system time.
|
// We assume the rtc is system time.
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using LibHac.Account;
|
using LibHac.Account;
|
||||||
using Ryujinx.HLE.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -83,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||||||
|
|
||||||
public readonly UInt128 ToUInt128()
|
public readonly UInt128 ToUInt128()
|
||||||
{
|
{
|
||||||
return new UInt128(Low, High);
|
return new UInt128((ulong)High, (ulong)Low);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.Common.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Buffers.Binary;
|
using System.Buffers.Binary;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Mii
|
|||||||
public static UInt128 GetDeviceId()
|
public static UInt128 GetDeviceId()
|
||||||
{
|
{
|
||||||
// FIXME: call set:sys GetMiiAuthorId
|
// FIXME: call set:sys GetMiiAuthorId
|
||||||
return new UInt128("5279754d69694e780000000000000000"); // RyuMiiNx
|
return UInt128Utils.FromHex("5279754d69694e780000000000000000"); // RyuMiiNx
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ReadOnlySpan<byte> Ver3FacelineColorTable => new byte[] { 0, 1, 2, 3, 4, 5 };
|
public static ReadOnlySpan<byte> Ver3FacelineColorTable => new byte[] { 0, 1, 2, 3, 4, 5 };
|
||||||
|
@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
|
|||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential, Size = 0x58)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x58)]
|
||||||
struct CharInfo : IStoredData<CharInfo>
|
struct CharInfo : IStoredData<CharInfo>
|
||||||
{
|
{
|
||||||
public CreateId CreateId;
|
public CreateId CreateId;
|
||||||
|
@@ -1,20 +1,19 @@
|
|||||||
using Ryujinx.HLE.Utilities;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)]
|
||||||
struct CreateId : IEquatable<CreateId>
|
struct CreateId : IEquatable<CreateId>
|
||||||
{
|
{
|
||||||
public UInt128 Raw;
|
public UInt128 Raw;
|
||||||
|
|
||||||
public bool IsNull => Raw.IsNull;
|
public bool IsNull => Raw == UInt128.Zero;
|
||||||
public bool IsValid => !IsNull && (Raw.High & 0xC0) == 0x80;
|
public bool IsValid => !IsNull && ((Raw >> 64) & 0xC0) == 0x80;
|
||||||
|
|
||||||
public CreateId(byte[] data)
|
public CreateId(UInt128 raw)
|
||||||
{
|
{
|
||||||
Raw = new UInt128(data);
|
Raw = raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool operator ==(CreateId x, CreateId y)
|
public static bool operator ==(CreateId x, CreateId y)
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.HLE.Utilities;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 4, Size = Size)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = Size)]
|
||||||
struct StoreData : IStoredData<StoreData>
|
struct StoreData : IStoredData<StoreData>
|
||||||
{
|
{
|
||||||
public const int Size = 0x44;
|
public const int Size = 0x44;
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Ryujinx.Cpu;
|
using Ryujinx.Common.Utilities;
|
||||||
|
using Ryujinx.Cpu;
|
||||||
using Ryujinx.HLE.HOS.Services.Mii.Types;
|
using Ryujinx.HLE.HOS.Services.Mii.Types;
|
||||||
using Ryujinx.HLE.HOS.Services.Time;
|
using Ryujinx.HLE.HOS.Services.Time;
|
||||||
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
||||||
@@ -62,7 +63,13 @@ namespace Ryujinx.HLE.HOS.Services.Mii
|
|||||||
|
|
||||||
public CreateId MakeCreateId()
|
public CreateId MakeCreateId()
|
||||||
{
|
{
|
||||||
return new CreateId(Guid.NewGuid().ToByteArray());
|
UInt128 value = UInt128Utils.CreateRandom();
|
||||||
|
|
||||||
|
// Ensure the random ID generated is valid as a create id.
|
||||||
|
value &= ~new UInt128(0xC0, 0);
|
||||||
|
value |= new UInt128(0x80, 0);
|
||||||
|
|
||||||
|
return new CreateId(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.HLE.HOS.Services.Nifm.StaticService.GeneralService;
|
using Ryujinx.HLE.HOS.Services.Nifm.StaticService.GeneralService;
|
||||||
using Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types;
|
using Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types;
|
||||||
using Ryujinx.HLE.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
@@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
|
|||||||
|
|
||||||
NetworkProfileData networkProfile = new NetworkProfileData
|
NetworkProfileData networkProfile = new NetworkProfileData
|
||||||
{
|
{
|
||||||
Uuid = new UInt128(Guid.NewGuid().ToByteArray())
|
Uuid = UInt128Utils.CreateRandom()
|
||||||
};
|
};
|
||||||
|
|
||||||
networkProfile.IpSettingData.IpAddressSetting = new IpAddressSetting(interfaceProperties, unicastAddress);
|
networkProfile.IpSettingData.IpAddressSetting = new IpAddressSetting(interfaceProperties, unicastAddress);
|
||||||
|
@@ -14,14 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
|
|||||||
|
|
||||||
public DnsSetting(IPInterfaceProperties interfaceProperties)
|
public DnsSetting(IPInterfaceProperties interfaceProperties)
|
||||||
{
|
{
|
||||||
try
|
IsDynamicDnsEnabled = OperatingSystem.IsWindows() && interfaceProperties.IsDynamicDnsEnabled;
|
||||||
{
|
|
||||||
IsDynamicDnsEnabled = interfaceProperties.IsDynamicDnsEnabled;
|
|
||||||
}
|
|
||||||
catch (PlatformNotSupportedException)
|
|
||||||
{
|
|
||||||
IsDynamicDnsEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interfaceProperties.DnsAddresses.Count == 0)
|
if (interfaceProperties.DnsAddresses.Count == 0)
|
||||||
{
|
{
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using System.Net.NetworkInformation;
|
using System;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
|
namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
|
||||||
@@ -14,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
|
|||||||
|
|
||||||
public IpAddressSetting(IPInterfaceProperties interfaceProperties, UnicastIPAddressInformation unicastIPAddressInformation)
|
public IpAddressSetting(IPInterfaceProperties interfaceProperties, UnicastIPAddressInformation unicastIPAddressInformation)
|
||||||
{
|
{
|
||||||
IsDhcpEnabled = interfaceProperties.DhcpServerAddresses.Count != 0;
|
IsDhcpEnabled = !OperatingSystem.IsMacOS() && interfaceProperties.DhcpServerAddresses.Count != 0;
|
||||||
Address = new IpV4Address(unicastIPAddressInformation.Address);
|
Address = new IpV4Address(unicastIPAddressInformation.Address);
|
||||||
IPv4Mask = new IpV4Address(unicastIPAddressInformation.IPv4Mask);
|
IPv4Mask = new IpV4Address(unicastIPAddressInformation.IPv4Mask);
|
||||||
GatewayAddress = new IpV4Address(interfaceProperties.GatewayAddresses[0].Address);
|
GatewayAddress = new IpV4Address(interfaceProperties.GatewayAddresses[0].Address);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
using Ryujinx.Common.Memory;
|
using Ryujinx.Common.Memory;
|
||||||
using Ryujinx.HLE.Utilities;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
|
namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
|
||||||
|
@@ -5,9 +5,9 @@ using LibHac.Fs.Fsa;
|
|||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.Ncm;
|
using LibHac.Ncm;
|
||||||
using LibHac.Tools.FsSystem.NcaUtils;
|
using LibHac.Tools.FsSystem.NcaUtils;
|
||||||
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.SystemState;
|
using Ryujinx.HLE.HOS.SystemState;
|
||||||
using Ryujinx.HLE.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -290,9 +290,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
|||||||
// NOTE: If miiAuthorId is null ResultCode.NullMiiAuthorIdBuffer is returned.
|
// NOTE: If miiAuthorId is null ResultCode.NullMiiAuthorIdBuffer is returned.
|
||||||
// Doesn't occur in our case.
|
// Doesn't occur in our case.
|
||||||
|
|
||||||
UInt128 miiAuthorId = Mii.Helper.GetDeviceId();
|
context.ResponseData.Write(Mii.Helper.GetDeviceId());
|
||||||
|
|
||||||
miiAuthorId.Write(context.ResponseData);
|
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
@@ -66,6 +66,8 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
|
|||||||
EndSslOperation();
|
EndSslOperation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: We silence warnings about TLS 1.0 and 1.1 as games will likely use it.
|
||||||
|
#pragma warning disable SYSLIB0039
|
||||||
private static SslProtocols TranslateSslVersion(SslVersion version)
|
private static SslProtocols TranslateSslVersion(SslVersion version)
|
||||||
{
|
{
|
||||||
switch (version & SslVersion.VersionMask)
|
switch (version & SslVersion.VersionMask)
|
||||||
@@ -84,6 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
|
|||||||
throw new NotImplementedException(version.ToString());
|
throw new NotImplementedException(version.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore SYSLIB0039
|
||||||
|
|
||||||
public ResultCode Handshake(string hostName)
|
public ResultCode Handshake(string hostName)
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
using Ryujinx.Cpu;
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.Cpu;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
||||||
@@ -12,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
|||||||
|
|
||||||
public SteadyClockCore()
|
public SteadyClockCore()
|
||||||
{
|
{
|
||||||
_clockSourceId = new UInt128(Guid.NewGuid().ToByteArray());
|
_clockSourceId = UInt128Utils.CreateRandom();
|
||||||
_isRtcResetDetected = false;
|
_isRtcResetDetected = false;
|
||||||
_isInitialized = false;
|
_isInitialized = false;
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.Common.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
struct SteadyClockTimePoint
|
struct SteadyClockTimePoint
|
||||||
{
|
{
|
||||||
public long TimePoint;
|
public long TimePoint;
|
||||||
@@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
|||||||
return new SteadyClockTimePoint
|
return new SteadyClockTimePoint
|
||||||
{
|
{
|
||||||
TimePoint = 0,
|
TimePoint = 0,
|
||||||
ClockSourceId = new UInt128(Guid.NewGuid().ToByteArray())
|
ClockSourceId = UInt128Utils.CreateRandom()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
struct SystemClockContext
|
struct SystemClockContext
|
||||||
{
|
{
|
||||||
public long Offset;
|
public long Offset;
|
||||||
|
@@ -3,7 +3,7 @@ using Ryujinx.HLE.Exceptions;
|
|||||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||||
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
||||||
using Ryujinx.HLE.HOS.Services.Time.TimeZone;
|
using Ryujinx.HLE.HOS.Services.Time.TimeZone;
|
||||||
using Ryujinx.HLE.Utilities;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Time
|
namespace Ryujinx.HLE.HOS.Services.Time
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using Ryujinx.Common.Memory;
|
using Ryujinx.Common.Memory;
|
||||||
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
||||||
using Ryujinx.HLE.Utilities;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
using Ryujinx.HLE.Utilities;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Time.Types
|
namespace Ryujinx.HLE.HOS.Services.Time.Types
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
struct SteadyClockContext
|
struct SteadyClockContext
|
||||||
{
|
{
|
||||||
public ulong InternalOffset;
|
public ulong InternalOffset;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -1,75 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.Utilities
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
public struct UInt128 : IEquatable<UInt128>
|
|
||||||
{
|
|
||||||
public readonly long Low;
|
|
||||||
public readonly long High;
|
|
||||||
|
|
||||||
public bool IsNull => (Low | High) == 0;
|
|
||||||
|
|
||||||
public UInt128(long low, long high)
|
|
||||||
{
|
|
||||||
Low = low;
|
|
||||||
High = high;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UInt128(byte[] bytes)
|
|
||||||
{
|
|
||||||
Low = BitConverter.ToInt64(bytes, 0);
|
|
||||||
High = BitConverter.ToInt64(bytes, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UInt128(string hex)
|
|
||||||
{
|
|
||||||
if (hex == null || hex.Length != 32 || !hex.All("0123456789abcdefABCDEF".Contains))
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Invalid Hex value!", nameof(hex));
|
|
||||||
}
|
|
||||||
|
|
||||||
Low = Convert.ToInt64(hex.Substring(16), 16);
|
|
||||||
High = Convert.ToInt64(hex.Substring(0, 16), 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Write(BinaryWriter binaryWriter)
|
|
||||||
{
|
|
||||||
binaryWriter.Write(Low);
|
|
||||||
binaryWriter.Write(High);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return High.ToString("x16") + Low.ToString("x16");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator ==(UInt128 x, UInt128 y)
|
|
||||||
{
|
|
||||||
return x.Equals(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator !=(UInt128 x, UInt128 y)
|
|
||||||
{
|
|
||||||
return !x.Equals(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
|
||||||
{
|
|
||||||
return obj is UInt128 uint128 && Equals(uint128);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Equals(UInt128 cmpObj)
|
|
||||||
{
|
|
||||||
return Low == cmpObj.Low && High == cmpObj.High;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return HashCode.Combine(Low, High);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,12 +1,13 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Version>1.0.0-dirty</Version>
|
<Version>1.0.0-dirty</Version>
|
||||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
||||||
|
<TieredPGO>true</TieredPGO>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -46,5 +47,6 @@
|
|||||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
|
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
|
<TrimMode>partial</TrimMode>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
@@ -9,11 +9,13 @@
|
|||||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
||||||
<!-- As we already provide GTK3 on Windows via GtkSharp.Dependencies this is redundant. -->
|
<!-- As we already provide GTK3 on Windows via GtkSharp.Dependencies this is redundant. -->
|
||||||
<SkipGtkInstall>true</SkipGtkInstall>
|
<SkipGtkInstall>true</SkipGtkInstall>
|
||||||
|
<TieredPGO>true</TieredPGO>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
|
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
|
<TrimMode>partial</TrimMode>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"sdk": {
|
"sdk": {
|
||||||
"version": "6.0.100",
|
"version": "7.0.100",
|
||||||
"rollForward": "latestFeature"
|
"rollForward": "latestFeature"
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user