Class VkBufferImageCopy
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkBufferImageCopy
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkBufferImageCopy extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying a buffer image copy operation.Description
When copying to or from a depth or stencil aspect, the data in buffer memory uses a layout that is a (mostly) tightly packed representation of the depth or stencil data. Specifically:
- data copied to or from the stencil aspect of any depth/stencil format is tightly packed with one
FORMAT_S8_UINT
value per texel. - data copied to or from the depth aspect of a
FORMAT_D16_UNORM
orFORMAT_D16_UNORM_S8_UINT
format is tightly packed with oneFORMAT_D16_UNORM
value per texel. - data copied to or from the depth aspect of a
FORMAT_D32_SFLOAT
orFORMAT_D32_SFLOAT_S8_UINT
format is tightly packed with oneFORMAT_D32_SFLOAT
value per texel. - data copied to or from the depth aspect of a
FORMAT_X8_D24_UNORM_PACK32
orFORMAT_D24_UNORM_S8_UINT
format is packed with one 32-bit word per texel with the D24 value in the LSBs of the word, and undefined values in the eight MSBs.
Note
To copy both the depth and stencil aspects of a depth/stencil format, two entries in
pRegions
can be used, where one specifies the depth aspect inimageSubresource
, and the other specifies the stencil aspect.Because depth or stencil aspect buffer to image copies may require format conversions on some implementations, they are not supported on queues that do not support graphics.
When copying to a depth aspect, and the VK_EXT_depth_range_unrestricted extension is not enabled, the data in buffer memory must be in the range
[0,1]
, or the resulting values are undefined.Copies are done layer by layer starting with image layer
baseArrayLayer
member ofimageSubresource
.layerCount
layers are copied from the source image or to the destination image.Valid Usage
- If the calling command’s
VkImage
parameter’s format is not a depth/stencil format or a multi-planar format, thenbufferOffset
must be a multiple of the format’s texel block size. - If the calling command’s
VkImage
parameter’s format is a multi-planar format, thenbufferOffset
must be a multiple of the element size of the compatible format for the format and theaspectMask
of theimageSubresource
as defined in Compatible formats of planes of multi-planar formats bufferOffset
must be a multiple of 4bufferRowLength
must be 0, or greater than or equal to thewidth
member ofimageExtent
bufferImageHeight
must be 0, or greater than or equal to theheight
member ofimageExtent
imageOffset.x
and(imageExtent.width imageOffset.x)
must both be greater than or equal to 0 and less than or equal to the image subresource width where this refers to the width of the plane of the image involved in the copy in the case of a multi-planar formatimageOffset.y
and(imageExtent.height imageOffset.y)
must both be greater than or equal to 0 and less than or equal to the image subresource height where this refers to the height of the plane of the image involved in the copy in the case of a multi-planar format- If the calling command’s
srcImage
(CmdCopyImageToBuffer
) ordstImage
(CmdCopyBufferToImage
) is of typeIMAGE_TYPE_1D
, thenimageOffset.y
must be 0 andimageExtent.height
must be 1. imageOffset.z
and(imageExtent.depth imageOffset.z)
must both be greater than or equal to 0 and less than or equal to the image subresource depth- If the calling command’s
srcImage
(CmdCopyImageToBuffer
) ordstImage
(CmdCopyBufferToImage
) is of typeIMAGE_TYPE_1D
orIMAGE_TYPE_2D
, thenimageOffset.z
must be 0 andimageExtent.depth
must be 1 - If the calling command’s
VkImage
parameter is a compressed image, or a single-plane, “_422
” image format,bufferRowLength
must be a multiple of the compressed texel block width - If the calling command’s
VkImage
parameter is a compressed image, or a single-plane, “_422
” image format,bufferImageHeight
must be a multiple of the compressed texel block height - If the calling command’s
VkImage
parameter is a compressed image, or a single-plane, “_422
” image format, all members ofimageOffset
must be a multiple of the corresponding dimensions of the compressed texel block - If the calling command’s
VkImage
parameter is a compressed image, or a single-plane, “_422
” image format,bufferOffset
must be a multiple of the compressed texel block size in bytes - If the calling command’s
VkImage
parameter is a compressed image, or a single-plane, “_422
” image format,imageExtent.width
must be a multiple of the compressed texel block width or(imageExtent.width imageOffset.x)
must equal the image subresource width - If the calling command’s
VkImage
parameter is a compressed image, or a single-plane, “_422
” image format,imageExtent.height
must be a multiple of the compressed texel block height or(imageExtent.height imageOffset.y)
must equal the image subresource height - If the calling command’s
VkImage
parameter is a compressed image, or a single-plane, “_422
” image format,imageExtent.depth
must be a multiple of the compressed texel block depth or(imageExtent.depth imageOffset.z)
must equal the image subresource depth - The
aspectMask
member ofimageSubresource
must specify aspects present in the calling command’sVkImage
parameter - If the calling command’s
VkImage
parameter’s format is a multi-planar format, then theaspectMask
member ofimageSubresource
must beIMAGE_ASPECT_PLANE_0_BIT
,IMAGE_ASPECT_PLANE_1_BIT
, orIMAGE_ASPECT_PLANE_2_BIT
(withIMAGE_ASPECT_PLANE_2_BIT
valid only for image formats with three planes) - The
aspectMask
member ofimageSubresource
must only have a single bit set - If the calling command’s
VkImage
parameter is ofVkImageType
IMAGE_TYPE_3D
, thebaseArrayLayer
andlayerCount
members ofimageSubresource
must be 0 and 1, respectively
Valid Usage (Implicit)
imageSubresource
must be a validVkImageSubresourceLayers
structure
See Also
VkExtent3D
,VkImageSubresourceLayers
,VkOffset3D
,CmdCopyBufferToImage
,CmdCopyImageToBuffer
Member documentation
bufferOffset
– the offset in bytes from the start of the buffer object where the image data is copied from or to.bufferRowLength
–bufferRowLength
andbufferImageHeight
specify in texels a subregion of a larger two- or three-dimensional image in buffer memory, and control the addressing calculations. If either of these values is zero, that aspect of the buffer memory is considered to be tightly packed according to theimageExtent
.bufferImageHeight
– seebufferRowLength
imageSubresource
– aVkImageSubresourceLayers
used to specify the specific image subresources of the image used for the source or destination image data.imageOffset
– selects the initialx
,y
,z
offsets in texels of the sub-region of the source or destination image data.imageExtent
– the size in texels of the image to copy inwidth
,height
anddepth
.
Layout
struct VkBufferImageCopy { VkDeviceSize bufferOffset; uint32_t bufferRowLength; uint32_t bufferImageHeight;
VkImageSubresourceLayers
imageSubresource;VkOffset3D
imageOffset;VkExtent3D
imageExtent; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkBufferImageCopy.Buffer
An array ofVkBufferImageCopy
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
BUFFERIMAGEHEIGHT
BUFFEROFFSET
BUFFERROWLENGTH
IMAGEEXTENT
IMAGEOFFSET
IMAGESUBRESOURCEThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkBufferImageCopy(java.nio.ByteBuffer container)
Creates aVkBufferImageCopy
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bufferImageHeight()
Returns the value of thebufferImageHeight
field.VkBufferImageCopy
bufferImageHeight(int value)
Sets the specified value to thebufferImageHeight
field.long
bufferOffset()
Returns the value of thebufferOffset
field.VkBufferImageCopy
bufferOffset(long value)
Sets the specified value to thebufferOffset
field.int
bufferRowLength()
Returns the value of thebufferRowLength
field.VkBufferImageCopy
bufferRowLength(int value)
Sets the specified value to thebufferRowLength
field.static VkBufferImageCopy
calloc()
Returns a newVkBufferImageCopy
instance allocated withmemCalloc
.static VkBufferImageCopy.Buffer
calloc(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated withmemCalloc
.static VkBufferImageCopy
callocStack()
Returns a newVkBufferImageCopy
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferImageCopy.Buffer
callocStack(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferImageCopy.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferImageCopy
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferImageCopy
create()
Returns a newVkBufferImageCopy
instance allocated withBufferUtils
.static VkBufferImageCopy.Buffer
create(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated withBufferUtils
.static VkBufferImageCopy
create(long address)
Returns a newVkBufferImageCopy
instance for the specified memory address.static VkBufferImageCopy.Buffer
create(long address, int capacity)
Create aVkBufferImageCopy.Buffer
instance at the specified memory.static VkBufferImageCopy
createSafe(long address)
static VkBufferImageCopy.Buffer
createSafe(long address, int capacity)
VkExtent3D
imageExtent()
Returns aVkExtent3D
view of theimageExtent
field.VkBufferImageCopy
imageExtent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theimageExtent
field to the specifiedConsumer
.VkBufferImageCopy
imageExtent(VkExtent3D value)
Copies the specifiedVkExtent3D
to theimageExtent
field.VkOffset3D
imageOffset()
Returns aVkOffset3D
view of theimageOffset
field.VkBufferImageCopy
imageOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes theimageOffset
field to the specifiedConsumer
.VkBufferImageCopy
imageOffset(VkOffset3D value)
Copies the specifiedVkOffset3D
to theimageOffset
field.VkImageSubresourceLayers
imageSubresource()
Returns aVkImageSubresourceLayers
view of theimageSubresource
field.VkBufferImageCopy
imageSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes theimageSubresource
field to the specifiedConsumer
.VkBufferImageCopy
imageSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayers
to theimageSubresource
field.static VkBufferImageCopy
malloc()
Returns a newVkBufferImageCopy
instance allocated withmemAlloc
.static VkBufferImageCopy.Buffer
malloc(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated withmemAlloc
.static VkBufferImageCopy
mallocStack()
Returns a newVkBufferImageCopy
instance allocated on the thread-localMemoryStack
.static VkBufferImageCopy.Buffer
mallocStack(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the thread-localMemoryStack
.static VkBufferImageCopy.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the specifiedMemoryStack
.static VkBufferImageCopy
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy
instance allocated on the specifiedMemoryStack
.static int
nbufferImageHeight(long struct)
Unsafe version ofbufferImageHeight()
.static void
nbufferImageHeight(long struct, int value)
Unsafe version ofbufferImageHeight
.static long
nbufferOffset(long struct)
Unsafe version ofbufferOffset()
.static void
nbufferOffset(long struct, long value)
Unsafe version ofbufferOffset
.static int
nbufferRowLength(long struct)
Unsafe version ofbufferRowLength()
.static void
nbufferRowLength(long struct, int value)
Unsafe version ofbufferRowLength
.static VkExtent3D
nimageExtent(long struct)
Unsafe version ofimageExtent()
.static void
nimageExtent(long struct, VkExtent3D value)
Unsafe version ofimageExtent
.static VkOffset3D
nimageOffset(long struct)
Unsafe version ofimageOffset()
.static void
nimageOffset(long struct, VkOffset3D value)
Unsafe version ofimageOffset
.static VkImageSubresourceLayers
nimageSubresource(long struct)
Unsafe version ofimageSubresource()
.static void
nimageSubresource(long struct, VkImageSubresourceLayers value)
Unsafe version ofimageSubresource
.VkBufferImageCopy
set(long bufferOffset, int bufferRowLength, int bufferImageHeight, VkImageSubresourceLayers imageSubresource, VkOffset3D imageOffset, VkExtent3D imageExtent)
Initializes this struct with the specified values.VkBufferImageCopy
set(VkBufferImageCopy src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
VkBufferImageCopy
public VkBufferImageCopy(java.nio.ByteBuffer container)
Creates aVkBufferImageCopy
instance at the current position of the specifiedByteBuffer
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.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
bufferOffset
public long bufferOffset()
Returns the value of thebufferOffset
field.
-
bufferRowLength
public int bufferRowLength()
Returns the value of thebufferRowLength
field.
-
bufferImageHeight
public int bufferImageHeight()
Returns the value of thebufferImageHeight
field.
-
imageSubresource
public VkImageSubresourceLayers imageSubresource()
Returns aVkImageSubresourceLayers
view of theimageSubresource
field.
-
imageOffset
public VkOffset3D imageOffset()
Returns aVkOffset3D
view of theimageOffset
field.
-
imageExtent
public VkExtent3D imageExtent()
Returns aVkExtent3D
view of theimageExtent
field.
-
bufferOffset
public VkBufferImageCopy bufferOffset(long value)
Sets the specified value to thebufferOffset
field.
-
bufferRowLength
public VkBufferImageCopy bufferRowLength(int value)
Sets the specified value to thebufferRowLength
field.
-
bufferImageHeight
public VkBufferImageCopy bufferImageHeight(int value)
Sets the specified value to thebufferImageHeight
field.
-
imageSubresource
public VkBufferImageCopy imageSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayers
to theimageSubresource
field.
-
imageSubresource
public VkBufferImageCopy imageSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes theimageSubresource
field to the specifiedConsumer
.
-
imageOffset
public VkBufferImageCopy imageOffset(VkOffset3D value)
Copies the specifiedVkOffset3D
to theimageOffset
field.
-
imageOffset
public VkBufferImageCopy imageOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes theimageOffset
field to the specifiedConsumer
.
-
imageExtent
public VkBufferImageCopy imageExtent(VkExtent3D value)
Copies the specifiedVkExtent3D
to theimageExtent
field.
-
imageExtent
public VkBufferImageCopy imageExtent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theimageExtent
field to the specifiedConsumer
.
-
set
public VkBufferImageCopy set(long bufferOffset, int bufferRowLength, int bufferImageHeight, VkImageSubresourceLayers imageSubresource, VkOffset3D imageOffset, VkExtent3D imageExtent)
Initializes this struct with the specified values.
-
set
public VkBufferImageCopy set(VkBufferImageCopy src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkBufferImageCopy malloc()
Returns a newVkBufferImageCopy
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkBufferImageCopy calloc()
Returns a newVkBufferImageCopy
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkBufferImageCopy create()
Returns a newVkBufferImageCopy
instance allocated withBufferUtils
.
-
create
public static VkBufferImageCopy create(long address)
Returns a newVkBufferImageCopy
instance for the specified memory address.
-
createSafe
@Nullable public static VkBufferImageCopy createSafe(long address)
-
malloc
public static VkBufferImageCopy.Buffer malloc(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkBufferImageCopy.Buffer calloc(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferImageCopy.Buffer create(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferImageCopy.Buffer create(long address, int capacity)
Create aVkBufferImageCopy.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkBufferImageCopy.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkBufferImageCopy mallocStack()
Returns a newVkBufferImageCopy
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkBufferImageCopy callocStack()
Returns a newVkBufferImageCopy
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkBufferImageCopy mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkBufferImageCopy callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkBufferImageCopy.Buffer mallocStack(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkBufferImageCopy.Buffer callocStack(int capacity)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkBufferImageCopy.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkBufferImageCopy.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopy.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nbufferOffset
public static long nbufferOffset(long struct)
Unsafe version ofbufferOffset()
.
-
nbufferRowLength
public static int nbufferRowLength(long struct)
Unsafe version ofbufferRowLength()
.
-
nbufferImageHeight
public static int nbufferImageHeight(long struct)
Unsafe version ofbufferImageHeight()
.
-
nimageSubresource
public static VkImageSubresourceLayers nimageSubresource(long struct)
Unsafe version ofimageSubresource()
.
-
nimageOffset
public static VkOffset3D nimageOffset(long struct)
Unsafe version ofimageOffset()
.
-
nimageExtent
public static VkExtent3D nimageExtent(long struct)
Unsafe version ofimageExtent()
.
-
nbufferOffset
public static void nbufferOffset(long struct, long value)
Unsafe version ofbufferOffset
.
-
nbufferRowLength
public static void nbufferRowLength(long struct, int value)
Unsafe version ofbufferRowLength
.
-
nbufferImageHeight
public static void nbufferImageHeight(long struct, int value)
Unsafe version ofbufferImageHeight
.
-
nimageSubresource
public static void nimageSubresource(long struct, VkImageSubresourceLayers value)
Unsafe version ofimageSubresource
.
-
nimageOffset
public static void nimageOffset(long struct, VkOffset3D value)
Unsafe version ofimageOffset
.
-
nimageExtent
public static void nimageExtent(long struct, VkExtent3D value)
Unsafe version ofimageExtent
.
-
-