public override async Task<InitializationResult> Initialize()
        {
            return await Task.Run(() =>
            {
                for (uint i = 1; ; i++)
                {
                    var delcom = new DelcomHid();
                    if (delcom.OpenNthDevice(i) != 0)
                        break;

                    var physicalDevice = new PhysicalDevice(delcom);
                    var delcomDevice = new DelcomDevice { PhysicalDevice = physicalDevice };

                    var physicalDeviceId = physicalDevice.Id;
                    var configuredDevice = delcomConfiguration.OutputDevices.OfType<DelcomDevice>().SingleOrDefault(d => d.PhysicalDeviceId == physicalDeviceId);

                    var delcomDeviceInfo = new DelcomDeviceInfo(delcomDevice, configuredDevice, delcomConfiguration);

                    if (configuredDevice != null)
                    {
                        ConfiguredDevices.Add(delcomDeviceInfo);
                    }
                    else
                    {
                        AvailableDevices.Add(delcomDeviceInfo);
                    }
                }

                foreach (var missingDevice in delcomConfiguration.OutputDevices.Where(od => ConfiguredDevices.All(cd => cd.Name != od.Name)))
                    ConfiguredDevices.Add(new DelcomDeviceInfo(null, missingDevice, delcomConfiguration));

                return InitializationResult.Succeeded;
            });
        }
示例#2
0
 /// <summary>To be documented.</summary>
 public static unsafe Result GetRandROutputDisplay(this ExtAcquireXlibDisplay thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Span <nint> dpy, [Count(Count = 0)] nint rrOutput, [Count(Count = 0), Flow(FlowDirection.Out)] Span <DisplayKHR> pDisplay)
 {
     // SpanOverloader
     return(thisApi.GetRandROutputDisplay(physicalDevice, ref dpy.GetPinnableReference(), rrOutput, out pDisplay.GetPinnableReference()));
 }
示例#3
0
 public abstract Result GetPhysicalDeviceDisplayProperties2([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] ref uint pPropertyCount, [Count(Computed = "pPropertyCount"), Flow(FlowDirection.Out)] out DisplayProperties2KHR pProperties);
示例#4
0
 public abstract Result GetDisplayPlaneCapabilities2([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0), Flow(FlowDirection.In)] ref DisplayPlaneInfo2KHR pDisplayPlaneInfo, [Count(Count = 0), Flow(FlowDirection.Out)] out DisplayPlaneCapabilities2KHR pCapabilities);
示例#5
0
 public static unsafe Result GetPhysicalDeviceCooperativeMatrixProperties(this NVCooperativeMatrix thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Span <uint> pPropertyCount, [Count(Parameter = "pPropertyCount"), Flow(FlowDirection.Out)] Span <CooperativeMatrixPropertiesNV> pProperties)
 {
     // SpanOverloader
     return(thisApi.GetPhysicalDeviceCooperativeMatrixProperties(physicalDevice, ref pPropertyCount.GetPinnableReference(), out pProperties.GetPinnableReference()));
 }
示例#6
0
 public abstract Result GetPhysicalDeviceSurfacePresentModes([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] SurfaceKHR surface, [Count(Count = 0)] ref uint pPresentModeCount, [Count(Computed = "pPresentModeCount"), Flow(FlowDirection.Out)] out PresentModeKHR pPresentModes);
 public abstract unsafe Result GetPhysicalDeviceSurfacePresentModes2([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0), Flow(FlowDirection.In)] PhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, [Count(Count = 0)] uint *pPresentModeCount, [Count(Computed = "pPresentModeCount"), Flow(FlowDirection.Out)] PresentModeKHR *pPresentModes);
示例#8
0
 public static string[] GetDeviceLayers(PhysicalDevice physicalDevice, IEnumerable <InitRequest> initRequest)
 {
     return(GetLayers(physicalDevice.EnumerateDeviceLayerProperties(), InitRequestType.Layer, initRequest));
 }
示例#9
0
        public IOExpander Connect(PhysicalDevice.INeedsPixelOutput device)
        {
            device.PixelOutputPort = this;

            return this;
        }
示例#10
0
 public SendStatus SendPixelValue(int channel, PhysicalDevice.PixelRGBByte rgb)
 {
     throw new NotImplementedException();
 }
