org.lwjgl.vulkan.VkCopyImageToBufferInfo2KHR Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lwjgl-vulkan Show documentation
Show all versions of lwjgl-vulkan Show documentation
A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* Structure specifying parameters of an image to buffer copy command.
*
* Valid Usage
*
*
* - If the image region specified by each element of {@code pRegions} does not contain {@link VkCopyCommandTransformInfoQCOM} in its {@code pNext} chain, it must be contained within the specified {@code imageSubresource} of {@code srcImage}
* - If the image region specified by each element of {@code pRegions} contains {@link VkCopyCommandTransformInfoQCOM} in its {@code pNext} chain, the rotated source region as described in Buffer and Image Addressing with Rotation must be contained within {@code srcImage}
* - If any element of {@code pRegions} contains {@link VkCopyCommandTransformInfoQCOM} in its {@code pNext} chain, then {@code srcImage} must not be a blocked image
* - If any element of {@code pRegions} contains {@link VkCopyCommandTransformInfoQCOM} in its {@code pNext} chain, then {@code srcImage} must be of type {@link VK10#VK_IMAGE_TYPE_2D IMAGE_TYPE_2D}
* - If any element of {@code pRegions} contains {@link VkCopyCommandTransformInfoQCOM} in its {@code pNext} chain, then {@code srcImage} must not have a multi-planar format
*
*
*
* - {@code dstBuffer} must be large enough to contain all buffer locations that are accessed according to Buffer and Image Addressing, for each element of {@code pRegions}
* - The union of all source regions, and the union of all destination regions, specified by the elements of {@code pRegions}, must not overlap in memory
* - {@code srcImage} must have been created with {@link VK10#VK_IMAGE_USAGE_TRANSFER_SRC_BIT IMAGE_USAGE_TRANSFER_SRC_BIT} usage flag
* - The format features of {@code srcImage} must contain {@link VK11#VK_FORMAT_FEATURE_TRANSFER_SRC_BIT FORMAT_FEATURE_TRANSFER_SRC_BIT}
* - If {@code srcImage} is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - {@code dstBuffer} must have been created with {@link VK10#VK_BUFFER_USAGE_TRANSFER_DST_BIT BUFFER_USAGE_TRANSFER_DST_BIT} usage flag
* - If {@code dstBuffer} is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - {@code srcImage} must have a sample count equal to {@link VK10#VK_SAMPLE_COUNT_1_BIT SAMPLE_COUNT_1_BIT}
* - {@code srcImageLayout} must specify the layout of the image subresources of {@code srcImage} specified in {@code pRegions} at the time this command is executed on a {@code VkDevice}
* - {@code srcImageLayout} must be {@link VK10#VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL}, {@link VK10#VK_IMAGE_LAYOUT_GENERAL IMAGE_LAYOUT_GENERAL}, or {@link KHRSharedPresentableImage#VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR IMAGE_LAYOUT_SHARED_PRESENT_KHR}
* - The {@code imageSubresource.mipLevel} member of each element of {@code pRegions} must be less than the {@code mipLevels} specified in {@link VkImageCreateInfo} when {@code srcImage} was created
* - The
imageSubresource.baseArrayLayer + imageSubresource.layerCount
of each element of {@code pRegions} must be less than or equal to the {@code arrayLayers} specified in {@link VkImageCreateInfo} when {@code srcImage} was created
* - The {@code imageOffset} and {@code imageExtent} members of each element of {@code pRegions} must respect the image transfer granularity requirements of {@code commandBuffer}’s command pool’s queue family, as described in {@link VkQueueFamilyProperties}
* - {@code srcImage} must not have been created with {@code flags} containing {@link EXTFragmentDensityMap#VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT IMAGE_CREATE_SUBSAMPLED_BIT_EXT}
* - For each element of {@code pRegions} not containing {@link VkCopyCommandTransformInfoQCOM} in its {@code pNext} chain, {@code imageOffset.x} and
(imageExtent.width + imageOffset.x)
must both be greater than or equal to 0 and less than or equal to the width of the specified {@code imageSubresource} of {@code srcImage}
* - For each element of {@code pRegions} not containing {@link VkCopyCommandTransformInfoQCOM} in its {@code pNext} chain, {@code imageOffset.y} and
(imageExtent.height + imageOffset.y)
must both be greater than or equal to 0 and less than or equal to the height of the specified {@code imageSubresource} of {@code srcImage}
*
*
*
* - If {@code srcImage} does not have either a depth/stencil or a multi-planar format, then for each element of {@code pRegions}, {@code bufferOffset} must be a multiple of the format’s texel block size
* - If {@code srcImage} has a multi-planar format, then for each element of {@code pRegions}, {@code bufferOffset} must be a multiple of the element size of the compatible format for the format and the {@code aspectMask} of the {@code imageSubresource} as defined in Compatible formats of planes of multi-planar formats
* - If {@code srcImage} is of type {@link VK10#VK_IMAGE_TYPE_1D IMAGE_TYPE_1D}, then for each element of {@code pRegions}, {@code imageOffset.y} must be 0 and {@code imageExtent.height} must be 1
* - For each element of {@code pRegions}, {@code imageOffset.z} and
(imageExtent.depth + imageOffset.z)
must both be greater than or equal to 0 and less than or equal to the depth of the specified {@code imageSubresource} of {@code srcImage}
* - If {@code srcImage} is of type {@link VK10#VK_IMAGE_TYPE_1D IMAGE_TYPE_1D} or {@link VK10#VK_IMAGE_TYPE_2D IMAGE_TYPE_2D}, then for each element of {@code pRegions}, {@code imageOffset.z} must be 0 and {@code imageExtent.depth} must be 1
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, {@code bufferRowLength} must be a multiple of the compressed texel block width
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, {@code bufferImageHeight} must be a multiple of the compressed texel block height
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, all members of {@code imageOffset} must be a multiple of the corresponding dimensions of the compressed texel block
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, {@code bufferOffset} must be a multiple of the compressed texel block size in bytes
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, {@code imageExtent.width} must be a multiple of the compressed texel block width or
(imageExtent.width + imageOffset.x)
must equal the width of the specified {@code imageSubresource} of {@code srcImage}
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, {@code imageExtent.height} must be a multiple of the compressed texel block height or
(imageExtent.height + imageOffset.y)
must equal the height of the specified {@code imageSubresource} of {@code srcImage}
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, {@code imageExtent.depth} must be a multiple of the compressed texel block depth or
(imageExtent.depth + imageOffset.z)
must equal the depth of the specified {@code imageSubresource} of {@code srcImage}
* - For each element of {@code pRegions}, {@code imageSubresource.aspectMask} must specify aspects present in {@code srcImage}
* - If {@code srcImage} has a multi-planar format, then for each element of {@code pRegions}, {@code imageSubresource.aspectMask} must be {@link VK11#VK_IMAGE_ASPECT_PLANE_0_BIT IMAGE_ASPECT_PLANE_0_BIT}, {@link VK11#VK_IMAGE_ASPECT_PLANE_1_BIT IMAGE_ASPECT_PLANE_1_BIT}, or {@link VK11#VK_IMAGE_ASPECT_PLANE_2_BIT IMAGE_ASPECT_PLANE_2_BIT} (with {@link VK11#VK_IMAGE_ASPECT_PLANE_2_BIT IMAGE_ASPECT_PLANE_2_BIT} valid only for image formats with three planes)
* - If {@code srcImage} is of type {@link VK10#VK_IMAGE_TYPE_3D IMAGE_TYPE_3D}, for each element of {@code pRegions}, {@code imageSubresource.baseArrayLayer} must be 0 and {@code imageSubresource.layerCount} must be 1
* - If {@code srcImage} is not a blocked image, for each element of {@code pRegions}, {@code bufferRowLength} multiplied by the texel block size of {@code srcImage} must be less than or equal to
231-1
* - If {@code srcImage} is a blocked image, for each element of {@code pRegions}, {@code bufferRowLength} divided by the compressed texel block width and then multiplied by the texel block size of {@code srcImage} must be less than or equal to
231-1
* - If the queue family used to create the {@code VkCommandPool} which {@code commandBuffer} was allocated from does not support {@link VK10#VK_QUEUE_GRAPHICS_BIT QUEUE_GRAPHICS_BIT} or {@link VK10#VK_QUEUE_COMPUTE_BIT QUEUE_COMPUTE_BIT}, the {@code bufferOffset} member of any element of {@code pRegions} must be a multiple of 4
* - If {@code srcImage} has a depth/stencil format, the {@code bufferOffset} member of any element of {@code pRegions} must be a multiple of 4
*
*
* Valid Usage (Implicit)
*
*
* - {@code sType} must be {@link KHRCopyCommands2#VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR}
* - {@code pNext} must be {@code NULL}
* - {@code srcImage} must be a valid {@code VkImage} handle
* - {@code srcImageLayout} must be a valid {@code VkImageLayout} value
* - {@code dstBuffer} must be a valid {@code VkBuffer} handle
* - {@code pRegions} must be a valid pointer to an array of {@code regionCount} valid {@link VkBufferImageCopy2KHR} structures
* - {@code regionCount} must be greater than 0
* - Both of {@code dstBuffer}, and {@code srcImage} must have been created, allocated, or retrieved from the same {@code VkDevice}
*
*
* See Also
*
* {@link VkBufferImageCopy2KHR}, {@link KHRCopyCommands2#vkCmdCopyImageToBuffer2KHR CmdCopyImageToBuffer2KHR}
*
* Layout
*
*
* struct VkCopyImageToBufferInfo2KHR {
* VkStructureType {@link #sType};
* void const * {@link #pNext};
* VkImage {@link #srcImage};
* VkImageLayout {@link #srcImageLayout};
* VkBuffer {@link #dstBuffer};
* uint32_t {@link #regionCount};
* {@link VkBufferImageCopy2KHR VkBufferImageCopy2KHR} const * {@link #pRegions};
* }
*/
public class VkCopyImageToBufferInfo2KHR extends Struct implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
STYPE,
PNEXT,
SRCIMAGE,
SRCIMAGELAYOUT,
DSTBUFFER,
REGIONCOUNT,
PREGIONS;
static {
Layout layout = __struct(
__member(4),
__member(POINTER_SIZE),
__member(8),
__member(4),
__member(8),
__member(4),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
STYPE = layout.offsetof(0);
PNEXT = layout.offsetof(1);
SRCIMAGE = layout.offsetof(2);
SRCIMAGELAYOUT = layout.offsetof(3);
DSTBUFFER = layout.offsetof(4);
REGIONCOUNT = layout.offsetof(5);
PREGIONS = layout.offsetof(6);
}
/**
* Creates a {@code VkCopyImageToBufferInfo2KHR} instance at the current position of the specified {@link 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 VkCopyImageToBufferInfo2KHR(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** the type of this structure. */
@NativeType("VkStructureType")
public int sType() { return nsType(address()); }
/** {@code NULL} or a pointer to a structure extending this structure. */
@NativeType("void const *")
public long pNext() { return npNext(address()); }
/** the source image. */
@NativeType("VkImage")
public long srcImage() { return nsrcImage(address()); }
/** the layout of the source image subresources for the copy. */
@NativeType("VkImageLayout")
public int srcImageLayout() { return nsrcImageLayout(address()); }
/** the destination buffer. */
@NativeType("VkBuffer")
public long dstBuffer() { return ndstBuffer(address()); }
/** the number of regions to copy. */
@NativeType("uint32_t")
public int regionCount() { return nregionCount(address()); }
/** a pointer to an array of {@link VkBufferImageCopy2KHR} structures specifying the regions to copy. */
@NativeType("VkBufferImageCopy2KHR const *")
public VkBufferImageCopy2KHR.Buffer pRegions() { return npRegions(address()); }
/** Sets the specified value to the {@link #sType} field. */
public VkCopyImageToBufferInfo2KHR sType(@NativeType("VkStructureType") int value) { nsType(address(), value); return this; }
/** Sets the {@link KHRCopyCommands2#VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR} value to the {@link #sType} field. */
public VkCopyImageToBufferInfo2KHR sType$Default() { return sType(KHRCopyCommands2.VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR); }
/** Sets the specified value to the {@link #pNext} field. */
public VkCopyImageToBufferInfo2KHR pNext(@NativeType("void const *") long value) { npNext(address(), value); return this; }
/** Sets the specified value to the {@link #srcImage} field. */
public VkCopyImageToBufferInfo2KHR srcImage(@NativeType("VkImage") long value) { nsrcImage(address(), value); return this; }
/** Sets the specified value to the {@link #srcImageLayout} field. */
public VkCopyImageToBufferInfo2KHR srcImageLayout(@NativeType("VkImageLayout") int value) { nsrcImageLayout(address(), value); return this; }
/** Sets the specified value to the {@link #dstBuffer} field. */
public VkCopyImageToBufferInfo2KHR dstBuffer(@NativeType("VkBuffer") long value) { ndstBuffer(address(), value); return this; }
/** Sets the address of the specified {@link VkBufferImageCopy2KHR.Buffer} to the {@link #pRegions} field. */
public VkCopyImageToBufferInfo2KHR pRegions(@NativeType("VkBufferImageCopy2KHR const *") VkBufferImageCopy2KHR.Buffer value) { npRegions(address(), value); return this; }
/** Initializes this struct with the specified values. */
public VkCopyImageToBufferInfo2KHR set(
int sType,
long pNext,
long srcImage,
int srcImageLayout,
long dstBuffer,
VkBufferImageCopy2KHR.Buffer pRegions
) {
sType(sType);
pNext(pNext);
srcImage(srcImage);
srcImageLayout(srcImageLayout);
dstBuffer(dstBuffer);
pRegions(pRegions);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public VkCopyImageToBufferInfo2KHR set(VkCopyImageToBufferInfo2KHR src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code VkCopyImageToBufferInfo2KHR} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static VkCopyImageToBufferInfo2KHR malloc() {
return wrap(VkCopyImageToBufferInfo2KHR.class, nmemAllocChecked(SIZEOF));
}
/** Returns a new {@code VkCopyImageToBufferInfo2KHR} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static VkCopyImageToBufferInfo2KHR calloc() {
return wrap(VkCopyImageToBufferInfo2KHR.class, nmemCallocChecked(1, SIZEOF));
}
/** Returns a new {@code VkCopyImageToBufferInfo2KHR} instance allocated with {@link BufferUtils}. */
public static VkCopyImageToBufferInfo2KHR create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return wrap(VkCopyImageToBufferInfo2KHR.class, memAddress(container), container);
}
/** Returns a new {@code VkCopyImageToBufferInfo2KHR} instance for the specified memory address. */
public static VkCopyImageToBufferInfo2KHR create(long address) {
return wrap(VkCopyImageToBufferInfo2KHR.class, address);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static VkCopyImageToBufferInfo2KHR createSafe(long address) {
return address == NULL ? null : wrap(VkCopyImageToBufferInfo2KHR.class, address);
}
/**
* Returns a new {@link VkCopyImageToBufferInfo2KHR.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static VkCopyImageToBufferInfo2KHR.Buffer malloc(int capacity) {
return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link VkCopyImageToBufferInfo2KHR.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static VkCopyImageToBufferInfo2KHR.Buffer calloc(int capacity) {
return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link VkCopyImageToBufferInfo2KHR.Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static VkCopyImageToBufferInfo2KHR.Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return wrap(Buffer.class, memAddress(container), capacity, container);
}
/**
* Create a {@link VkCopyImageToBufferInfo2KHR.Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static VkCopyImageToBufferInfo2KHR.Buffer create(long address, int capacity) {
return wrap(Buffer.class, address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static VkCopyImageToBufferInfo2KHR.Buffer createSafe(long address, int capacity) {
return address == NULL ? null : wrap(Buffer.class, address, capacity);
}
/**
* Returns a new {@code VkCopyImageToBufferInfo2KHR} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static VkCopyImageToBufferInfo2KHR malloc(MemoryStack stack) {
return wrap(VkCopyImageToBufferInfo2KHR.class, stack.nmalloc(ALIGNOF, SIZEOF));
}
/**
* Returns a new {@code VkCopyImageToBufferInfo2KHR} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static VkCopyImageToBufferInfo2KHR calloc(MemoryStack stack) {
return wrap(VkCopyImageToBufferInfo2KHR.class, stack.ncalloc(ALIGNOF, 1, SIZEOF));
}
/**
* Returns a new {@link VkCopyImageToBufferInfo2KHR.Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static VkCopyImageToBufferInfo2KHR.Buffer malloc(int capacity, MemoryStack stack) {
return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link VkCopyImageToBufferInfo2KHR.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static VkCopyImageToBufferInfo2KHR.Buffer calloc(int capacity, MemoryStack stack) {
return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #sType}. */
public static int nsType(long struct) { return UNSAFE.getInt(null, struct + VkCopyImageToBufferInfo2KHR.STYPE); }
/** Unsafe version of {@link #pNext}. */
public static long npNext(long struct) { return memGetAddress(struct + VkCopyImageToBufferInfo2KHR.PNEXT); }
/** Unsafe version of {@link #srcImage}. */
public static long nsrcImage(long struct) { return UNSAFE.getLong(null, struct + VkCopyImageToBufferInfo2KHR.SRCIMAGE); }
/** Unsafe version of {@link #srcImageLayout}. */
public static int nsrcImageLayout(long struct) { return UNSAFE.getInt(null, struct + VkCopyImageToBufferInfo2KHR.SRCIMAGELAYOUT); }
/** Unsafe version of {@link #dstBuffer}. */
public static long ndstBuffer(long struct) { return UNSAFE.getLong(null, struct + VkCopyImageToBufferInfo2KHR.DSTBUFFER); }
/** Unsafe version of {@link #regionCount}. */
public static int nregionCount(long struct) { return UNSAFE.getInt(null, struct + VkCopyImageToBufferInfo2KHR.REGIONCOUNT); }
/** Unsafe version of {@link #pRegions}. */
public static VkBufferImageCopy2KHR.Buffer npRegions(long struct) { return VkBufferImageCopy2KHR.create(memGetAddress(struct + VkCopyImageToBufferInfo2KHR.PREGIONS), nregionCount(struct)); }
/** Unsafe version of {@link #sType(int) sType}. */
public static void nsType(long struct, int value) { UNSAFE.putInt(null, struct + VkCopyImageToBufferInfo2KHR.STYPE, value); }
/** Unsafe version of {@link #pNext(long) pNext}. */
public static void npNext(long struct, long value) { memPutAddress(struct + VkCopyImageToBufferInfo2KHR.PNEXT, value); }
/** Unsafe version of {@link #srcImage(long) srcImage}. */
public static void nsrcImage(long struct, long value) { UNSAFE.putLong(null, struct + VkCopyImageToBufferInfo2KHR.SRCIMAGE, value); }
/** Unsafe version of {@link #srcImageLayout(int) srcImageLayout}. */
public static void nsrcImageLayout(long struct, int value) { UNSAFE.putInt(null, struct + VkCopyImageToBufferInfo2KHR.SRCIMAGELAYOUT, value); }
/** Unsafe version of {@link #dstBuffer(long) dstBuffer}. */
public static void ndstBuffer(long struct, long value) { UNSAFE.putLong(null, struct + VkCopyImageToBufferInfo2KHR.DSTBUFFER, value); }
/** Sets the specified value to the {@code regionCount} field of the specified {@code struct}. */
public static void nregionCount(long struct, int value) { UNSAFE.putInt(null, struct + VkCopyImageToBufferInfo2KHR.REGIONCOUNT, value); }
/** Unsafe version of {@link #pRegions(VkBufferImageCopy2KHR.Buffer) pRegions}. */
public static void npRegions(long struct, VkBufferImageCopy2KHR.Buffer value) { memPutAddress(struct + VkCopyImageToBufferInfo2KHR.PREGIONS, value.address()); nregionCount(struct, value.remaining()); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
check(memGetAddress(struct + VkCopyImageToBufferInfo2KHR.PREGIONS));
}
// -----------------------------------
/** An array of {@link VkCopyImageToBufferInfo2KHR} structs. */
public static class Buffer extends StructBuffer implements NativeResource {
private static final VkCopyImageToBufferInfo2KHR ELEMENT_FACTORY = VkCopyImageToBufferInfo2KHR.create(-1L);
/**
* Creates a new {@code VkCopyImageToBufferInfo2KHR.Buffer} instance backed by the specified container.
*
* Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link VkCopyImageToBufferInfo2KHR#SIZEOF}, and its mark will be undefined.
*
* The created buffer instance holds a strong reference to the container object.
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected VkCopyImageToBufferInfo2KHR getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@link VkCopyImageToBufferInfo2KHR#sType} field. */
@NativeType("VkStructureType")
public int sType() { return VkCopyImageToBufferInfo2KHR.nsType(address()); }
/** @return the value of the {@link VkCopyImageToBufferInfo2KHR#pNext} field. */
@NativeType("void const *")
public long pNext() { return VkCopyImageToBufferInfo2KHR.npNext(address()); }
/** @return the value of the {@link VkCopyImageToBufferInfo2KHR#srcImage} field. */
@NativeType("VkImage")
public long srcImage() { return VkCopyImageToBufferInfo2KHR.nsrcImage(address()); }
/** @return the value of the {@link VkCopyImageToBufferInfo2KHR#srcImageLayout} field. */
@NativeType("VkImageLayout")
public int srcImageLayout() { return VkCopyImageToBufferInfo2KHR.nsrcImageLayout(address()); }
/** @return the value of the {@link VkCopyImageToBufferInfo2KHR#dstBuffer} field. */
@NativeType("VkBuffer")
public long dstBuffer() { return VkCopyImageToBufferInfo2KHR.ndstBuffer(address()); }
/** @return the value of the {@link VkCopyImageToBufferInfo2KHR#regionCount} field. */
@NativeType("uint32_t")
public int regionCount() { return VkCopyImageToBufferInfo2KHR.nregionCount(address()); }
/** @return a {@link VkBufferImageCopy2KHR.Buffer} view of the struct array pointed to by the {@link VkCopyImageToBufferInfo2KHR#pRegions} field. */
@NativeType("VkBufferImageCopy2KHR const *")
public VkBufferImageCopy2KHR.Buffer pRegions() { return VkCopyImageToBufferInfo2KHR.npRegions(address()); }
/** Sets the specified value to the {@link VkCopyImageToBufferInfo2KHR#sType} field. */
public VkCopyImageToBufferInfo2KHR.Buffer sType(@NativeType("VkStructureType") int value) { VkCopyImageToBufferInfo2KHR.nsType(address(), value); return this; }
/** Sets the {@link KHRCopyCommands2#VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR} value to the {@link VkCopyImageToBufferInfo2KHR#sType} field. */
public VkCopyImageToBufferInfo2KHR.Buffer sType$Default() { return sType(KHRCopyCommands2.VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR); }
/** Sets the specified value to the {@link VkCopyImageToBufferInfo2KHR#pNext} field. */
public VkCopyImageToBufferInfo2KHR.Buffer pNext(@NativeType("void const *") long value) { VkCopyImageToBufferInfo2KHR.npNext(address(), value); return this; }
/** Sets the specified value to the {@link VkCopyImageToBufferInfo2KHR#srcImage} field. */
public VkCopyImageToBufferInfo2KHR.Buffer srcImage(@NativeType("VkImage") long value) { VkCopyImageToBufferInfo2KHR.nsrcImage(address(), value); return this; }
/** Sets the specified value to the {@link VkCopyImageToBufferInfo2KHR#srcImageLayout} field. */
public VkCopyImageToBufferInfo2KHR.Buffer srcImageLayout(@NativeType("VkImageLayout") int value) { VkCopyImageToBufferInfo2KHR.nsrcImageLayout(address(), value); return this; }
/** Sets the specified value to the {@link VkCopyImageToBufferInfo2KHR#dstBuffer} field. */
public VkCopyImageToBufferInfo2KHR.Buffer dstBuffer(@NativeType("VkBuffer") long value) { VkCopyImageToBufferInfo2KHR.ndstBuffer(address(), value); return this; }
/** Sets the address of the specified {@link VkBufferImageCopy2KHR.Buffer} to the {@link VkCopyImageToBufferInfo2KHR#pRegions} field. */
public VkCopyImageToBufferInfo2KHR.Buffer pRegions(@NativeType("VkBufferImageCopy2KHR const *") VkBufferImageCopy2KHR.Buffer value) { VkCopyImageToBufferInfo2KHR.npRegions(address(), value); return this; }
}
}