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.NativeResourceStructure 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_UINTvalue per texel. - data copied to or from the depth aspect of a
FORMAT_D16_UNORMorFORMAT_D16_UNORM_S8_UINTformat is tightly packed with oneFORMAT_D16_UNORMvalue per texel. - data copied to or from the depth aspect of a
FORMAT_D32_SFLOATorFORMAT_D32_SFLOAT_S8_UINTformat is tightly packed with oneFORMAT_D32_SFLOATvalue per texel. - data copied to or from the depth aspect of a
FORMAT_X8_D24_UNORM_PACK32orFORMAT_D24_UNORM_S8_UINTformat 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
pRegionscan 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
baseArrayLayermember ofimageSubresource.layerCountlayers are copied from the source image or to the destination image.Valid Usage
- If the calling command’s
VkImageparameter’s format is not a depth/stencil format or a multi-planar format, thenbufferOffsetmust be a multiple of the format’s texel block size. - If the calling command’s
VkImageparameter’s format is a multi-planar format, thenbufferOffsetmust be a multiple of the element size of the compatible format for the format and theaspectMaskof theimageSubresourceas defined in Compatible formats of planes of multi-planar formats bufferOffsetmust be a multiple of 4bufferRowLengthmust be 0, or greater than or equal to thewidthmember ofimageExtentbufferImageHeightmust be 0, or greater than or equal to theheightmember ofimageExtentimageOffset.xand(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.yand(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.ymust be 0 andimageExtent.heightmust be 1. imageOffset.zand(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_1DorIMAGE_TYPE_2D, thenimageOffset.zmust be 0 andimageExtent.depthmust be 1 - If the calling command’s
VkImageparameter is a compressed image, or a single-plane, “_422” image format,bufferRowLengthmust be a multiple of the compressed texel block width - If the calling command’s
VkImageparameter is a compressed image, or a single-plane, “_422” image format,bufferImageHeightmust be a multiple of the compressed texel block height - If the calling command’s
VkImageparameter is a compressed image, or a single-plane, “_422” image format, all members ofimageOffsetmust be a multiple of the corresponding dimensions of the compressed texel block - If the calling command’s
VkImageparameter is a compressed image, or a single-plane, “_422” image format,bufferOffsetmust be a multiple of the compressed texel block size in bytes - If the calling command’s
VkImageparameter is a compressed image, or a single-plane, “_422” image format,imageExtent.widthmust 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
VkImageparameter is a compressed image, or a single-plane, “_422” image format,imageExtent.heightmust 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
VkImageparameter is a compressed image, or a single-plane, “_422” image format,imageExtent.depthmust be a multiple of the compressed texel block depth or(imageExtent.depth imageOffset.z)must equal the image subresource depth - The
aspectMaskmember ofimageSubresourcemust specify aspects present in the calling command’sVkImageparameter - If the calling command’s
VkImageparameter’s format is a multi-planar format, then theaspectMaskmember ofimageSubresourcemust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT(withIMAGE_ASPECT_PLANE_2_BITvalid only for image formats with three planes) - The
aspectMaskmember ofimageSubresourcemust only have a single bit set - If the calling command’s
VkImageparameter is ofVkImageTypeIMAGE_TYPE_3D, thebaseArrayLayerandlayerCountmembers ofimageSubresourcemust be 0 and 1, respectively
Valid Usage (Implicit)
imageSubresourcemust be a validVkImageSubresourceLayersstructure
See Also
VkExtent3D,VkImageSubresourceLayers,VkOffset3D,CmdCopyBufferToImage,CmdCopyImageToBufferMember documentation
bufferOffset– the offset in bytes from the start of the buffer object where the image data is copied from or to.bufferRowLength–bufferRowLengthandbufferImageHeightspecify 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– seebufferRowLengthimageSubresource– aVkImageSubresourceLayersused to specify the specific image subresources of the image used for the source or destination image data.imageOffset– selects the initialx,y,zoffsets in texels of the sub-region of the source or destination image data.imageExtent– the size in texels of the image to copy inwidth,heightanddepth.
Layout
struct VkBufferImageCopy { VkDeviceSize bufferOffset; uint32_t bufferRowLength; uint32_t bufferImageHeight;VkImageSubresourceLayersimageSubresource;VkOffset3DimageOffset;VkExtent3DimageExtent; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkBufferImageCopy.BufferAn array ofVkBufferImageCopystructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBUFFERIMAGEHEIGHT
BUFFEROFFSET
BUFFERROWLENGTH
IMAGEEXTENT
IMAGEOFFSET
IMAGESUBRESOURCEThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkBufferImageCopy(java.nio.ByteBuffer container)Creates aVkBufferImageCopyinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbufferImageHeight()Returns the value of thebufferImageHeightfield.VkBufferImageCopybufferImageHeight(int value)Sets the specified value to thebufferImageHeightfield.longbufferOffset()Returns the value of thebufferOffsetfield.VkBufferImageCopybufferOffset(long value)Sets the specified value to thebufferOffsetfield.intbufferRowLength()Returns the value of thebufferRowLengthfield.VkBufferImageCopybufferRowLength(int value)Sets the specified value to thebufferRowLengthfield.static VkBufferImageCopycalloc()Returns a newVkBufferImageCopyinstance allocated withmemCalloc.static VkBufferImageCopy.Buffercalloc(int capacity)Returns a newVkBufferImageCopy.Bufferinstance allocated withmemCalloc.static VkBufferImageCopycallocStack()Returns a newVkBufferImageCopyinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferImageCopy.BuffercallocStack(int capacity)Returns a newVkBufferImageCopy.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferImageCopy.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopy.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferImageCopycallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopyinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferImageCopycreate()Returns a newVkBufferImageCopyinstance allocated withBufferUtils.static VkBufferImageCopy.Buffercreate(int capacity)Returns a newVkBufferImageCopy.Bufferinstance allocated withBufferUtils.static VkBufferImageCopycreate(long address)Returns a newVkBufferImageCopyinstance for the specified memory address.static VkBufferImageCopy.Buffercreate(long address, int capacity)Create aVkBufferImageCopy.Bufferinstance at the specified memory.static VkBufferImageCopycreateSafe(long address)static VkBufferImageCopy.BuffercreateSafe(long address, int capacity)VkExtent3DimageExtent()Returns aVkExtent3Dview of theimageExtentfield.VkBufferImageCopyimageExtent(java.util.function.Consumer<VkExtent3D> consumer)Passes theimageExtentfield to the specifiedConsumer.VkBufferImageCopyimageExtent(VkExtent3D value)Copies the specifiedVkExtent3Dto theimageExtentfield.VkOffset3DimageOffset()Returns aVkOffset3Dview of theimageOffsetfield.VkBufferImageCopyimageOffset(java.util.function.Consumer<VkOffset3D> consumer)Passes theimageOffsetfield to the specifiedConsumer.VkBufferImageCopyimageOffset(VkOffset3D value)Copies the specifiedVkOffset3Dto theimageOffsetfield.VkImageSubresourceLayersimageSubresource()Returns aVkImageSubresourceLayersview of theimageSubresourcefield.VkBufferImageCopyimageSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)Passes theimageSubresourcefield to the specifiedConsumer.VkBufferImageCopyimageSubresource(VkImageSubresourceLayers value)Copies the specifiedVkImageSubresourceLayersto theimageSubresourcefield.static VkBufferImageCopymalloc()Returns a newVkBufferImageCopyinstance allocated withmemAlloc.static VkBufferImageCopy.Buffermalloc(int capacity)Returns a newVkBufferImageCopy.Bufferinstance allocated withmemAlloc.static VkBufferImageCopymallocStack()Returns a newVkBufferImageCopyinstance allocated on the thread-localMemoryStack.static VkBufferImageCopy.BuffermallocStack(int capacity)Returns a newVkBufferImageCopy.Bufferinstance allocated on the thread-localMemoryStack.static VkBufferImageCopy.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopy.Bufferinstance allocated on the specifiedMemoryStack.static VkBufferImageCopymallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopyinstance allocated on the specifiedMemoryStack.static intnbufferImageHeight(long struct)Unsafe version ofbufferImageHeight().static voidnbufferImageHeight(long struct, int value)Unsafe version ofbufferImageHeight.static longnbufferOffset(long struct)Unsafe version ofbufferOffset().static voidnbufferOffset(long struct, long value)Unsafe version ofbufferOffset.static intnbufferRowLength(long struct)Unsafe version ofbufferRowLength().static voidnbufferRowLength(long struct, int value)Unsafe version ofbufferRowLength.static VkExtent3DnimageExtent(long struct)Unsafe version ofimageExtent().static voidnimageExtent(long struct, VkExtent3D value)Unsafe version ofimageExtent.static VkOffset3DnimageOffset(long struct)Unsafe version ofimageOffset().static voidnimageOffset(long struct, VkOffset3D value)Unsafe version ofimageOffset.static VkImageSubresourceLayersnimageSubresource(long struct)Unsafe version ofimageSubresource().static voidnimageSubresource(long struct, VkImageSubresourceLayers value)Unsafe version ofimageSubresource.VkBufferImageCopyset(long bufferOffset, int bufferRowLength, int bufferImageHeight, VkImageSubresourceLayers imageSubresource, VkOffset3D imageOffset, VkExtent3D imageExtent)Initializes this struct with the specified values.VkBufferImageCopyset(VkBufferImageCopy src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
VkBufferImageCopy
public VkBufferImageCopy(java.nio.ByteBuffer container)
Creates aVkBufferImageCopyinstance 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
-
bufferOffset
public long bufferOffset()
Returns the value of thebufferOffsetfield.
-
bufferRowLength
public int bufferRowLength()
Returns the value of thebufferRowLengthfield.
-
bufferImageHeight
public int bufferImageHeight()
Returns the value of thebufferImageHeightfield.
-
imageSubresource
public VkImageSubresourceLayers imageSubresource()
Returns aVkImageSubresourceLayersview of theimageSubresourcefield.
-
imageOffset
public VkOffset3D imageOffset()
Returns aVkOffset3Dview of theimageOffsetfield.
-
imageExtent
public VkExtent3D imageExtent()
Returns aVkExtent3Dview of theimageExtentfield.
-
bufferOffset
public VkBufferImageCopy bufferOffset(long value)
Sets the specified value to thebufferOffsetfield.
-
bufferRowLength
public VkBufferImageCopy bufferRowLength(int value)
Sets the specified value to thebufferRowLengthfield.
-
bufferImageHeight
public VkBufferImageCopy bufferImageHeight(int value)
Sets the specified value to thebufferImageHeightfield.
-
imageSubresource
public VkBufferImageCopy imageSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayersto theimageSubresourcefield.
-
imageSubresource
public VkBufferImageCopy imageSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes theimageSubresourcefield to the specifiedConsumer.
-
imageOffset
public VkBufferImageCopy imageOffset(VkOffset3D value)
Copies the specifiedVkOffset3Dto theimageOffsetfield.
-
imageOffset
public VkBufferImageCopy imageOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes theimageOffsetfield to the specifiedConsumer.
-
imageExtent
public VkBufferImageCopy imageExtent(VkExtent3D value)
Copies the specifiedVkExtent3Dto theimageExtentfield.
-
imageExtent
public VkBufferImageCopy imageExtent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theimageExtentfield 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 newVkBufferImageCopyinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkBufferImageCopy calloc()
Returns a newVkBufferImageCopyinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkBufferImageCopy create()
Returns a newVkBufferImageCopyinstance allocated withBufferUtils.
-
create
public static VkBufferImageCopy create(long address)
Returns a newVkBufferImageCopyinstance for the specified memory address.
-
createSafe
@Nullable public static VkBufferImageCopy createSafe(long address)
-
malloc
public static VkBufferImageCopy.Buffer malloc(int capacity)
Returns a newVkBufferImageCopy.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkBufferImageCopy.Buffer calloc(int capacity)
Returns a newVkBufferImageCopy.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferImageCopy.Buffer create(int capacity)
Returns a newVkBufferImageCopy.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferImageCopy.Buffer create(long address, int capacity)
Create aVkBufferImageCopy.Bufferinstance 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 newVkBufferImageCopyinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkBufferImageCopy callocStack()
Returns a newVkBufferImageCopyinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkBufferImageCopy mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopyinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkBufferImageCopy callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopyinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkBufferImageCopy.Buffer callocStack(int capacity)
Returns a newVkBufferImageCopy.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-