コード例 #1
0
ファイル: VkImageCreateInfo.cs プロジェクト: Zulkir/VulkaNet
        public static VkImageCreateInfo.Raw MarshalDirect(this VkImageCreateInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

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

            VkImageCreateInfo.Raw result;
            result.sType                 = VkStructureType.ImageCreateInfo;
            result.pNext                 = pNext;
            result.flags                 = s.Flags;
            result.imageType             = s.ImageType;
            result.format                = s.Format;
            result.extent                = s.Extent;
            result.mipLevels             = s.MipLevels;
            result.arrayLayers           = s.ArrayLayers;
            result.samples               = s.Samples;
            result.tiling                = s.Tiling;
            result.usage                 = s.Usage;
            result.sharingMode           = s.SharingMode;
            result.queueFamilyIndexCount = s.QueueFamilyIndices?.Count ?? 0;
            result.pQueueFamilyIndices   = pQueueFamilyIndices;
            result.initialLayout         = s.InitialLayout;
            return(result);
        }
コード例 #2
0
ファイル: VkImageCreateInfo.cs プロジェクト: Zulkir/VulkaNet
        public static int SizeOfMarshalDirect(this VkImageCreateInfo s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect() +
                 s.QueueFamilyIndices.SizeOfMarshalDirect());
        }
コード例 #3
0
ファイル: VkImageCreateInfo.cs プロジェクト: Zulkir/VulkaNet
        public static VkImageCreateInfo.Raw *MarshalIndirect(this VkImageCreateInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkImageCreateInfo.Raw *) 0);
            }
            var result = (VkImageCreateInfo.Raw *)unmanaged;

            unmanaged += VkImageCreateInfo.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
コード例 #4
0
ファイル: VkImageCreateInfo.cs プロジェクト: Zulkir/VulkaNet
 public static int SizeOfMarshalIndirect(this VkImageCreateInfo s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkImageCreateInfo.Raw.SizeInBytes;