示例#11
0
            public SendStatus SendPixelsValue(int channel, PhysicalDevice.PixelRGBByte[] rgb)
            {
                byte[] rgbArray = new byte[rgb.Length * 3];

                int bytePos = 0;
                for (int i = 0; i < rgb.Length; i++)
                {
                    rgbArray[bytePos++] = rgb[i].R;
                    rgbArray[bytePos++] = rgb[i].G;
                    rgbArray[bytePos++] = rgb[i].B;
                }

                this.opcClient.Send(this.opcChannel, (byte)0, rgbArray);

                return SendStatus.NotSet;
            }
示例#12
0
 public void Connect(PhysicalDevice.INeedsPixelOutput device, int opcChannel)
 {
     device.PixelOutputPort = new OpcPixelUniverse(this, opcChannel);
 }
 public LogicalDevice(PhysicalDevice owner, PartitionTable partition)
 {
     this.physicalDevice = owner;
     this.partition = partition;
     Refresh();
 }
示例#14
0
        public AcnStream Connect(PhysicalDevice.INeedsPixelOutput device, int startUniverse, int startDmxChannel)
        {
            device.PixelOutputPort = GetPixelSendingUniverse(startUniverse, startDmxChannel);

            return this;
        }
 /// <summary>To be documented.</summary>
 public static unsafe Result GetPhysicalDeviceExternalImageFormatProperties(this NVExternalMemoryCapabilities thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Format format, [Count(Count = 0)] ImageType type, [Count(Count = 0)] ImageTiling tiling, [Count(Count = 0)] ImageUsageFlags usage, [Count(Count = 0)] ImageCreateFlags flags, [Count(Count = 0)] ExternalMemoryHandleTypeFlagsNV externalHandleType, [Count(Count = 0), Flow(FlowDirection.Out)] Span <ExternalImageFormatPropertiesNV> pExternalImageFormatProperties)
 {
     // SpanOverloader
     return(thisApi.GetPhysicalDeviceExternalImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, externalHandleType, out pExternalImageFormatProperties.GetPinnableReference()));
 }
示例#16
0
        public bool CreateSwapChain(DrunkSpock spock,
                                    int extentX, int extentY)
        {
            PhysicalDevice phys = mLogical.Parent;
            SurfaceKhr     surf = spock.GetSurface();

            SurfaceCapabilitiesKhr surfCaps = phys.GetSurfaceCapabilitiesKhr(surf);

            SurfaceFormatKhr                [] surfFormats = phys.GetSurfaceFormatsKhr(surf);
            PresentModeKhr                  [] presModes   = phys.GetSurfacePresentModesKhr(surf);

            if (surfFormats.Length <= 0 || presModes.Length <= 0)
            {
                Misc.SafeInvoke(eErrorSpam, "Bad formats or pres modes...");
                return(false);
            }

            mSwapExtent = new Extent2D(extentX, extentY);

            int imageCount = surfCaps.MinImageCount + 1;

            if (surfCaps.MaxImageCount > 0 && imageCount > surfCaps.MaxImageCount)
            {
                imageCount = surfCaps.MaxImageCount;
            }

            SwapchainCreateInfoKhr scci = new SwapchainCreateInfoKhr(
                surf, Format.B8G8R8A8UNorm, mSwapExtent,
                imageCount, ColorSpaceKhr.SRgbNonlinear, 1,
                ImageUsages.ColorAttachment);

            scci.ImageSharingMode = SharingMode.Exclusive;

            if (presModes.Contains(PresentModeKhr.Mailbox))
            {
                scci.PresentMode = PresentModeKhr.Mailbox;
            }

            mSwapChain = mLogical.CreateSwapchainKhr(scci);
            if (mSwapChain == null)
            {
                Misc.SafeInvoke(eErrorSpam, "Create swap chain failed...");
                return(false);
            }

            VulkanCore.Image        [] chainImages = mSwapChain.GetImages();

            mChainImageViews = new ImageView[chainImages.Length];

            for (int i = 0; i < chainImages.Length; i++)
            {
                ImageSubresourceRange isr = new ImageSubresourceRange(
                    ImageAspects.Color, 0, 1, 0, 1);

                ImageViewCreateInfo ivci = new ImageViewCreateInfo(
                    mSwapChain.Format, isr);

                mChainImageViews[i] = chainImages[i].CreateView(ivci);
            }

            //descriptor pool stuff
            DescriptorPoolSize dps = new DescriptorPoolSize(
                DescriptorType.UniformBuffer, chainImages.Length);

            DescriptorPoolCreateInfo dpci = new DescriptorPoolCreateInfo();

            dpci.PoolSizes = new DescriptorPoolSize[] { dps };
            dpci.MaxSets   = chainImages.Length;

            mDPool = mLogical.CreateDescriptorPool(dpci);

            return(true);
        }
