Class VkImageSubresourceRange
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkImageSubresourceRange
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkImageSubresourceRange extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying an image subresource range.Description
The number of mipmap levels and array layers must be a subset of the image subresources in the image. If an application wants to use all mip levels or layers in an image after the
baseMipLevelorbaseArrayLayer, it can setlevelCountandlayerCountto the special valuesREMAINING_MIP_LEVELSandREMAINING_ARRAY_LAYERSwithout knowing the exact number of mip levels or layers.For cube and cube array image views, the layers of the image view starting at
baseArrayLayercorrespond to faces in the order +X, -X, +Y, -Y, +Z, -Z. For cube arrays, each set of six sequential layers is a single cube, so the number of cube maps in a cube map array view islayerCount/ 6, and image array layer(baseArrayLayer + i)is face index(i mod 6)of cube i / 6. If the number of layers in the view, whether set explicitly inlayerCountor implied byREMAINING_ARRAY_LAYERS, is not a multiple of 6, the last cube map in the array must not be accessed.aspectMaskmust be onlyIMAGE_ASPECT_COLOR_BIT,IMAGE_ASPECT_DEPTH_BITorIMAGE_ASPECT_STENCIL_BITifformatis a color, depth-only or stencil-only format, respectively, except ifformatis a multi-planar format. If using a depth/stencil format with both depth and stencil components,aspectMaskmust include at least one ofIMAGE_ASPECT_DEPTH_BITandIMAGE_ASPECT_STENCIL_BIT, and can include both.When the
VkImageSubresourceRangestructure is used to select a subset of the slices of a 3D image’s mip level in order to create a 2D or 2D array image view of a 3D image created withIMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,baseArrayLayerandlayerCountspecify the first slice index and the number of slices to include in the created image view. Such an image view can be used as a framebuffer attachment that refers only to the specified range of slices of the selected mip level. However, any layout transitions performed on such an attachment view during a render pass instance still apply to the entire subresource referenced which includes all the slices of the selected mip level.When using an image view of a depth/stencil image to populate a descriptor set (e.g. for sampling in the shader, or for use as an input attachment), the
aspectMaskmust only include one bit, which selects whether the image view is used for depth reads (i.e. using a floating-point sampler or input attachment in the shader) or stencil reads (i.e. using an unsigned integer sampler or input attachment in the shader). When an image view of a depth/stencil image is used as a depth/stencil framebuffer attachment, theaspectMaskis ignored and both depth and stencil image subresources are used.When creating a
VkImageView, if sampler Y′CBCR conversion is enabled in the sampler, theaspectMaskof asubresourceRangeused by theVkImageViewmust beIMAGE_ASPECT_COLOR_BIT.When creating a
VkImageView, if sampler Y′CBCR conversion is not enabled in the sampler and the imageformatis multi-planar, the image must have been created withIMAGE_CREATE_MUTABLE_FORMAT_BIT, and theaspectMaskof theVkImageView’ssubresourceRangemust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BITorIMAGE_ASPECT_PLANE_2_BIT.Valid Usage
- If
levelCountis notREMAINING_MIP_LEVELS, it must be greater than 0 - If
layerCountis notREMAINING_ARRAY_LAYERS, it must be greater than 0 - If
aspectMaskincludesIMAGE_ASPECT_COLOR_BIT, then it must not include any ofIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT aspectMaskmust not includeVK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXTfor any index i
Valid Usage (Implicit)
aspectMaskmust be a valid combination ofVkImageAspectFlagBitsvaluesaspectMaskmust not be 0
See Also
VkImageMemoryBarrier,VkImageMemoryBarrier2,VkImageViewCreateInfo,CmdClearColorImage,CmdClearDepthStencilImageLayout
struct VkImageSubresourceRange { VkImageAspectFlagsaspectMask(); uint32_tbaseMipLevel(); uint32_tlevelCount(); uint32_tbaseArrayLayer(); uint32_tlayerCount(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkImageSubresourceRange.BufferAn array ofVkImageSubresourceRangestructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intASPECTMASK
BASEARRAYLAYER
BASEMIPLEVEL
LAYERCOUNT
LEVELCOUNTThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkImageSubresourceRange(java.nio.ByteBuffer container)Creates aVkImageSubresourceRangeinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intaspectMask()a bitmask ofVkImageAspectFlagBitsspecifying which aspect(s) of the image are included in the view.VkImageSubresourceRangeaspectMask(int value)Sets the specified value to theaspectMask()field.intbaseArrayLayer()the first array layer accessible to the view.VkImageSubresourceRangebaseArrayLayer(int value)Sets the specified value to thebaseArrayLayer()field.intbaseMipLevel()the first mipmap level accessible to the view.VkImageSubresourceRangebaseMipLevel(int value)Sets the specified value to thebaseMipLevel()field.static VkImageSubresourceRangecalloc()Returns a newVkImageSubresourceRangeinstance allocated withmemCalloc.static VkImageSubresourceRange.Buffercalloc(int capacity)Returns a newVkImageSubresourceRange.Bufferinstance allocated withmemCalloc.static VkImageSubresourceRange.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkImageSubresourceRange.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageSubresourceRangecalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkImageSubresourceRangeinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageSubresourceRangecallocStack()Deprecated.static VkImageSubresourceRange.BuffercallocStack(int capacity)Deprecated.static VkImageSubresourceRange.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VkImageSubresourceRangecallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static VkImageSubresourceRangecreate()Returns a newVkImageSubresourceRangeinstance allocated withBufferUtils.static VkImageSubresourceRange.Buffercreate(int capacity)Returns a newVkImageSubresourceRange.Bufferinstance allocated withBufferUtils.static VkImageSubresourceRangecreate(long address)Returns a newVkImageSubresourceRangeinstance for the specified memory address.static VkImageSubresourceRange.Buffercreate(long address, int capacity)Create aVkImageSubresourceRange.Bufferinstance at the specified memory.static VkImageSubresourceRangecreateSafe(long address)static VkImageSubresourceRange.BuffercreateSafe(long address, int capacity)intlayerCount()the number of array layers (starting frombaseArrayLayer) accessible to the view.VkImageSubresourceRangelayerCount(int value)Sets the specified value to thelayerCount()field.intlevelCount()the number of mipmap levels (starting frombaseMipLevel) accessible to the view.VkImageSubresourceRangelevelCount(int value)Sets the specified value to thelevelCount()field.static VkImageSubresourceRangemalloc()Returns a newVkImageSubresourceRangeinstance allocated withmemAlloc.static VkImageSubresourceRange.Buffermalloc(int capacity)Returns a newVkImageSubresourceRange.Bufferinstance allocated withmemAlloc.static VkImageSubresourceRange.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkImageSubresourceRange.Bufferinstance allocated on the specifiedMemoryStack.static VkImageSubresourceRangemalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkImageSubresourceRangeinstance allocated on the specifiedMemoryStack.static VkImageSubresourceRangemallocStack()Deprecated.static VkImageSubresourceRange.BuffermallocStack(int capacity)Deprecated.static VkImageSubresourceRange.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VkImageSubresourceRangemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static intnaspectMask(long struct)Unsafe version ofaspectMask().static voidnaspectMask(long struct, int value)Unsafe version ofaspectMask.static intnbaseArrayLayer(long struct)Unsafe version ofbaseArrayLayer().static voidnbaseArrayLayer(long struct, int value)Unsafe version ofbaseArrayLayer.static intnbaseMipLevel(long struct)Unsafe version ofbaseMipLevel().static voidnbaseMipLevel(long struct, int value)Unsafe version ofbaseMipLevel.static intnlayerCount(long struct)Unsafe version oflayerCount().static voidnlayerCount(long struct, int value)Unsafe version oflayerCount.static intnlevelCount(long struct)Unsafe version oflevelCount().static voidnlevelCount(long struct, int value)Unsafe version oflevelCount.VkImageSubresourceRangeset(int aspectMask, int baseMipLevel, int levelCount, int baseArrayLayer, int layerCount)Initializes this struct with the specified values.VkImageSubresourceRangeset(VkImageSubresourceRange src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
VkImageSubresourceRange
public VkImageSubresourceRange(java.nio.ByteBuffer container)
Creates aVkImageSubresourceRangeinstance 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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
aspectMask
public int aspectMask()
a bitmask ofVkImageAspectFlagBitsspecifying which aspect(s) of the image are included in the view.
-
baseMipLevel
public int baseMipLevel()
the first mipmap level accessible to the view.
-
levelCount
public int levelCount()
the number of mipmap levels (starting frombaseMipLevel) accessible to the view.
-
baseArrayLayer
public int baseArrayLayer()
the first array layer accessible to the view.
-
layerCount
public int layerCount()
the number of array layers (starting frombaseArrayLayer) accessible to the view.
-
aspectMask
public VkImageSubresourceRange aspectMask(int value)
Sets the specified value to theaspectMask()field.
-
baseMipLevel
public VkImageSubresourceRange baseMipLevel(int value)
Sets the specified value to thebaseMipLevel()field.
-
levelCount
public VkImageSubresourceRange levelCount(int value)
Sets the specified value to thelevelCount()field.
-
baseArrayLayer
public VkImageSubresourceRange baseArrayLayer(int value)
Sets the specified value to thebaseArrayLayer()field.
-
layerCount
public VkImageSubresourceRange layerCount(int value)
Sets the specified value to thelayerCount()field.
-
set
public VkImageSubresourceRange set(int aspectMask, int baseMipLevel, int levelCount, int baseArrayLayer, int layerCount)
Initializes this struct with the specified values.
-
set
public VkImageSubresourceRange set(VkImageSubresourceRange src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkImageSubresourceRange malloc()
Returns a newVkImageSubresourceRangeinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkImageSubresourceRange calloc()
Returns a newVkImageSubresourceRangeinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkImageSubresourceRange create()
Returns a newVkImageSubresourceRangeinstance allocated withBufferUtils.
-
create
public static VkImageSubresourceRange create(long address)
Returns a newVkImageSubresourceRangeinstance for the specified memory address.
-
createSafe
@Nullable public static VkImageSubresourceRange createSafe(long address)
-
malloc
public static VkImageSubresourceRange.Buffer malloc(int capacity)
Returns a newVkImageSubresourceRange.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkImageSubresourceRange.Buffer calloc(int capacity)
Returns a newVkImageSubresourceRange.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkImageSubresourceRange.Buffer create(int capacity)
Returns a newVkImageSubresourceRange.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkImageSubresourceRange.Buffer create(long address, int capacity)
Create aVkImageSubresourceRange.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkImageSubresourceRange.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static VkImageSubresourceRange mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkImageSubresourceRange callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkImageSubresourceRange mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkImageSubresourceRange callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkImageSubresourceRange.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VkImageSubresourceRange.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static VkImageSubresourceRange.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 VkImageSubresourceRange.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static VkImageSubresourceRange malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageSubresourceRangeinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkImageSubresourceRange calloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageSubresourceRangeinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkImageSubresourceRange.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImageSubresourceRange.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static VkImageSubresourceRange.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImageSubresourceRange.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
naspectMask
public static int naspectMask(long struct)
Unsafe version ofaspectMask().
-
nbaseMipLevel
public static int nbaseMipLevel(long struct)
Unsafe version ofbaseMipLevel().
-
nlevelCount
public static int nlevelCount(long struct)
Unsafe version oflevelCount().
-
nbaseArrayLayer
public static int nbaseArrayLayer(long struct)
Unsafe version ofbaseArrayLayer().
-
nlayerCount
public static int nlayerCount(long struct)
Unsafe version oflayerCount().
-
naspectMask
public static void naspectMask(long struct, int value)Unsafe version ofaspectMask.
-
nbaseMipLevel
public static void nbaseMipLevel(long struct, int value)Unsafe version ofbaseMipLevel.
-
nlevelCount
public static void nlevelCount(long struct, int value)Unsafe version oflevelCount.
-
nbaseArrayLayer
public static void nbaseArrayLayer(long struct, int value)Unsafe version ofbaseArrayLayer.
-
nlayerCount
public static void nlayerCount(long struct, int value)Unsafe version oflayerCount.
-
-