예제 #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");
            }
        }