public class VkImageSubresourceRange
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
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 baseMipLevel or baseArrayLayer, it can set levelCount and layerCount to the special values REMAINING_MIP_LEVELS and REMAINING_ARRAY_LAYERS without knowing the exact number of mip levels or layers.
For cube and cube array image views, the layers of the image view starting at baseArrayLayer correspond 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 is layerCount / 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 in layerCount or implied by REMAINING_ARRAY_LAYERS, is not a multiple of 6, the last cube map in the array must not be accessed.
aspectMask must be only IMAGE_ASPECT_COLOR_BIT, IMAGE_ASPECT_DEPTH_BIT or IMAGE_ASPECT_STENCIL_BIT if format is a color, depth-only or stencil-only format, respectively, except if format is a multi-planar format. If using a depth/stencil format with both depth and stencil components, aspectMask must include at least one of IMAGE_ASPECT_DEPTH_BIT and IMAGE_ASPECT_STENCIL_BIT, and can include both.
When the VkImageSubresourceRange structure 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 with IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, baseArrayLayer and layerCount specify 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 aspectMask must only include one bit and 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, the aspectMask is ignored and both depth and stencil image subresources are used.
The VkComponentMapping components member describes a remapping from components of the image to components of the vector returned by shader image instructions. This remapping must be identity for storage image descriptors, input attachment descriptors, framebuffer attachments, and any VkImageView used with a combined image sampler that enables sampler Y'CBCR conversion.
When creating a VkImageView, if sampler Y'CBCR conversion is enabled in the sampler, the aspectMask of a subresourceRange used by the VkImageView must be IMAGE_ASPECT_COLOR_BIT.
When creating a VkImageView, if sampler Y'CBCR conversion is not enabled in the sampler and the image format is multi-planar, the image must have been created with IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the VkImageView's subresourceRange must be IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT or IMAGE_ASPECT_PLANE_2_BIT.
levelCount is not REMAINING_MIP_LEVELS, it must be greater than 0layerCount is not REMAINING_ARRAY_LAYERS, it must be greater than 0aspectMask includes IMAGE_ASPECT_COLOR_BIT, then it must not include any of IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, or IMAGE_ASPECT_PLANE_2_BITaspectMask must not include VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT for any index iaspectMask must be a valid combination of VkImageAspectFlagBits valuesaspectMask must not be 0VkImageMemoryBarrier, VkImageViewCreateInfo, CmdClearColorImage, CmdClearDepthStencilImage
aspectMask – a bitmask of VkImageAspectFlagBits specifying which aspect(s) of the image are included in the view.baseMipLevel – the first mipmap level accessible to the view.levelCount – the number of mipmap levels (starting from baseMipLevel) accessible to the view.baseArrayLayer – the first array layer accessible to the view.layerCount – the number of array layers (starting from baseArrayLayer) accessible to the view.
struct VkImageSubresourceRange {
VkImageAspectFlags aspectMask;
uint32_t baseMipLevel;
uint32_t levelCount;
uint32_t baseArrayLayer;
uint32_t layerCount;
}| Modifier and Type | Class and Description |
|---|---|
static class |
VkImageSubresourceRange.Buffer
An array of
VkImageSubresourceRange structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
ASPECTMASK
The struct member offsets.
|
static int |
BASEARRAYLAYER
The struct member offsets.
|
static int |
BASEMIPLEVEL
The struct member offsets.
|
static int |
LAYERCOUNT
The struct member offsets.
|
static int |
LEVELCOUNT
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
VkImageSubresourceRange(java.nio.ByteBuffer container)
Creates a
VkImageSubresourceRange instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
int |
aspectMask()
Returns the value of the
aspectMask field. |
VkImageSubresourceRange |
aspectMask(int value)
Sets the specified value to the
aspectMask field. |
int |
baseArrayLayer()
Returns the value of the
baseArrayLayer field. |
VkImageSubresourceRange |
baseArrayLayer(int value)
Sets the specified value to the
baseArrayLayer field. |
int |
baseMipLevel()
Returns the value of the
baseMipLevel field. |
VkImageSubresourceRange |
baseMipLevel(int value)
Sets the specified value to the
baseMipLevel field. |
static VkImageSubresourceRange |
calloc()
Returns a new
VkImageSubresourceRange instance allocated with memCalloc. |
static VkImageSubresourceRange.Buffer |
calloc(int capacity)
Returns a new
VkImageSubresourceRange.Buffer instance allocated with memCalloc. |
static VkImageSubresourceRange |
callocStack()
Returns a new
VkImageSubresourceRange instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkImageSubresourceRange.Buffer |
callocStack(int capacity)
Returns a new
VkImageSubresourceRange.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkImageSubresourceRange.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkImageSubresourceRange.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkImageSubresourceRange |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkImageSubresourceRange instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkImageSubresourceRange |
create()
Returns a new
VkImageSubresourceRange instance allocated with BufferUtils. |
static VkImageSubresourceRange.Buffer |
create(int capacity)
Returns a new
VkImageSubresourceRange.Buffer instance allocated with BufferUtils. |
static VkImageSubresourceRange |
create(long address)
Returns a new
VkImageSubresourceRange instance for the specified memory address. |
static VkImageSubresourceRange.Buffer |
create(long address,
int capacity)
Create a
VkImageSubresourceRange.Buffer instance at the specified memory. |
static VkImageSubresourceRange |
createSafe(long address)
|
static VkImageSubresourceRange.Buffer |
createSafe(long address,
int capacity)
|
int |
layerCount()
Returns the value of the
layerCount field. |
VkImageSubresourceRange |
layerCount(int value)
Sets the specified value to the
layerCount field. |
int |
levelCount()
Returns the value of the
levelCount field. |
VkImageSubresourceRange |
levelCount(int value)
Sets the specified value to the
levelCount field. |
static VkImageSubresourceRange |
malloc()
Returns a new
VkImageSubresourceRange instance allocated with memAlloc. |
static VkImageSubresourceRange.Buffer |
malloc(int capacity)
Returns a new
VkImageSubresourceRange.Buffer instance allocated with memAlloc. |
static VkImageSubresourceRange |
mallocStack()
Returns a new
VkImageSubresourceRange instance allocated on the thread-local MemoryStack. |
static VkImageSubresourceRange.Buffer |
mallocStack(int capacity)
Returns a new
VkImageSubresourceRange.Buffer instance allocated on the thread-local MemoryStack. |
static VkImageSubresourceRange.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkImageSubresourceRange.Buffer instance allocated on the specified MemoryStack. |
static VkImageSubresourceRange |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkImageSubresourceRange instance allocated on the specified MemoryStack. |
static int |
naspectMask(long struct)
Unsafe version of
aspectMask(). |
static void |
naspectMask(long struct,
int value)
Unsafe version of
aspectMask. |
static int |
nbaseArrayLayer(long struct)
Unsafe version of
baseArrayLayer(). |
static void |
nbaseArrayLayer(long struct,
int value)
Unsafe version of
baseArrayLayer. |
static int |
nbaseMipLevel(long struct)
Unsafe version of
baseMipLevel(). |
static void |
nbaseMipLevel(long struct,
int value)
Unsafe version of
baseMipLevel. |
static int |
nlayerCount(long struct)
Unsafe version of
layerCount(). |
static void |
nlayerCount(long struct,
int value)
Unsafe version of
layerCount. |
static int |
nlevelCount(long struct)
Unsafe version of
levelCount(). |
static void |
nlevelCount(long struct,
int value)
Unsafe version of
levelCount. |
VkImageSubresourceRange |
set(int aspectMask,
int baseMipLevel,
int levelCount,
int baseArrayLayer,
int layerCount)
Initializes this struct with the specified values.
|
VkImageSubresourceRange |
set(VkImageSubresourceRange src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
public static final int SIZEOF
public static final int ALIGNOF
public static final int ASPECTMASK
public static final int BASEMIPLEVEL
public static final int LEVELCOUNT
public static final int BASEARRAYLAYER
public static final int LAYERCOUNT
public VkImageSubresourceRange(java.nio.ByteBuffer container)
VkImageSubresourceRange instance at the current position of the specified ByteBuffer container. 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic int aspectMask()
aspectMask field.public int baseMipLevel()
baseMipLevel field.public int levelCount()
levelCount field.public int baseArrayLayer()
baseArrayLayer field.public int layerCount()
layerCount field.public VkImageSubresourceRange aspectMask(int value)
aspectMask field.public VkImageSubresourceRange baseMipLevel(int value)
baseMipLevel field.public VkImageSubresourceRange levelCount(int value)
levelCount field.public VkImageSubresourceRange baseArrayLayer(int value)
baseArrayLayer field.public VkImageSubresourceRange layerCount(int value)
layerCount field.public VkImageSubresourceRange set(int aspectMask, int baseMipLevel, int levelCount, int baseArrayLayer, int layerCount)
public VkImageSubresourceRange set(VkImageSubresourceRange src)
src - the source structpublic static VkImageSubresourceRange malloc()
VkImageSubresourceRange instance allocated with memAlloc. The instance must be explicitly freed.public static VkImageSubresourceRange calloc()
VkImageSubresourceRange instance allocated with memCalloc. The instance must be explicitly freed.public static VkImageSubresourceRange create()
VkImageSubresourceRange instance allocated with BufferUtils.public static VkImageSubresourceRange create(long address)
VkImageSubresourceRange instance for the specified memory address.@Nullable public static VkImageSubresourceRange createSafe(long address)
public static VkImageSubresourceRange.Buffer malloc(int capacity)
VkImageSubresourceRange.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkImageSubresourceRange.Buffer calloc(int capacity)
VkImageSubresourceRange.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkImageSubresourceRange.Buffer create(int capacity)
VkImageSubresourceRange.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static VkImageSubresourceRange.Buffer create(long address, int capacity)
VkImageSubresourceRange.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static VkImageSubresourceRange.Buffer createSafe(long address, int capacity)
public static VkImageSubresourceRange mallocStack()
VkImageSubresourceRange instance allocated on the thread-local MemoryStack.public static VkImageSubresourceRange callocStack()
VkImageSubresourceRange instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static VkImageSubresourceRange mallocStack(org.lwjgl.system.MemoryStack stack)
VkImageSubresourceRange instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static VkImageSubresourceRange callocStack(org.lwjgl.system.MemoryStack stack)
VkImageSubresourceRange instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static VkImageSubresourceRange.Buffer mallocStack(int capacity)
VkImageSubresourceRange.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static VkImageSubresourceRange.Buffer callocStack(int capacity)
VkImageSubresourceRange.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static VkImageSubresourceRange.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkImageSubresourceRange.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static VkImageSubresourceRange.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkImageSubresourceRange.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static int naspectMask(long struct)
aspectMask().public static int nbaseMipLevel(long struct)
baseMipLevel().public static int nlevelCount(long struct)
levelCount().public static int nbaseArrayLayer(long struct)
baseArrayLayer().public static int nlayerCount(long struct)
layerCount().public static void naspectMask(long struct,
int value)
aspectMask.public static void nbaseMipLevel(long struct,
int value)
baseMipLevel.public static void nlevelCount(long struct,
int value)
levelCount.public static void nbaseArrayLayer(long struct,
int value)
baseArrayLayer.public static void nlayerCount(long struct,
int value)
layerCount.Copyright LWJGL. All Rights Reserved. License terms.