Package org.lwjgl.vulkan
Class VkClearAttachment
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkClearAttachment
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkClearAttachment extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying a clear attachment.Description
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
(orstencilLoadOp
) ofVkAttachmentDescription
toATTACHMENT_LOAD_OP_CLEAR
, as described forCreateRenderPass
.Valid Usage
- If
aspectMask
includesIMAGE_ASPECT_COLOR_BIT
, it must not includeIMAGE_ASPECT_DEPTH_BIT
orIMAGE_ASPECT_STENCIL_BIT
aspectMask
must not includeIMAGE_ASPECT_METADATA_BIT
aspectMask
must not includeVK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT
for any indexi
.clearValue
must be a validVkClearValue
union
Valid Usage (Implicit)
aspectMask
must be a valid combination ofVkImageAspectFlagBits
valuesaspectMask
must not be 0
See Also
VkClearValue
,CmdClearAttachments
Member documentation
aspectMask
– a mask selecting the color, depth and/or stencil aspects of the attachment to be cleared.colorAttachment
– only meaningful ifIMAGE_ASPECT_COLOR_BIT
is set inaspectMask
, in which case it is an index to thepColorAttachments
array in theVkSubpassDescription
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.
Layout
struct VkClearAttachment { VkImageAspectFlags aspectMask; uint32_t colorAttachment;
VkClearValue
clearValue; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkClearAttachment.Buffer
An array ofVkClearAttachment
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
ASPECTMASK
CLEARVALUE
COLORATTACHMENTThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkClearAttachment(java.nio.ByteBuffer container)
Creates aVkClearAttachment
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
aspectMask()
Returns the value of theaspectMask
field.VkClearAttachment
aspectMask(int value)
Sets the specified value to theaspectMask
field.static VkClearAttachment
calloc()
Returns a newVkClearAttachment
instance allocated withmemCalloc
.static VkClearAttachment.Buffer
calloc(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated withmemCalloc
.static VkClearAttachment
callocStack()
Returns a newVkClearAttachment
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkClearAttachment.Buffer
callocStack(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkClearAttachment.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkClearAttachment
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.VkClearValue
clearValue()
Returns aVkClearValue
view of theclearValue
field.VkClearAttachment
clearValue(java.util.function.Consumer<VkClearValue> consumer)
Passes theclearValue
field to the specifiedConsumer
.VkClearAttachment
clearValue(VkClearValue value)
Copies the specifiedVkClearValue
to theclearValue
field.int
colorAttachment()
Returns the value of thecolorAttachment
field.VkClearAttachment
colorAttachment(int value)
Sets the specified value to thecolorAttachment
field.static VkClearAttachment
create()
Returns a newVkClearAttachment
instance allocated withBufferUtils
.static VkClearAttachment.Buffer
create(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated withBufferUtils
.static VkClearAttachment
create(long address)
Returns a newVkClearAttachment
instance for the specified memory address.static VkClearAttachment.Buffer
create(long address, int capacity)
Create aVkClearAttachment.Buffer
instance at the specified memory.static VkClearAttachment
createSafe(long address)
static VkClearAttachment.Buffer
createSafe(long address, int capacity)
static VkClearAttachment
malloc()
Returns a newVkClearAttachment
instance allocated withmemAlloc
.static VkClearAttachment.Buffer
malloc(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated withmemAlloc
.static VkClearAttachment
mallocStack()
Returns a newVkClearAttachment
instance allocated on the thread-localMemoryStack
.static VkClearAttachment.Buffer
mallocStack(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated on the thread-localMemoryStack
.static VkClearAttachment.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment.Buffer
instance allocated on the specifiedMemoryStack
.static VkClearAttachment
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment
instance allocated on the specifiedMemoryStack
.static int
naspectMask(long struct)
Unsafe version ofaspectMask()
.static void
naspectMask(long struct, int value)
Unsafe version ofaspectMask
.static VkClearValue
nclearValue(long struct)
Unsafe version ofclearValue()
.static void
nclearValue(long struct, VkClearValue value)
Unsafe version ofclearValue
.static int
ncolorAttachment(long struct)
Unsafe version ofcolorAttachment()
.static void
ncolorAttachment(long struct, int value)
Unsafe version ofcolorAttachment
.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()
-
-
-
Constructor Detail
-
VkClearAttachment
public VkClearAttachment(java.nio.ByteBuffer container)
Creates aVkClearAttachment
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
-
aspectMask
public int aspectMask()
Returns the value of theaspectMask
field.
-
colorAttachment
public int colorAttachment()
Returns the value of thecolorAttachment
field.
-
clearValue
public VkClearValue clearValue()
Returns aVkClearValue
view of theclearValue
field.
-
aspectMask
public VkClearAttachment aspectMask(int value)
Sets the specified value to theaspectMask
field.
-
colorAttachment
public VkClearAttachment colorAttachment(int value)
Sets the specified value to thecolorAttachment
field.
-
clearValue
public VkClearAttachment clearValue(VkClearValue value)
Copies the specifiedVkClearValue
to theclearValue
field.
-
clearValue
public VkClearAttachment clearValue(java.util.function.Consumer<VkClearValue> consumer)
Passes theclearValue
field to the specifiedConsumer
.
-
set
public VkClearAttachment set(int aspectMask, int colorAttachment, VkClearValue clearValue)
Initializes this struct with the specified values.
-
set
public VkClearAttachment set(VkClearAttachment src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkClearAttachment malloc()
Returns a newVkClearAttachment
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkClearAttachment calloc()
Returns a newVkClearAttachment
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkClearAttachment create()
Returns a newVkClearAttachment
instance allocated withBufferUtils
.
-
create
public static VkClearAttachment create(long address)
Returns a newVkClearAttachment
instance for the specified memory address.
-
createSafe
@Nullable public static VkClearAttachment createSafe(long address)
-
malloc
public static VkClearAttachment.Buffer malloc(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkClearAttachment.Buffer calloc(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkClearAttachment.Buffer create(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkClearAttachment.Buffer create(long address, int capacity)
Create aVkClearAttachment.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkClearAttachment.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkClearAttachment mallocStack()
Returns a newVkClearAttachment
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkClearAttachment callocStack()
Returns a newVkClearAttachment
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkClearAttachment mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkClearAttachment callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkClearAttachment.Buffer mallocStack(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkClearAttachment.Buffer callocStack(int capacity)
Returns a newVkClearAttachment.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkClearAttachment.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkClearAttachment.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkClearAttachment.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
naspectMask
public static int naspectMask(long struct)
Unsafe version ofaspectMask()
.
-
ncolorAttachment
public static int ncolorAttachment(long struct)
Unsafe version ofcolorAttachment()
.
-
nclearValue
public static VkClearValue nclearValue(long struct)
Unsafe version ofclearValue()
.
-
naspectMask
public static void naspectMask(long struct, int value)
Unsafe version ofaspectMask
.
-
ncolorAttachment
public static void ncolorAttachment(long struct, int value)
Unsafe version ofcolorAttachment
.
-
nclearValue
public static void nclearValue(long struct, VkClearValue value)
Unsafe version ofclearValue
.
-
-