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_unrestrictedextension 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.For purpose of valid usage statements here and in related copy commands, a blocked image is defined as:
- an image with a single-plane, “
_422” format, which is treated as a format with a 2 × 1 compressed texel block, or - a compressed image.
Valid Usage
bufferRowLengthmust be 0, or greater than or equal to thewidthmember ofimageExtentbufferImageHeightmust be 0, or greater than or equal to theheightmember ofimageExtent- The
aspectMaskmember ofimageSubresourcemust only have a single bit set
Valid Usage (Implicit)
imageSubresourcemust be a validVkImageSubresourceLayersstructure
See Also
VkExtent3D,VkImageSubresourceLayers,VkOffset3D,CmdCopyBufferToImage,CmdCopyImageToBufferLayout
struct VkBufferImageCopy { VkDeviceSizebufferOffset(); uint32_tbufferRowLength(); uint32_tbufferImageHeight();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 Deprecated Methods Modifier and Type Method Description intbufferImageHeight()seebufferRowLengthVkBufferImageCopybufferImageHeight(int value)Sets the specified value to thebufferImageHeight()field.longbufferOffset()the offset in bytes from the start of the buffer object where the image data is copied from or to.VkBufferImageCopybufferOffset(long value)Sets the specified value to thebufferOffset()field.intbufferRowLength()bufferRowLengthandbufferImageHeightspecify in texels a subregion of a larger two- or three-dimensional image in buffer memory, and control the addressing calculations.VkBufferImageCopybufferRowLength(int value)Sets the specified value to thebufferRowLength()field.static VkBufferImageCopycalloc()Returns a newVkBufferImageCopyinstance allocated withmemCalloc.static VkBufferImageCopy.Buffercalloc(int capacity)Returns a newVkBufferImageCopy.Bufferinstance allocated withmemCalloc.static VkBufferImageCopy.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopy.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferImageCopycalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopyinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferImageCopycallocStack()Deprecated.static VkBufferImageCopy.BuffercallocStack(int capacity)Deprecated.static VkBufferImageCopy.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VkBufferImageCopycallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()the size in texels of the image to copy inwidth,heightanddepth.VkBufferImageCopyimageExtent(java.util.function.Consumer<VkExtent3D> consumer)Passes theimageExtent()field to the specifiedConsumer.VkBufferImageCopyimageExtent(VkExtent3D value)Copies the specifiedVkExtent3Dto theimageExtent()field.VkOffset3DimageOffset()selects the initialx,y,zoffsets in texels of the sub-region of the source or destination image data.VkBufferImageCopyimageOffset(java.util.function.Consumer<VkOffset3D> consumer)Passes theimageOffset()field to the specifiedConsumer.VkBufferImageCopyimageOffset(VkOffset3D value)Copies the specifiedVkOffset3Dto theimageOffset()field.VkImageSubresourceLayersimageSubresource()aVkImageSubresourceLayersused to specify the specific image subresources of the image used for the source or destination image data.VkBufferImageCopyimageSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)Passes theimageSubresource()field to the specifiedConsumer.VkBufferImageCopyimageSubresource(VkImageSubresourceLayers value)Copies the specifiedVkImageSubresourceLayersto theimageSubresource()field.static VkBufferImageCopymalloc()Returns a newVkBufferImageCopyinstance allocated withmemAlloc.static VkBufferImageCopy.Buffermalloc(int capacity)Returns a newVkBufferImageCopy.Bufferinstance allocated withmemAlloc.static VkBufferImageCopy.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopy.Bufferinstance allocated on the specifiedMemoryStack.static VkBufferImageCopymalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferImageCopyinstance allocated on the specifiedMemoryStack.static VkBufferImageCopymallocStack()Deprecated.static VkBufferImageCopy.BuffermallocStack(int capacity)Deprecated.static VkBufferImageCopy.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VkBufferImageCopymallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()
the offset in bytes from the start of the buffer object where the image data is copied from or to.
-
bufferRowLength
public int 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
public int bufferImageHeight()
seebufferRowLength
-
imageSubresource
public VkImageSubresourceLayers imageSubresource()
aVkImageSubresourceLayersused to specify the specific image subresources of the image used for the source or destination image data.
-
imageOffset
public VkOffset3D imageOffset()
selects the initialx,y,zoffsets in texels of the sub-region of the source or destination image data.
-
imageExtent
public VkExtent3D imageExtent()
the size in texels of the image to copy inwidth,heightanddepth.
-
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 specifiedVkImageSubresourceLayersto 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 specifiedVkOffset3Dto 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 specifiedVkExtent3Dto 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 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
@Deprecated public static VkBufferImageCopy mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkBufferImageCopy callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkBufferImageCopy mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkBufferImageCopy callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkBufferImageCopy.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VkBufferImageCopy.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static VkBufferImageCopy.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 VkBufferImageCopy.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static VkBufferImageCopy malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferImageCopyinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkBufferImageCopy calloc(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
-
malloc
public static VkBufferImageCopy.Buffer malloc(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
-
calloc
public static VkBufferImageCopy.Buffer calloc(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.
-
-