コード例 #1
0
        public unsafe SurfaceFormatKHR[] GetPhysicalDeviceSurfaceFormats(VulkanPhysicalDevice physicalDevice, SurfaceKHR surface)
        {
            uint formatsCount = 0u;

            GetPhysicalDeviceSurfaceFormats(physicalDevice, surface, &formatsCount, (SurfaceFormatKHR *)null !);

            if (formatsCount is 0u)
            {
                return(Array.Empty <SurfaceFormatKHR>());
            }

            SurfaceFormatKHR *surfaceFormatsPointer = stackalloc SurfaceFormatKHR[(int)formatsCount];

            GetPhysicalDeviceSurfaceFormats(physicalDevice, surface, &formatsCount, surfaceFormatsPointer);
            SurfaceFormatKHR[] surfaceFormats = new SurfaceFormatKHR[formatsCount];
            new Span <SurfaceFormatKHR>(surfaceFormatsPointer, (int)formatsCount).CopyTo(surfaceFormats);
            return(surfaceFormats);
        }
コード例 #2
0
ファイル: KhrSurface.gen.cs プロジェクト: swoolcock/Silk.NET
 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);
コード例 #3
0
 /// <summary>To be documented.</summary>
 public static unsafe Result GetPhysicalDeviceSurfaceFormats(this KhrSurface thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] SurfaceKHR surface, [Count(Count = 0)] Span <uint> pSurfaceFormatCount, [Count(Parameter = "pSurfaceFormatCount"), Flow(FlowDirection.Out)] SurfaceFormatKHR *pSurfaceFormats)
 {
     // SpanOverloader
     return(thisApi.GetPhysicalDeviceSurfaceFormats(physicalDevice, surface, ref pSurfaceFormatCount.GetPinnableReference(), pSurfaceFormats));
 }