示例#17
0
        public SendStatus SendPixelsValue(int startChannel, PhysicalDevice.PixelRGBByte[] rgb)
        {
            lock (lockObject)
            {
                if (!this.changedPixels.Any())
                    this.firstChange.Restart();

                int readOffset = 0;
                for (int i = 0; i < rgb.Length; i++)
                {
                    int dataOffset = 1 + (startChannel + i) * 4;

                    this.pixelData[dataOffset + 0] = rgb[readOffset].R;
                    this.pixelData[dataOffset + 1] = rgb[readOffset].G;
                    this.pixelData[dataOffset + 2] = rgb[readOffset].B;
                    readOffset++;

                    this.changedPixels.Add((byte)(startChannel + i));
                }
                receivedUpdates++;
            }

            return SendStatus.NotSet;
        }
示例#18
0
 public static void ClearCaches()
 {
     QueueFamilyPropertiesCachePhysicalDevice = null;
     QueueFamilyPropertiesCache = null;
 }
示例#19
0
        public SendStatus SendPixelValue(int channel, PhysicalDevice.PixelRGBByte rgb)
        {
            int dataOffset = 1 + channel * 4;
            lock (lockObject)
            {
                if (!this.changedPixels.Any())
                    this.firstChange.Restart();

                this.pixelData[dataOffset + 0] = rgb.R;
                this.pixelData[dataOffset + 1] = rgb.G;
                this.pixelData[dataOffset + 2] = rgb.B;

                this.changedPixels.Add((byte)channel);
                receivedUpdates++;
            }

            return SendStatus.NotSet;
        }
示例#20
0
        public AcnStream Connect(PhysicalDevice.INeedsDmxOutput device, int universe)
        {
            device.DmxOutputPort = GetSendingUniverse(universe);

            return this;
        }
示例#21
0
 /// <summary>To be documented.</summary>
 public static unsafe void GetPhysicalDeviceExternalSemaphoreProperties(this KhrExternalSemaphoreCapabilities thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0), Flow(FlowDirection.In)] ReadOnlySpan <PhysicalDeviceExternalSemaphoreInfo> pExternalSemaphoreInfo, [Count(Count = 0), Flow(FlowDirection.Out)] Span <ExternalSemaphoreProperties> pExternalSemaphoreProperties)
 {
     // SpanOverloader
     thisApi.GetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, in pExternalSemaphoreInfo.GetPinnableReference(), out pExternalSemaphoreProperties.GetPinnableReference());
 }
