Exemplo n.º 1
0
 public ImageCreateInfo
 (
     StructureType sType        = StructureType.ImageCreateInfo,
     void *pNext                = default,
     ImageCreateFlags flags     = default,
     ImageType imageType        = default,
     Format format              = default,
     Extent3D extent            = default,
     uint mipLevels             = default,
     uint arrayLayers           = default,
     SampleCountFlags samples   = default,
     ImageTiling tiling         = default,
     ImageUsageFlags usage      = default,
     SharingMode sharingMode    = default,
     uint queueFamilyIndexCount = default,
     uint *pQueueFamilyIndices  = default,
     ImageLayout initialLayout  = default
 )
 {
     SType                 = sType;
     PNext                 = pNext;
     Flags                 = flags;
     ImageType             = imageType;
     Format                = format;
     Extent                = extent;
     MipLevels             = mipLevels;
     ArrayLayers           = arrayLayers;
     Samples               = samples;
     Tiling                = tiling;
     Usage                 = usage;
     SharingMode           = sharingMode;
     QueueFamilyIndexCount = queueFamilyIndexCount;
     PQueueFamilyIndices   = pQueueFamilyIndices;
     InitialLayout         = initialLayout;
 }
Exemplo n.º 2
0
 private Image CreateImage(ImageCreateFlags flags = 0, ImageTiling tiling = ImageTiling.Optimal)
 {
     var createInfo = new ImageCreateInfo
     {
         ArrayLayers = 1,
         Extent = new Extent3D(DefaultWidth, DefaultHeight, 1),
         Format = Format.B8G8R8A8UNorm,
         ImageType = ImageType.Image2D,
         Usage = ImageUsages.TransferSrc | ImageUsages.Sampled,
         MipLevels = 1,
         Samples = SampleCounts.Count1,
         Flags = flags,
         Tiling = tiling
     };
     return Device.CreateImage(createInfo);
 }
 public PhysicalDeviceImageFormatInfo2KHR
 (
     StructureType sType    = StructureType.PhysicalDeviceImageFormatInfo2,
     void *pNext            = default,
     Format format          = default,
     ImageType type         = default,
     ImageTiling tiling     = default,
     ImageUsageFlags usage  = default,
     ImageCreateFlags flags = default
 )
 {
     SType  = sType;
     PNext  = pNext;
     Format = format;
     Type   = type;
     Tiling = tiling;
     Usage  = usage;
     Flags  = flags;
 }
Exemplo n.º 4
0
 public FramebufferAttachmentImageInfo
 (
     StructureType sType    = StructureType.FramebufferAttachmentImageInfo,
     void *pNext            = default,
     ImageCreateFlags flags = default,
     ImageUsageFlags usage  = default,
     uint width             = default,
     uint height            = default,
     uint layerCount        = default,
     uint viewFormatCount   = default,
     Format *pViewFormats   = default
 )
 {
     SType           = sType;
     PNext           = pNext;
     Flags           = flags;
     Usage           = usage;
     Width           = width;
     Height          = height;
     LayerCount      = layerCount;
     ViewFormatCount = viewFormatCount;
     PViewFormats    = pViewFormats;
 }
