mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-03-11 17:45:43 +00:00
Some checks failed
Canary CI / Release for linux-arm64 (push) Has been cancelled
Canary CI / Release for linux-x64 (push) Has been cancelled
Canary CI / Release for win-x64 (push) Has been cancelled
Canary CI / Release MacOS universal (push) Has been cancelled
Canary CI / Create GitLab Release (push) Has been cancelled
See merge request ryubing/ryujinx!242
32 lines
1.5 KiB
C#
32 lines
1.5 KiB
C#
using Silk.NET.Vulkan;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Ryujinx.Graphics.Vulkan
|
|
{
|
|
public static class Helpers
|
|
{
|
|
extension(Vk api)
|
|
{
|
|
/// <summary>
|
|
/// C# implementation of the RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE macro from the RenderDoc API header, since we cannot use macros from C#.
|
|
/// </summary>
|
|
/// <returns>The dispatch table pointer, which sits as the first pointer-sized object in the memory pointed to by the <see cref="Vk"/>'s <see cref="Instance"/> pointer.</returns>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public unsafe void* GetRenderDocDevicePointer() =>
|
|
api.CurrentInstance is not null
|
|
? api.CurrentInstance.Value.GetRenderDocDevicePointer()
|
|
: null;
|
|
}
|
|
|
|
extension(Instance instance)
|
|
{
|
|
/// <summary>
|
|
/// C# implementation of the RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE macro from the RenderDoc API header, since we cannot use macros from C#.
|
|
/// </summary>
|
|
/// <returns>The dispatch table pointer, which sits as the first pointer-sized object in the memory pointed to by the <see cref="Instance"/>'s pointer.</returns>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public unsafe void* GetRenderDocDevicePointer()
|
|
=> (*((void**)(instance.Handle)));
|
|
}
|
|
}
|
|
}
|