public static int SizeOfMarshalDirect(this VkDisplayModeCreateInfoKHR s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect());
        }
        public static VkDisplayModeCreateInfoKHR.Raw *MarshalIndirect(this VkDisplayModeCreateInfoKHR s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkDisplayModeCreateInfoKHR.Raw *) 0);
            }
            var result = (VkDisplayModeCreateInfoKHR.Raw *)unmanaged;

            unmanaged += VkDisplayModeCreateInfoKHR.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
        public static VkDisplayModeCreateInfoKHR.Raw MarshalDirect(this VkDisplayModeCreateInfoKHR s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext = s.Next.MarshalIndirect(ref unmanaged);

            VkDisplayModeCreateInfoKHR.Raw result;
            result.sType      = VkStructureType.DisplayModeCreateInfoKHR;
            result.pNext      = pNext;
            result.flags      = s.Flags;
            result.parameters = s.Parameters;
            return(result);
        }
 public static int SizeOfMarshalIndirect(this VkDisplayModeCreateInfoKHR s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkDisplayModeCreateInfoKHR.Raw.SizeInBytes;
Example #5
0
        public VkObjectResult <IVkDisplayModeKHR> CreateDisplayMode(IVkDisplayKHR display, VkDisplayModeCreateInfoKHR createInfo, IVkAllocationCallbacks allocator)
        {
            var unmanagedSize =
                createInfo.SizeOfMarshalIndirect() +
                allocator.SizeOfMarshalIndirect();
            var unmanagedArray = new byte[unmanagedSize];

            fixed(byte *unmanagedStart = unmanagedArray)
            {
                var unmanaged     = unmanagedStart;
                var displayHandle = display?.Handle ?? VkDisplayKHR.HandleType.Null;
                var pCreateInfo   = createInfo.MarshalIndirect(ref unmanaged);
                var pAllocator    = allocator.MarshalIndirect(ref unmanaged);

                VkDisplayModeKHR.HandleType displayModeHandle;
                var result   = Direct.CreateDisplayModeKHR(Handle, displayHandle, pCreateInfo, pAllocator, &displayModeHandle);
                var instance = result == VkResult.Success ? new VkDisplayModeKHR(Instance, displayModeHandle) : null;

                return(new VkObjectResult <IVkDisplayModeKHR>(result, instance));
            }
        }
Example #6
0
 public VkObjectResult<IVkDisplayModeKHR> CreateDisplayMode(IVkDisplayKHR display, VkDisplayModeCreateInfoKHR createInfo, IVkAllocationCallbacks allocator)
 {
     var unmanagedSize =
         createInfo.SizeOfMarshalIndirect() +
         allocator.SizeOfMarshalIndirect();
     var unmanagedArray = new byte[unmanagedSize];
     fixed (byte* unmanagedStart = unmanagedArray)
     {
         var unmanaged = unmanagedStart;
         var displayHandle = display?.Handle ?? VkDisplayKHR.HandleType.Null;
         var pCreateInfo = createInfo.MarshalIndirect(ref unmanaged);
         var pAllocator = allocator.MarshalIndirect(ref unmanaged);
         VkDisplayModeKHR.HandleType displayModeHandle;
         var result = Direct.CreateDisplayModeKHR(Handle, displayHandle, pCreateInfo, pAllocator, &displayModeHandle);
         var instance = result == VkResult.Success ? new VkDisplayModeKHR(Instance, displayModeHandle) : null;
         return new VkObjectResult<IVkDisplayModeKHR>(result, instance);
     }
 }