コード例 #1
0
ファイル: GRVkExtensions.cs プロジェクト: ywscr/SkiaSharp
        public static GRVkExtensions Create(GRVkGetProcedureAddressDelegate getProc, IntPtr vkInstance, IntPtr vkPhysicalDevice, string[] instanceExtensions, string[] deviceExtensions)
        {
            var extensions = new GRVkExtensions();

            extensions.Initialize(getProc, vkInstance, vkPhysicalDevice, instanceExtensions, deviceExtensions);
            return(extensions);
        }
コード例 #2
0
        public static void Initialize(this GRVkExtensions extensions, GRSharpVkGetProcedureAddressDelegate getProc, Instance instance, PhysicalDevice physicalDevice, string[] instanceExtensions, string[] deviceExtensions)
        {
            GRVkGetProcedureAddressDelegate proc = (name, inst, _) =>
            {
                if (inst != IntPtr.Zero && instance?.RawHandle.ToUInt64() != (ulong)inst.ToInt64())
                {
                    throw new InvalidOperationException("Incorrect object for VkInstance.");
                }

                return(getProc?.Invoke(name, inst != IntPtr.Zero ? instance : null, null) ?? IntPtr.Zero);
            };

            extensions.Initialize(proc, (IntPtr)instance?.RawHandle.ToUInt64(), (IntPtr)physicalDevice?.RawHandle.ToUInt64(), instanceExtensions, deviceExtensions);
        }
コード例 #3
0
 public static void Initialize(this GRVkExtensions extensions, GRSharpVkGetProcedureAddressDelegate getProc, Instance instance, PhysicalDevice physicalDevice) =>
 extensions.Initialize(getProc, instance, physicalDevice, null, null);