Esempio n. 1
0
        public static VkPresentInfoKHR.Raw *MarshalIndirect(this VkPresentInfoKHR s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkPresentInfoKHR.Raw *) 0);
            }
            var result = (VkPresentInfoKHR.Raw *)unmanaged;

            unmanaged += VkPresentInfoKHR.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
Esempio n. 2
0
        public static int SizeOfMarshalDirect(this VkPresentInfoKHR s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect() +
                 s.WaitSemaphores.SizeOfMarshalDirect() +
                 s.Swapchains.SizeOfMarshalDirect() +
                 s.ImageIndices.SizeOfMarshalDirect());
        }
Esempio n. 3
0
        public VkResult PresentKHR(VkPresentInfoKHR presentInfo)
        {
            var unmanagedSize =
                presentInfo.SizeOfMarshalIndirect();
            var unmanagedArray = new byte[unmanagedSize];

            fixed(byte *unmanagedStart = unmanagedArray)
            {
                var unmanaged     = unmanagedStart;
                var _queue        = Handle;
                var _pPresentInfo = presentInfo.MarshalIndirect(ref unmanaged);

                return(Direct.QueuePresentKHR(_queue, _pPresentInfo));
            }
        }
Esempio n. 4
0
        public static VkPresentInfoKHR.Raw MarshalDirect(this VkPresentInfoKHR s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext           = s.Next.MarshalIndirect(ref unmanaged);
            var pWaitSemaphores = s.WaitSemaphores.MarshalDirect(ref unmanaged);
            var pSwapchains     = s.Swapchains.MarshalDirect(ref unmanaged);
            var pImageIndices   = s.ImageIndices.MarshalDirect(ref unmanaged);

            VkPresentInfoKHR.Raw result;
            result.sType = VkStructureType.PresentInfoKHR;
            result.pNext = pNext;
            result.waitSemaphoreCount = s.WaitSemaphores?.Count ?? 0;
            result.pWaitSemaphores    = pWaitSemaphores;
            result.swapchainCount     = s.Swapchains?.Count ?? 0;
            result.pSwapchains        = pSwapchains;
            result.pImageIndices      = pImageIndices;
            result.pResults           = s.Results;
            return(result);
        }
Esempio n. 5
0
 public static int SizeOfMarshalIndirect(this VkPresentInfoKHR s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkPresentInfoKHR.Raw.SizeInBytes;