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

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

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

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

            VkMirSurfaceCreateInfoKHR.Raw result;
            result.sType      = VkStructureType.MirSurfaceCreateInfoKHR;
            result.pNext      = pNext;
            result.flags      = s.Flags;
            result.connection = s.Connection;
            result.mirSurface = s.MirSurface;
            return(result);
        }
Example #4
0
        public VkObjectResult <IVkSurfaceKHR> CreateMirSurfaceKHR(VkMirSurfaceCreateInfoKHR createInfo, IVkAllocationCallbacks allocator)
        {
            var unmanagedSize =
                createInfo.SizeOfMarshalIndirect() +
                allocator.SizeOfMarshalIndirect();
            var unmanagedArray = new byte[unmanagedSize];

            fixed(byte *unmanagedStart = unmanagedArray)
            {
                var unmanaged   = unmanagedStart;
                var pCreateInfo = createInfo.MarshalIndirect(ref unmanaged);
                var pAllocator  = allocator.MarshalIndirect(ref unmanaged);

                VkSurfaceKHR.HandleType surfaceHandle;
                var result   = Direct.CreateMirSurfaceKHR(Handle, pCreateInfo, pAllocator, &surfaceHandle);
                var instance = result == VkResult.Success ? new VkSurfaceKHR(this, surfaceHandle, allocator) : null;

                return(new VkObjectResult <IVkSurfaceKHR>(result, instance));
            }
        }
Example #5
0
 public static int SizeOfMarshalIndirect(this VkMirSurfaceCreateInfoKHR s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkMirSurfaceCreateInfoKHR.Raw.SizeInBytes;