Compare commits
6 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77a9246825 | ||
|
|
709eeda94a | ||
|
|
7d54424048 | ||
|
|
664c63c6a8 | ||
|
|
153d1ef06b | ||
|
|
e1e4e5d2d5 |
7
.github/workflows/nightly_pr_comment.yml
vendored
7
.github/workflows/nightly_pr_comment.yml
vendored
@@ -41,12 +41,13 @@ jobs:
|
|||||||
let hidden_headless_artifacts = `\n\n <details><summary>GUI-less</summary>\n`;
|
let hidden_headless_artifacts = `\n\n <details><summary>GUI-less</summary>\n`;
|
||||||
let hidden_debug_artifacts = `\n\n <details><summary>Only for Developers</summary>\n`;
|
let hidden_debug_artifacts = `\n\n <details><summary>Only for Developers</summary>\n`;
|
||||||
for (const art of artifacts) {
|
for (const art of artifacts) {
|
||||||
|
var url = `https://github.com/Ryubing/Ryujinx/actions/runs/${run_id}/artifacts/${art_id}`;
|
||||||
if(art.name.includes('Debug')) {
|
if(art.name.includes('Debug')) {
|
||||||
hidden_debug_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
hidden_debug_artifacts += `\n* [${art.name}](${url})`;
|
||||||
} else if(art.name.includes('nogui-ryujinx')) {
|
} else if(art.name.includes('nogui-ryujinx')) {
|
||||||
hidden_headless_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
hidden_headless_artifacts += `\n* [${art.name}](${url})`;
|
||||||
} else {
|
} else {
|
||||||
body += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
body += `\n* [${art.name}](${url})`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hidden_headless_artifacts += `\n</details>`;
|
hidden_headless_artifacts += `\n</details>`;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<PackageVersion Include="Gommon" Version="2.6.8" />
|
<PackageVersion Include="Gommon" Version="2.6.8" />
|
||||||
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
||||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||||
<PackageVersion Include="SharpMetal" Version="1.0.0-preview20" />
|
<PackageVersion Include="SharpMetal" Version="1.0.0-preview21" />
|
||||||
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
||||||
<PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
|
<PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
|
||||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
|
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SharpMetal;
|
using SharpMetal;
|
||||||
|
using SharpMetal.Foundation;
|
||||||
using SharpMetal.ObjectiveCCore;
|
using SharpMetal.ObjectiveCCore;
|
||||||
using SharpMetal.QuartzCore;
|
using SharpMetal.QuartzCore;
|
||||||
using System.Runtime.Versioning;
|
using System.Runtime.Versioning;
|
||||||
@@ -9,22 +10,13 @@ namespace Ryujinx.Graphics.Metal.SharpMetalExtensions
|
|||||||
[SupportedOSPlatform("macOS")]
|
[SupportedOSPlatform("macOS")]
|
||||||
public static class CAMetalLayerExtensions
|
public static class CAMetalLayerExtensions
|
||||||
{
|
{
|
||||||
private static readonly Selector sel_displaySyncEnabled = "displaySyncEnabled";
|
|
||||||
private static readonly Selector sel_setDisplaySyncEnabled = "setDisplaySyncEnabled:";
|
|
||||||
|
|
||||||
private static readonly Selector sel_developerHUDProperties = "developerHUDProperties";
|
private static readonly Selector sel_developerHUDProperties = "developerHUDProperties";
|
||||||
private static readonly Selector sel_setDeveloperHUDProperties = "setDeveloperHUDProperties:";
|
private static readonly Selector sel_setDeveloperHUDProperties = "setDeveloperHUDProperties:";
|
||||||
|
|
||||||
public static bool IsDisplaySyncEnabled(this CAMetalLayer metalLayer)
|
public static NSDictionary GetDeveloperHudProperties(this CAMetalLayer metalLayer)
|
||||||
=> ObjectiveCRuntime.bool_objc_msgSend(metalLayer.NativePtr, sel_displaySyncEnabled);
|
=> new(ObjectiveCRuntime.IntPtr_objc_msgSend(metalLayer.NativePtr, sel_developerHUDProperties));
|
||||||
|
|
||||||
public static void SetDisplaySyncEnabled(this CAMetalLayer metalLayer, bool enabled)
|
public static void SetDeveloperHudProperties(this CAMetalLayer metalLayer, NSDictionary dictionary)
|
||||||
=> ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDisplaySyncEnabled, enabled);
|
=> ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDeveloperHUDProperties, dictionary);
|
||||||
|
|
||||||
public static nint GetDeveloperHudProperties(this CAMetalLayer metalLayer)
|
|
||||||
=> ObjectiveCRuntime.IntPtr_objc_msgSend(metalLayer.NativePtr, sel_developerHUDProperties);
|
|
||||||
|
|
||||||
public static void SetDeveloperHudProperties(this CAMetalLayer metalLayer, nint dictionaryPointer)
|
|
||||||
=> ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDeveloperHUDProperties, dictionaryPointer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
32
src/Ryujinx.Graphics.Metal.SharpMetalExtensions/NSHelper.cs
Normal file
32
src/Ryujinx.Graphics.Metal.SharpMetalExtensions/NSHelper.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using SharpMetal.Foundation;
|
||||||
|
using SharpMetal.ObjectiveCCore;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
|
|
||||||
|
namespace Ryujinx.Graphics.Metal.SharpMetalExtensions
|
||||||
|
{
|
||||||
|
[SupportedOSPlatform("macOS")]
|
||||||
|
public static class NSHelper
|
||||||
|
{
|
||||||
|
private static readonly Selector sel_getCStringMaxLengthEncoding = "getCString:maxLength:encoding:";
|
||||||
|
private static readonly Selector sel_stringWithUTF8String = "stringWithUTF8String:";
|
||||||
|
|
||||||
|
public static unsafe string ToDotNetString(this NSString source)
|
||||||
|
{
|
||||||
|
char[] sourceBuffer = new char[source.Length];
|
||||||
|
fixed (char* pSourceBuffer = sourceBuffer)
|
||||||
|
{
|
||||||
|
ObjectiveC.bool_objc_msgSend(source,
|
||||||
|
sel_getCStringMaxLengthEncoding,
|
||||||
|
pSourceBuffer,
|
||||||
|
source.MaximumLengthOfBytes(NSStringEncoding.UTF16) + 1,
|
||||||
|
(ulong)NSStringEncoding.UTF16);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new string(sourceBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static NSString ToNSString(this string source)
|
||||||
|
=> new(ObjectiveC.IntPtr_objc_msgSend(new ObjectiveCClass(nameof(NSString)), sel_stringWithUTF8String, source));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Ryujinx.Graphics.Metal
|
|||||||
public bool ScreenCaptureRequested { get; set; }
|
public bool ScreenCaptureRequested { get; set; }
|
||||||
|
|
||||||
private readonly MetalRenderer _renderer;
|
private readonly MetalRenderer _renderer;
|
||||||
private readonly CAMetalLayer _metalLayer;
|
private CAMetalLayer _metalLayer;
|
||||||
|
|
||||||
private int _width;
|
private int _width;
|
||||||
private int _height;
|
private int _height;
|
||||||
@@ -147,10 +147,10 @@ namespace Ryujinx.Graphics.Metal
|
|||||||
switch (vSyncMode)
|
switch (vSyncMode)
|
||||||
{
|
{
|
||||||
case VSyncMode.Unbounded:
|
case VSyncMode.Unbounded:
|
||||||
_metalLayer.SetDisplaySyncEnabled(false);
|
_metalLayer.DisplaySyncEnabled = false;
|
||||||
break;
|
break;
|
||||||
case VSyncMode.Switch:
|
case VSyncMode.Switch:
|
||||||
_metalLayer.SetDisplaySyncEnabled(true);
|
_metalLayer.DisplaySyncEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user