Exemplo n.º 5
0
 public partial Result GetPhysicalDeviceExternalImageFormatProperties([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Format format, [Count(Count = 0)] ImageType type, [Count(Count = 0)] ImageTiling tiling, [Count(Count = 0)] ImageUsageFlags usage, [Count(Count = 0)] ImageCreateFlags flags, [Count(Count = 0)] ExternalMemoryHandleTypeFlagsNV externalHandleType, [Count(Count = 0), Flow(FlowDirection.Out)] out ExternalImageFormatPropertiesNV pExternalImageFormatProperties);
Exemplo n.º 6
0
 public static extern unsafe Result vkGetPhysicalDeviceImageFormatProperties(IntPtr physicalDevice, Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties *pImageFormatProperties);
Exemplo n.º 7
0
        /// <summary>
        /// Determine image capabilities compatible with external memory handle types.
        /// </summary>
        /// <param name="physicalDevice">The physical device from which to query the image capabilities.</param>
        /// <param name="format">The image format, corresponding to <see cref="ImageCreateInfo.Format"/>.</param>
        /// <param name="type">The image type, corresponding to <see cref="ImageCreateInfo.ImageType"/>.</param>
        /// <param name="tiling">The image tiling, corresponding to <see cref="ImageCreateInfo.Tiling"/>.</param>
        /// <param name="usage">The intended usage of the image, corresponding to <see cref="ImageCreateInfo.Usage"/>.</param>
        /// <param name="flags">
        /// A bitmask describing additional parameters of the image, corresponding to <see cref="ImageCreateInfo.Flags"/>.
        /// </param>
        /// <param name="externalHandleType">
        /// Either one of the bits from <see cref="ExternalMemoryHandleTypesNV"/>, or 0.
        /// </param>
        /// <returns>The structure in which capabilities are returned.</returns>
        /// <exception cref="VulkanException">Vulkan returns an error code.</exception>
        public static ExternalImageFormatPropertiesNV GetExternalImageFormatPropertiesNV(this PhysicalDevice physicalDevice,
                                                                                         Format format, ImageType type, ImageTiling tiling, ImageUsages usage, ImageCreateFlags flags,
                                                                                         ExternalMemoryHandleTypesNV externalHandleType)
        {
            ExternalImageFormatPropertiesNV properties;
            Result result = vkGetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags,
                                                                               externalHandleType, &properties);

            VulkanException.ThrowForInvalidResult(result);
            return(properties);
        }
Exemplo n.º 8
0
 internal static unsafe extern Result vkGetPhysicalDeviceImageFormatProperties(PhysicalDevice physicalDevice, Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties *ImageFormatProperties);
 /// <summary>To be documented.</summary>
 public static unsafe Result GetPhysicalDeviceExternalImageFormatProperties(this NVExternalMemoryCapabilities thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] Format format, [Count(Count = 0)] ImageType type, [Count(Count = 0)] ImageTiling tiling, [Count(Count = 0)] ImageUsageFlags usage, [Count(Count = 0)] ImageCreateFlags flags, [Count(Count = 0)] ExternalMemoryHandleTypeFlagsNV externalHandleType, [Count(Count = 0), Flow(FlowDirection.Out)] Span <ExternalImageFormatPropertiesNV> pExternalImageFormatProperties)
 {
     // SpanOverloader
     return(thisApi.GetPhysicalDeviceExternalImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, externalHandleType, out pExternalImageFormatProperties.GetPinnableReference()));
 }
Exemplo n.º 10
0
 internal static unsafe extern Result vkGetPhysicalDeviceExternalImageFormatPropertiesNV(IntPtr physicalDevice, Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNv externalHandleType, ExternalImageFormatPropertiesNv *pExternalImageFormatProperties);
Exemplo n.º 11
0
 internal static unsafe extern Result vkGetPhysicalDeviceImageFormatProperties(PhysicalDevice physicalDevice, Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* imageFormatProperties);
Exemplo n.º 12
0
 public unsafe void GetImageFormatProperties(Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, out ImageFormatProperties imageFormatProperties)
 {
     fixed (ImageFormatProperties* __imageFormatProperties__ = &imageFormatProperties)
     {
         vkGetPhysicalDeviceImageFormatProperties(this, format, type, tiling, usage, flags, __imageFormatProperties__).CheckError();
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// Determine image capabilities compatible with external memory handle
 /// types.
 /// </summary>
 public ExternalImageFormatProperties GetExternalImageFormatProperties(Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlags externalHandleType)
 {
     unsafe
     {
         try
         {
             var commandDelegate = this.commandCache.GetCommandDelegate <Interop.vkGetPhysicalDeviceExternalImageFormatPropertiesNV>("vkGetPhysicalDeviceExternalImageFormatPropertiesNV", "instance");
             ExternalImageFormatProperties result = default(ExternalImageFormatProperties);
             Result commandResult;
             commandResult = commandDelegate(this.handle, format, type, tiling, usage, flags, externalHandleType, &result);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }
Exemplo n.º 14
0
 /// <summary>
 /// Lists physical device's image format capabilities.
 /// </summary>
 public ImageFormatProperties GetImageFormatProperties(Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags)
 {
     unsafe
     {
         try
         {
             ImageFormatProperties result = default(ImageFormatProperties);
             Result commandResult;
             commandResult = Interop.Commands.vkGetPhysicalDeviceImageFormatProperties(this.handle, format, type, tiling, usage, flags, &result);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }