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;
            });
        }
Beispiel #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()));
 }
Beispiel #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);
Beispiel #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);
Beispiel #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()));
 }
Beispiel #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);
Beispiel #8
0
 public static string[] GetDeviceLayers(PhysicalDevice physicalDevice, IEnumerable <InitRequest> initRequest)
 {
     return(GetLayers(physicalDevice.EnumerateDeviceLayerProperties(), InitRequestType.Layer, initRequest));
 }
Beispiel #9
0
        public IOExpander Connect(PhysicalDevice.INeedsPixelOutput device)
        {
            device.PixelOutputPort = this;

            return this;
        }
Beispiel #10
0
 public SendStatus SendPixelValue(int channel, PhysicalDevice.PixelRGBByte rgb)
 {
     throw new NotImplementedException();
 }
Beispiel #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;
            }
Beispiel #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();
 }
Beispiel #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()));
 }
Beispiel #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);
        }
Beispiel #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;
        }
Beispiel #18
0
 public static void ClearCaches()
 {
     QueueFamilyPropertiesCachePhysicalDevice = null;
     QueueFamilyPropertiesCache = null;
 }
Beispiel #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;
        }
Beispiel #20
0
        public AcnStream Connect(PhysicalDevice.INeedsDmxOutput device, int universe)
        {
            device.DmxOutputPort = GetSendingUniverse(universe);

            return this;
        }
Beispiel #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());
 }
Beispiel #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);
Beispiel #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);
 public abstract Bool32 GetPhysicalDeviceWin32PresentationSupport([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] uint queueFamilyIndex);
Beispiel #25
0
 public partial Result AcquireWinrtDisplay([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] DisplayKHR display);
Beispiel #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);
Beispiel #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);
Beispiel #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));
 }
Beispiel #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);
Beispiel #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));
 }
Beispiel #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)));
 }
Beispiel #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);
Beispiel #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);
Beispiel #36
0
 public static string[] GetDeviceExtention(PhysicalDevice physicalDevice, IEnumerable <InitRequest> initRequest)
 {
     return(GetExtention(physicalDevice.EnumerateDeviceExtensionProperties(), InitRequestType.DeviceExtention, initRequest));
 }
Beispiel #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);
Beispiel #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));
 }
Beispiel #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);
Beispiel #40
0
        public Renard Connect(PhysicalDevice.INeedsDmxOutput device)
        {
            device.DmxOutputPort = this;

            return this;
        }
Beispiel #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);