コード例 #1
0
ファイル: VkPresentInfoKHR.cs プロジェクト: Zulkir/VulkaNet
        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);
        }
コード例 #2
0
ファイル: VkPresentInfoKHR.cs プロジェクト: Zulkir/VulkaNet
        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());
        }
コード例 #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));
            }
        }
コード例 #4
0
ファイル: VkPresentInfoKHR.cs プロジェクト: Zulkir/VulkaNet
        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);
        }
コード例 #5
0
ファイル: VkPresentInfoKHR.cs プロジェクト: Zulkir/VulkaNet
 public static int SizeOfMarshalIndirect(this VkPresentInfoKHR s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkPresentInfoKHR.Raw.SizeInBytes;