示例#22
0
 public abstract Result GetPhysicalDeviceSurfaceSupport([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint queueFamilyIndex, [Count(Count = 0)] SurfaceKHR surface, [Count(Count = 0), Flow(FlowDirection.Out)] out Bool32 pSupported);
示例#23
0
 public partial Result GetPhysicalDeviceSupportedFramebufferMixedSamplesCombination([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] ref uint pCombinationCount, [Count(Computed = "pCombinationCount"), Flow(FlowDirection.Out)] out FramebufferMixedSamplesCombinationNV pCombinations);
示例#24
0
 public abstract Bool32 GetPhysicalDeviceWin32PresentationSupport([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint queueFamilyIndex);
示例#25
0
 public partial Result AcquireWinrtDisplay([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] DisplayKHR display);
示例#26
0
 public abstract unsafe Result GetPhysicalDeviceDisplayProperties2([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint *pPropertyCount, [Count(Computed = "pPropertyCount"), Flow(FlowDirection.Out)] DisplayProperties2KHR *pProperties);
示例#27
0
 public partial Result GetWinrtDisplay([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint deviceRelativeId, [Count(Count = 0), Flow(FlowDirection.Out)] out DisplayKHR pDisplay);
示例#28
0
 /// <summary>To be documented.</summary>
 public static unsafe Result AcquireXlibDisplay(this ExtAcquireXlibDisplay thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Span <nint> dpy, [Count(Count = 0)] DisplayKHR display)
 {
     // SpanOverloader
     return(thisApi.AcquireXlibDisplay(physicalDevice, ref dpy.GetPinnableReference(), display));
 }
示例#29
0
 public abstract Bool32 GetPhysicalDeviceXcbPresentationSupport([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint queueFamilyIndex, [Count(Count = 0)] ref IntPtr connection, [Count(Count = 0)] IntPtr visual_id);
示例#30
0
 /// <summary>
 /// Check if a queue family supports presenting
 /// </summary>
 /// <param name="index"></param>
 /// <param name="device"></param>
 /// <param name="surface"></param>
 /// <returns></returns>
 public static bool SupportsPresenting(int index, PhysicalDevice device, SurfaceKhr surface)
 {
     return(device.GetSurfaceSupportKhr(index, surface) && GetPresentationSupport(device, index));
 }
示例#31
0
 /// <summary>To be added.</summary>
 public unsafe Bool32 GetPhysicalDeviceXcbPresentationSupport([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint queueFamilyIndex, [Count(Count = 0)] ref IntPtr connection, [Count(Count = 0)] int visual_id)
 {
     // IntPtrOverloader
     return(GetPhysicalDeviceXcbPresentationSupport(physicalDevice, queueFamilyIndex, ref connection, new IntPtr(visual_id)));
 }
示例#32
0
 public static unsafe Result GetPhysicalDeviceToolProperties(this ExtToolingInfo thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Span <uint> pToolCount, [Count(Parameter = "pToolCount"), Flow(FlowDirection.Out)] Span <PhysicalDeviceToolPropertiesEXT> pToolProperties)
 {
     // SpanOverloader
     return(thisApi.GetPhysicalDeviceToolProperties(physicalDevice, ref pToolCount.GetPinnableReference(), out pToolProperties.GetPinnableReference()));
 }
 public abstract unsafe void GetPhysicalDeviceExternalBufferProperties([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0), Flow(FlowDirection.In)] PhysicalDeviceExternalBufferInfo *pExternalBufferInfo, [Count(Count = 0), Flow(FlowDirection.Out)] ExternalBufferProperties *pExternalBufferProperties);
示例#34
0
 /// <summary>To be documented.</summary>
 public static unsafe Result GetPhysicalDeviceSupportedFramebufferMixedSamplesCombination(this NVCoverageReductionMode thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Span <uint> pCombinationCount, [Count(Computed = "pCombinationCount"), Flow(FlowDirection.Out)] Span <FramebufferMixedSamplesCombinationNV> pCombinations)
 {
     // SpanOverloader
     return(thisApi.GetPhysicalDeviceSupportedFramebufferMixedSamplesCombination(physicalDevice, ref pCombinationCount.GetPinnableReference(), out pCombinations.GetPinnableReference()));
 }
 public abstract void GetPhysicalDeviceExternalBufferProperties([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0), Flow(FlowDirection.In)] ref PhysicalDeviceExternalBufferInfo pExternalBufferInfo, [Count(Count = 0), Flow(FlowDirection.Out)] out ExternalBufferProperties pExternalBufferProperties);
示例#36
0
 public static string[] GetDeviceExtention(PhysicalDevice physicalDevice, IEnumerable <InitRequest> initRequest)
 {
     return(GetExtention(physicalDevice.EnumerateDeviceExtensionProperties(), InitRequestType.DeviceExtention, initRequest));
 }
示例#37
0
 public abstract Result GetPhysicalDeviceSurfaceCapabilities([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] SurfaceKHR surface, [Count(Count = 0), Flow(FlowDirection.Out)] out SurfaceCapabilitiesKHR pSurfaceCapabilities);
示例#38
0
 /// <summary>To be documented.</summary>
 public static unsafe Bool32 GetPhysicalDeviceXlibPresentationSupport(this KhrXlibSurface thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint queueFamilyIndex, [Count(Count = 0)] Span <nint> dpy, [Count(Count = 0)] nint visualID)
 {
     // SpanOverloader
     return(thisApi.GetPhysicalDeviceXlibPresentationSupport(physicalDevice, queueFamilyIndex, ref dpy.GetPinnableReference(), visualID));
 }
示例#39
0
 public abstract unsafe Result GetPhysicalDeviceSurfaceFormats([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] SurfaceKHR surface, [Count(Count = 0)] uint *pSurfaceFormatCount, [Count(Computed = "pSurfaceFormatCount"), Flow(FlowDirection.Out)] SurfaceFormatKHR *pSurfaceFormats);
示例#40
0
        public Renard Connect(PhysicalDevice.INeedsDmxOutput device)
        {
            device.DmxOutputPort = this;

            return this;
        }
示例#41
0
 public abstract Result GetPhysicalDeviceSurfaceFormats([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] SurfaceKHR surface, [Count(Count = 0)] ref uint pSurfaceFormatCount, [Count(Computed = "pSurfaceFormatCount"), Flow(FlowDirection.Out)] out SurfaceFormatKHR pSurfaceFormats);