public class VkClearAttachment
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
No memory barriers are needed between vkCmdClearAttachments and preceding or subsequent draw or attachment clear commands in the same subpass.
The vkCmdClearAttachments command is not affected by the bound pipeline state.
Attachments can also be cleared at the beginning of a render pass instance by setting loadOp (or stencilLoadOp) of VkAttachmentDescription to ATTACHMENT_LOAD_OP_CLEAR, as described for CreateRenderPass.
aspectMask includes IMAGE_ASPECT_COLOR_BIT, it must not include IMAGE_ASPECT_DEPTH_BIT or IMAGE_ASPECT_STENCIL_BITaspectMask must not include IMAGE_ASPECT_METADATA_BITaspectMask must not include VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT for any index i.clearValue must be a valid VkClearValue unionaspectMask must be a valid combination of VkImageAspectFlagBits valuesaspectMask must not be 0VkClearValue, CmdClearAttachments
aspectMask – a mask selecting the color, depth and/or stencil aspects of the attachment to be cleared.colorAttachment – only meaningful if IMAGE_ASPECT_COLOR_BIT is set in aspectMask, in which case it is an index to the pColorAttachments array in the VkSubpassDescription structure of the current subpass which selects the color attachment to clear.clearValue – the color or depth/stencil value to clear the attachment to, as described in Clear Values below.
struct VkClearAttachment {
VkImageAspectFlags aspectMask;
uint32_t colorAttachment;
VkClearValue clearValue;
}| Modifier and Type | Class and Description |
|---|---|
static class |
VkClearAttachment.Buffer
An array of
VkClearAttachment structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
ASPECTMASK
The struct member offsets.
|
static int |
CLEARVALUE
The struct member offsets.
|
static int |
COLORATTACHMENT
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
VkClearAttachment(java.nio.ByteBuffer container)
Creates a
VkClearAttachment 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. |
VkClearAttachment |
aspectMask(int value)
Sets the specified value to the
aspectMask field. |
static VkClearAttachment |
calloc()
Returns a new
VkClearAttachment instance allocated with memCalloc. |
static VkClearAttachment.Buffer |
calloc(int capacity)
Returns a new
VkClearAttachment.Buffer instance allocated with memCalloc. |
static VkClearAttachment |
callocStack()
Returns a new
VkClearAttachment instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkClearAttachment.Buffer |
callocStack(int capacity)
Returns a new
VkClearAttachment.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkClearAttachment.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkClearAttachment.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkClearAttachment |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkClearAttachment instance allocated on the specified MemoryStack and initializes all its bits to zero. |
VkClearValue |
clearValue()
Returns a
VkClearValue view of the clearValue field. |
VkClearAttachment |
clearValue(java.util.function.Consumer<VkClearValue> consumer)
Passes the
clearValue field to the specified Consumer. |
VkClearAttachment |
clearValue(VkClearValue value)
Copies the specified
VkClearValue to the clearValue field. |
int |
colorAttachment()
Returns the value of the
colorAttachment field. |
VkClearAttachment |
colorAttachment(int value)
Sets the specified value to the
colorAttachment field. |
static VkClearAttachment |
create()
Returns a new
VkClearAttachment instance allocated with BufferUtils. |
static VkClearAttachment.Buffer |
create(int capacity)
Returns a new
VkClearAttachment.Buffer instance allocated with BufferUtils. |
static VkClearAttachment |
create(long address)
Returns a new
VkClearAttachment instance for the specified memory address. |
static VkClearAttachment.Buffer |
create(long address,
int capacity)
Create a
VkClearAttachment.Buffer instance at the specified memory. |
static VkClearAttachment |
createSafe(long address)
|
static VkClearAttachment.Buffer |
createSafe(long address,
int capacity)
|
static VkClearAttachment |
malloc()
Returns a new
VkClearAttachment instance allocated with memAlloc. |
static VkClearAttachment.Buffer |
malloc(int capacity)
Returns a new
VkClearAttachment.Buffer instance allocated with memAlloc. |
static VkClearAttachment |
mallocStack()
Returns a new
VkClearAttachment instance allocated on the thread-local MemoryStack. |
static VkClearAttachment.Buffer |
mallocStack(int capacity)
Returns a new
VkClearAttachment.Buffer instance allocated on the thread-local MemoryStack. |
static VkClearAttachment.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkClearAttachment.Buffer instance allocated on the specified MemoryStack. |
static VkClearAttachment |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkClearAttachment 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 VkClearValue |
nclearValue(long struct)
Unsafe version of
clearValue(). |
static void |
nclearValue(long struct,
VkClearValue value)
Unsafe version of
clearValue. |
static int |
ncolorAttachment(long struct)
Unsafe version of
colorAttachment(). |
static void |
ncolorAttachment(long struct,
int value)
Unsafe version of
colorAttachment. |
VkClearAttachment |
set(int aspectMask,
int colorAttachment,
VkClearValue clearValue)
Initializes this struct with the specified values.
|
VkClearAttachment |
set(VkClearAttachment 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 COLORATTACHMENT
public static final int CLEARVALUE
public VkClearAttachment(java.nio.ByteBuffer container)
VkClearAttachment 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 colorAttachment()
colorAttachment field.public VkClearValue clearValue()
VkClearValue view of the clearValue field.public VkClearAttachment aspectMask(int value)
aspectMask field.public VkClearAttachment colorAttachment(int value)
colorAttachment field.public VkClearAttachment clearValue(VkClearValue value)
VkClearValue to the clearValue field.public VkClearAttachment clearValue(java.util.function.Consumer<VkClearValue> consumer)
clearValue field to the specified Consumer.public VkClearAttachment set(int aspectMask, int colorAttachment, VkClearValue clearValue)
public VkClearAttachment set(VkClearAttachment src)
src - the source structpublic static VkClearAttachment malloc()
VkClearAttachment instance allocated with memAlloc. The instance must be explicitly freed.public static VkClearAttachment calloc()
VkClearAttachment instance allocated with memCalloc. The instance must be explicitly freed.public static VkClearAttachment create()
VkClearAttachment instance allocated with BufferUtils.public static VkClearAttachment create(long address)
VkClearAttachment instance for the specified memory address.@Nullable public static VkClearAttachment createSafe(long address)
public static VkClearAttachment.Buffer malloc(int capacity)
VkClearAttachment.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkClearAttachment.Buffer calloc(int capacity)
VkClearAttachment.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkClearAttachment.Buffer create(int capacity)
VkClearAttachment.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static VkClearAttachment.Buffer create(long address, int capacity)
VkClearAttachment.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static VkClearAttachment.Buffer createSafe(long address, int capacity)
public static VkClearAttachment mallocStack()
VkClearAttachment instance allocated on the thread-local MemoryStack.public static VkClearAttachment callocStack()
VkClearAttachment instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static VkClearAttachment mallocStack(org.lwjgl.system.MemoryStack stack)
VkClearAttachment instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static VkClearAttachment callocStack(org.lwjgl.system.MemoryStack stack)
VkClearAttachment instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static VkClearAttachment.Buffer mallocStack(int capacity)
VkClearAttachment.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static VkClearAttachment.Buffer callocStack(int capacity)
VkClearAttachment.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static VkClearAttachment.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkClearAttachment.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static VkClearAttachment.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkClearAttachment.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 ncolorAttachment(long struct)
colorAttachment().public static VkClearValue nclearValue(long struct)
clearValue().public static void naspectMask(long struct,
int value)
aspectMask.public static void ncolorAttachment(long struct,
int value)
colorAttachment.public static void nclearValue(long struct,
VkClearValue value)
clearValue.Copyright LWJGL. All Rights Reserved. License terms.