Class VkImageFormatProperties
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Description
Note
There is no mechanism to query the size of an image before creating it, to compare that size against maxResourceSize. If an application attempts to create an image that exceeds this limit, the creation will fail and CreateImage will return ERROR_OUT_OF_DEVICE_MEMORY. While the advertised limit must be at least 231, it may not be possible to create an image that approaches that size, particularly for IMAGE_TYPE_1D.
If the combination of parameters to vkGetPhysicalDeviceImageFormatProperties is not supported by the implementation for use in CreateImage, then all members of VkImageFormatProperties will be filled with zero.
Note
Filling VkImageFormatProperties with zero for unsupported formats is an exception to the usual rule that output structures have undefined contents on error. This exception was unintentional, but is preserved for backwards compatibility.
See Also
VkExtent3D, VkExternalImageFormatPropertiesNV, VkImageFormatProperties2, GetPhysicalDeviceImageFormatProperties
Layout
struct VkImageFormatProperties {
VkExtent3D maxExtent();
uint32_t maxMipLevels();
uint32_t maxArrayLayers();
VkSampleCountFlags sampleCounts();
VkDeviceSize maxResourceSize();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVkImageFormatProperties(ByteBuffer container) Creates aVkImageFormatPropertiesinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic VkImageFormatPropertiescalloc()Returns a newVkImageFormatPropertiesinstance allocated withmemCalloc.calloc(int capacity) Returns a newVkImageFormatProperties.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkImageFormatProperties.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageFormatPropertiescalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkImageFormatPropertiesinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageFormatPropertiesDeprecated.callocStack(int capacity) Deprecated.callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkImageFormatPropertiescallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static VkImageFormatPropertiescreate()Returns a newVkImageFormatPropertiesinstance allocated withBufferUtils.create(int capacity) Returns a newVkImageFormatProperties.Bufferinstance allocated withBufferUtils.static VkImageFormatPropertiescreate(long address) Returns a newVkImageFormatPropertiesinstance for the specified memory address.create(long address, int capacity) Create aVkImageFormatProperties.Bufferinstance at the specified memory.static @Nullable VkImageFormatPropertiescreateSafe(long address) static @Nullable VkImageFormatProperties.BuffercreateSafe(long address, int capacity) static VkImageFormatPropertiesmalloc()Returns a newVkImageFormatPropertiesinstance allocated withmemAlloc.malloc(int capacity) Returns a newVkImageFormatProperties.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkImageFormatProperties.Bufferinstance allocated on the specifiedMemoryStack.static VkImageFormatPropertiesmalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkImageFormatPropertiesinstance allocated on the specifiedMemoryStack.static VkImageFormatPropertiesDeprecated.mallocStack(int capacity) Deprecated.mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkImageFormatPropertiesmallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.intthe maximum number of array layers.are the maximum image dimensions.intthe maximum number of mipmap levels.longan upper bound on the total image size in bytes, inclusive of all image subresources.static intnmaxArrayLayers(long struct) Unsafe version ofmaxArrayLayers().static VkExtent3DnmaxExtent(long struct) Unsafe version ofmaxExtent().static intnmaxMipLevels(long struct) Unsafe version ofmaxMipLevels().static longnmaxResourceSize(long struct) Unsafe version ofmaxResourceSize().static intnsampleCounts(long struct) Unsafe version ofsampleCounts().inta bitmask ofVkSampleCountFlagBitsspecifying all the supported sample counts for this image as described below.intsizeof()Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
MAXEXTENT
public static final int MAXEXTENTThe struct member offsets. -
MAXMIPLEVELS
public static final int MAXMIPLEVELSThe struct member offsets. -
MAXARRAYLAYERS
public static final int MAXARRAYLAYERSThe struct member offsets. -
SAMPLECOUNTS
public static final int SAMPLECOUNTSThe struct member offsets. -
MAXRESOURCESIZE
public static final int MAXRESOURCESIZEThe struct member offsets.
-
-
Constructor Details
-
VkImageFormatProperties
Creates aVkImageFormatPropertiesinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VkImageFormatProperties>
-
maxExtent
are the maximum image dimensions. See the Allowed Extent Values section below for how these values are constrained bytype. -
maxMipLevels
public int maxMipLevels()the maximum number of mipmap levels.maxMipLevelsmust be equal to the number of levels in the complete mipmap chain based on themaxExtent.width,maxExtent.height, andmaxExtent.depth, except when one of the following conditions is true, in which case it may instead be 1:vkGetPhysicalDeviceImageFormatProperties::tilingwasIMAGE_TILING_LINEARVkPhysicalDeviceImageFormatInfo2::tilingwasIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT- the
VkPhysicalDeviceImageFormatInfo2::pNextchain included aVkPhysicalDeviceExternalImageFormatInfostructure with a handle type included in thehandleTypesmember for which mipmap image support is not required - image
formatis one of the formats that require a sampler Y′CBCR conversion flagscontainsIMAGE_CREATE_SUBSAMPLED_BIT_EXT
-
maxArrayLayers
public int maxArrayLayers()the maximum number of array layers.maxArrayLayersmust be no less thanVkPhysicalDeviceLimits::maxImageArrayLayers, except when one of the following conditions is true, in which case it may instead be 1:tilingisIMAGE_TILING_LINEARtilingisIMAGE_TILING_OPTIMALandtypeisIMAGE_TYPE_3Dformatis one of the formats that require a sampler Y′CBCR conversion- If
tilingisIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, thenmaxArrayLayersmust not be 0.
-
sampleCounts
public int sampleCounts()a bitmask ofVkSampleCountFlagBitsspecifying all the supported sample counts for this image as described below. -
maxResourceSize
public long maxResourceSize()an upper bound on the total image size in bytes, inclusive of all image subresources. Implementations may have an address space limit on total size of a resource, which is advertised by this property.maxResourceSizemust be at least 231. -
malloc
Returns a newVkImageFormatPropertiesinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkImageFormatPropertiesinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkImageFormatPropertiesinstance allocated withBufferUtils. -
create
Returns a newVkImageFormatPropertiesinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkImageFormatProperties.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkImageFormatProperties.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkImageFormatProperties.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkImageFormatProperties.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
mallocStack
@Deprecated public static VkImageFormatProperties.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
@Deprecated public static VkImageFormatProperties.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newVkImageFormatPropertiesinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkImageFormatPropertiesinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkImageFormatProperties.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkImageFormatProperties.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkImageFormatProperties.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkImageFormatProperties.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nmaxExtent
Unsafe version ofmaxExtent(). -
nmaxMipLevels
public static int nmaxMipLevels(long struct) Unsafe version ofmaxMipLevels(). -
nmaxArrayLayers
public static int nmaxArrayLayers(long struct) Unsafe version ofmaxArrayLayers(). -
nsampleCounts
public static int nsampleCounts(long struct) Unsafe version ofsampleCounts(). -
nmaxResourceSize
public static long nmaxResourceSize(long struct) Unsafe version ofmaxResourceSize().
-