Пример #1
0
        public VkBlobBufferAllocator(VulkanDevice vulkanDevice)
        {
            if (vulkanDevice == null)
            {
                throw new ArgumentNullException(nameof(vulkanDevice));
            }

            vulkanDevice.ThrowIfDisposed();

            NativeMethods.allocator_VkBlobBufferAllocator_new(vulkanDevice.NativePtr, out var returnValue);
            this.NativePtr = returnValue;
        }
Пример #2
0
        public VkCompute(VulkanDevice device)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            device.ThrowIfDisposed();

            NativeMethods.command_VkCompute_new(device.NativePtr, out var ret);
            this.NativePtr = ret;
        }
Пример #3
0
        public Command(VulkanDevice device, uint queueFamilyIndex)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            device.ThrowIfDisposed();

            NativeMethods.command_Command_new(device.NativePtr, queueFamilyIndex, out var ret);
            this.NativePtr = ret;
        }
Пример #4
0
        public void SetVulkanDevice(VulkanDevice device)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            this.ThrowIfDisposed();
            device.ThrowIfDisposed();

            var error = NativeMethods.net_Net_set_vulkan_device2(this.NativePtr, device.NativePtr);

            if (error != NativeMethods.ErrorType.OK)
            {
                throw new NcnnException("Unknown Exception");
            }
        }