Class VkAttachmentDescription
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkAttachmentDescription
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkAttachmentDescription extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying an attachment description.Description
If the attachment uses a color format, then
loadOp
andstoreOp
are used, andstencilLoadOp
andstencilStoreOp
are ignored. If the format has depth and/or stencil components,loadOp
andstoreOp
apply only to the depth data, whilestencilLoadOp
andstencilStoreOp
define how the stencil data is handled.loadOp
andstencilLoadOp
define the load operations that execute as part of the first subpass that uses the attachment.storeOp
andstencilStoreOp
define the store operations that execute as part of the last subpass that uses the attachment.The load operation for each sample in an attachment happens-before any recorded command which accesses the sample in the first subpass where the attachment is used. Load operations for attachments with a depth/stencil format execute in the
PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
pipeline stage. Load operations for attachments with a color format execute in thePIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
pipeline stage.The store operation for each sample in an attachment happens-after any recorded command which accesses the sample in the last subpass where the attachment is used. Store operations for attachments with a depth/stencil format execute in the
PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT
pipeline stage. Store operations for attachments with a color format execute in thePIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
pipeline stage.If an attachment is not used by any subpass, then
loadOp
,storeOp
,stencilStoreOp
, andstencilLoadOp
are ignored, and the attachment's memory contents will not be modified by execution of a render pass instance.The load and store operations apply on the first and last use of each view in the render pass, respectively. If a view index of an attachment is not included in the view mask in any subpass that uses it, then the load and store operations are ignored, and the attachment's memory contents will not be modified by execution of a render pass instance.
During a render pass instance, input/color attachments with color formats that have a component size of 8, 16, or 32 bits must be represented in the attachment's format throughout the instance. Attachments with other floating- or fixed-point color formats, or with depth components may be represented in a format with a precision higher than the attachment format, but must be represented with the same range. When such a component is loaded via the
loadOp
, it will be converted into an implementation-dependent format used by the render pass. Such components must be converted from the render pass format, to the format of the attachment, before they are resolved or stored at the end of a render pass instance viastoreOp
. Conversions occur as described in Numeric Representation and Computation and Fixed-Point Data Conversions.If
flags
includesATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT
, then the attachment is treated as if it shares physical memory with another attachment in the same render pass. This information limits the ability of the implementation to reorder certain operations (like layout transitions and theloadOp
) such that it is not improperly reordered against other uses of the same physical memory via a different attachment. This is described in more detail below.Valid Usage
finalLayout
must not beIMAGE_LAYOUT_UNDEFINED
orIMAGE_LAYOUT_PREINITIALIZED
Valid Usage (Implicit)
flags
must be a valid combination ofVkAttachmentDescriptionFlagBits
valuesformat
must be a validVkFormat
valuesamples
must be a validVkSampleCountFlagBits
valueloadOp
must be a validVkAttachmentLoadOp
valuestoreOp
must be a validVkAttachmentStoreOp
valuestencilLoadOp
must be a validVkAttachmentLoadOp
valuestencilStoreOp
must be a validVkAttachmentStoreOp
valueinitialLayout
must be a validVkImageLayout
valuefinalLayout
must be a validVkImageLayout
value
See Also
Member documentation
flags
– a bitmask ofVkAttachmentDescriptionFlagBits
specifying additional properties of the attachment.format
– aVkFormat
value specifying the format of the image view that will be used for the attachment.samples
– the number of samples of the image as defined inVkSampleCountFlagBits
.loadOp
– aVkAttachmentLoadOp
value specifying how the contents of color and depth components of the attachment are treated at the beginning of the subpass where it is first used.storeOp
– aVkAttachmentStoreOp
value specifying how the contents of color and depth components of the attachment are treated at the end of the subpass where it is last used.stencilLoadOp
– aVkAttachmentLoadOp
value specifying how the contents of stencil components of the attachment are treated at the beginning of the subpass where it is first used.stencilStoreOp
– aVkAttachmentStoreOp
value specifying how the contents of stencil components of the attachment are treated at the end of the last subpass where it is used.initialLayout
– the layout the attachment image subresource will be in when a render pass instance begins.finalLayout
– the layout the attachment image subresource will be transitioned to when a render pass instance ends.
Layout
struct VkAttachmentDescription { VkAttachmentDescriptionFlags flags; VkFormat format; VkSampleCountFlagBits samples; VkAttachmentLoadOp loadOp; VkAttachmentStoreOp storeOp; VkAttachmentLoadOp stencilLoadOp; VkAttachmentStoreOp stencilStoreOp; VkImageLayout initialLayout; VkImageLayout finalLayout; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkAttachmentDescription.Buffer
An array ofVkAttachmentDescription
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
FINALLAYOUT
FLAGS
FORMAT
INITIALLAYOUT
LOADOP
SAMPLESThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
STENCILLOADOP
STENCILSTOREOP
STOREOPThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkAttachmentDescription(java.nio.ByteBuffer container)
Creates aVkAttachmentDescription
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkAttachmentDescription
calloc()
Returns a newVkAttachmentDescription
instance allocated withmemCalloc
.static VkAttachmentDescription.Buffer
calloc(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated withmemCalloc
.static VkAttachmentDescription
callocStack()
Returns a newVkAttachmentDescription
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkAttachmentDescription.Buffer
callocStack(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkAttachmentDescription.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkAttachmentDescription
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkAttachmentDescription
create()
Returns a newVkAttachmentDescription
instance allocated withBufferUtils
.static VkAttachmentDescription.Buffer
create(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated withBufferUtils
.static VkAttachmentDescription
create(long address)
Returns a newVkAttachmentDescription
instance for the specified memory address.static VkAttachmentDescription.Buffer
create(long address, int capacity)
Create aVkAttachmentDescription.Buffer
instance at the specified memory.static VkAttachmentDescription
createSafe(long address)
static VkAttachmentDescription.Buffer
createSafe(long address, int capacity)
int
finalLayout()
Returns the value of thefinalLayout
field.VkAttachmentDescription
finalLayout(int value)
Sets the specified value to thefinalLayout
field.int
flags()
Returns the value of theflags
field.VkAttachmentDescription
flags(int value)
Sets the specified value to theflags
field.int
format()
Returns the value of theformat
field.VkAttachmentDescription
format(int value)
Sets the specified value to theformat
field.int
initialLayout()
Returns the value of theinitialLayout
field.VkAttachmentDescription
initialLayout(int value)
Sets the specified value to theinitialLayout
field.int
loadOp()
Returns the value of theloadOp
field.VkAttachmentDescription
loadOp(int value)
Sets the specified value to theloadOp
field.static VkAttachmentDescription
malloc()
Returns a newVkAttachmentDescription
instance allocated withmemAlloc
.static VkAttachmentDescription.Buffer
malloc(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated withmemAlloc
.static VkAttachmentDescription
mallocStack()
Returns a newVkAttachmentDescription
instance allocated on the thread-localMemoryStack
.static VkAttachmentDescription.Buffer
mallocStack(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the thread-localMemoryStack
.static VkAttachmentDescription.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the specifiedMemoryStack
.static VkAttachmentDescription
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription
instance allocated on the specifiedMemoryStack
.static int
nfinalLayout(long struct)
Unsafe version offinalLayout()
.static void
nfinalLayout(long struct, int value)
Unsafe version offinalLayout
.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static int
nformat(long struct)
Unsafe version offormat()
.static void
nformat(long struct, int value)
Unsafe version offormat
.static int
ninitialLayout(long struct)
Unsafe version ofinitialLayout()
.static void
ninitialLayout(long struct, int value)
Unsafe version ofinitialLayout
.static int
nloadOp(long struct)
Unsafe version ofloadOp()
.static void
nloadOp(long struct, int value)
Unsafe version ofloadOp
.static int
nsamples(long struct)
Unsafe version ofsamples()
.static void
nsamples(long struct, int value)
Unsafe version ofsamples
.static int
nstencilLoadOp(long struct)
Unsafe version ofstencilLoadOp()
.static void
nstencilLoadOp(long struct, int value)
Unsafe version ofstencilLoadOp
.static int
nstencilStoreOp(long struct)
Unsafe version ofstencilStoreOp()
.static void
nstencilStoreOp(long struct, int value)
Unsafe version ofstencilStoreOp
.static int
nstoreOp(long struct)
Unsafe version ofstoreOp()
.static void
nstoreOp(long struct, int value)
Unsafe version ofstoreOp
.int
samples()
Returns the value of thesamples
field.VkAttachmentDescription
samples(int value)
Sets the specified value to thesamples
field.VkAttachmentDescription
set(int flags, int format, int samples, int loadOp, int storeOp, int stencilLoadOp, int stencilStoreOp, int initialLayout, int finalLayout)
Initializes this struct with the specified values.VkAttachmentDescription
set(VkAttachmentDescription src)
Copies the specified struct data to this struct.int
sizeof()
int
stencilLoadOp()
Returns the value of thestencilLoadOp
field.VkAttachmentDescription
stencilLoadOp(int value)
Sets the specified value to thestencilLoadOp
field.int
stencilStoreOp()
Returns the value of thestencilStoreOp
field.VkAttachmentDescription
stencilStoreOp(int value)
Sets the specified value to thestencilStoreOp
field.int
storeOp()
Returns the value of thestoreOp
field.VkAttachmentDescription
storeOp(int value)
Sets the specified value to thestoreOp
field.
-
-
-
Constructor Detail
-
VkAttachmentDescription
public VkAttachmentDescription(java.nio.ByteBuffer container)
Creates aVkAttachmentDescription
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
-
flags
public int flags()
Returns the value of theflags
field.
-
format
public int format()
Returns the value of theformat
field.
-
samples
public int samples()
Returns the value of thesamples
field.
-
loadOp
public int loadOp()
Returns the value of theloadOp
field.
-
storeOp
public int storeOp()
Returns the value of thestoreOp
field.
-
stencilLoadOp
public int stencilLoadOp()
Returns the value of thestencilLoadOp
field.
-
stencilStoreOp
public int stencilStoreOp()
Returns the value of thestencilStoreOp
field.
-
initialLayout
public int initialLayout()
Returns the value of theinitialLayout
field.
-
finalLayout
public int finalLayout()
Returns the value of thefinalLayout
field.
-
flags
public VkAttachmentDescription flags(int value)
Sets the specified value to theflags
field.
-
format
public VkAttachmentDescription format(int value)
Sets the specified value to theformat
field.
-
samples
public VkAttachmentDescription samples(int value)
Sets the specified value to thesamples
field.
-
loadOp
public VkAttachmentDescription loadOp(int value)
Sets the specified value to theloadOp
field.
-
storeOp
public VkAttachmentDescription storeOp(int value)
Sets the specified value to thestoreOp
field.
-
stencilLoadOp
public VkAttachmentDescription stencilLoadOp(int value)
Sets the specified value to thestencilLoadOp
field.
-
stencilStoreOp
public VkAttachmentDescription stencilStoreOp(int value)
Sets the specified value to thestencilStoreOp
field.
-
initialLayout
public VkAttachmentDescription initialLayout(int value)
Sets the specified value to theinitialLayout
field.
-
finalLayout
public VkAttachmentDescription finalLayout(int value)
Sets the specified value to thefinalLayout
field.
-
set
public VkAttachmentDescription set(int flags, int format, int samples, int loadOp, int storeOp, int stencilLoadOp, int stencilStoreOp, int initialLayout, int finalLayout)
Initializes this struct with the specified values.
-
set
public VkAttachmentDescription set(VkAttachmentDescription src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkAttachmentDescription malloc()
Returns a newVkAttachmentDescription
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkAttachmentDescription calloc()
Returns a newVkAttachmentDescription
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkAttachmentDescription create()
Returns a newVkAttachmentDescription
instance allocated withBufferUtils
.
-
create
public static VkAttachmentDescription create(long address)
Returns a newVkAttachmentDescription
instance for the specified memory address.
-
createSafe
@Nullable public static VkAttachmentDescription createSafe(long address)
-
malloc
public static VkAttachmentDescription.Buffer malloc(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkAttachmentDescription.Buffer calloc(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkAttachmentDescription.Buffer create(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkAttachmentDescription.Buffer create(long address, int capacity)
Create aVkAttachmentDescription.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkAttachmentDescription.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkAttachmentDescription mallocStack()
Returns a newVkAttachmentDescription
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkAttachmentDescription callocStack()
Returns a newVkAttachmentDescription
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkAttachmentDescription mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkAttachmentDescription callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkAttachmentDescription.Buffer mallocStack(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkAttachmentDescription.Buffer callocStack(int capacity)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkAttachmentDescription.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkAttachmentDescription.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAttachmentDescription.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nflags
public static int nflags(long struct)
Unsafe version offlags()
.
-
nformat
public static int nformat(long struct)
Unsafe version offormat()
.
-
nsamples
public static int nsamples(long struct)
Unsafe version ofsamples()
.
-
nloadOp
public static int nloadOp(long struct)
Unsafe version ofloadOp()
.
-
nstoreOp
public static int nstoreOp(long struct)
Unsafe version ofstoreOp()
.
-
nstencilLoadOp
public static int nstencilLoadOp(long struct)
Unsafe version ofstencilLoadOp()
.
-
nstencilStoreOp
public static int nstencilStoreOp(long struct)
Unsafe version ofstencilStoreOp()
.
-
ninitialLayout
public static int ninitialLayout(long struct)
Unsafe version ofinitialLayout()
.
-
nfinalLayout
public static int nfinalLayout(long struct)
Unsafe version offinalLayout()
.
-
nflags
public static void nflags(long struct, int value)
Unsafe version offlags
.
-
nformat
public static void nformat(long struct, int value)
Unsafe version offormat
.
-
nsamples
public static void nsamples(long struct, int value)
Unsafe version ofsamples
.
-
nloadOp
public static void nloadOp(long struct, int value)
Unsafe version ofloadOp
.
-
nstoreOp
public static void nstoreOp(long struct, int value)
Unsafe version ofstoreOp
.
-
nstencilLoadOp
public static void nstencilLoadOp(long struct, int value)
Unsafe version ofstencilLoadOp
.
-
nstencilStoreOp
public static void nstencilStoreOp(long struct, int value)
Unsafe version ofstencilStoreOp
.
-
ninitialLayout
public static void ninitialLayout(long struct, int value)
Unsafe version ofinitialLayout
.
-
nfinalLayout
public static void nfinalLayout(long struct, int value)
Unsafe version offinalLayout
.
-
-