Top Description Inners Fields Constructors Methods
org.lwjgl.vulkan

public Class VkSubpassDescription

extends Struct<VkSubpassDescription>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Structure specifying a subpass description.
Description

Each element of the pInputAttachments array corresponds to an input attachment index in a fragment shader, i.e. if a shader declares an image variable decorated with a InputAttachmentIndex value of X, then it uses the attachment provided in pInputAttachments[X]. Input attachments must also be bound to the pipeline in a descriptor set. If the attachment member of any element of pInputAttachments is ATTACHMENT_UNUSED, the application must not read from the corresponding input attachment index. Fragment shaders can use subpass input variables to access the contents of an input attachment at the fragment’s (x, y, layer) framebuffer coordinates. Input attachments must not be used by any subpasses within a render pass that enables render pass transform.

Each element of the pColorAttachments array corresponds to an output location in the shader, i.e. if the shader declares an output variable decorated with a Location value of X, then it uses the attachment provided in pColorAttachments[X]. If the attachment member of any element of pColorAttachments is ATTACHMENT_UNUSED, or if Color Write Enable has been disabled for the corresponding attachment index, then writes to the corresponding location by a fragment shader are discarded.

If flags does not include SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if pResolveAttachments is not NULL, each of its elements corresponds to a color attachment (the element in pColorAttachments at the same index), and a multisample resolve operation is defined for each attachment unless the resolve attachment index is ATTACHMENT_UNUSED.

Similarly, if flags does not include SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and VkSubpassDescriptionDepthStencilResolve::pDepthStencilResolveAttachment is not NULL and does not have the value ATTACHMENT_UNUSED, it corresponds to the depth/stencil attachment in pDepthStencilAttachment, and multisample resolve operation for depth and stencil are defined by VkSubpassDescriptionDepthStencilResolve::depthResolveMode and VkSubpassDescriptionDepthStencilResolve::stencilResolveMode, respectively. If VkSubpassDescriptionDepthStencilResolve::depthResolveMode is RESOLVE_MODE_NONE or the pDepthStencilResolveAttachment does not have a depth aspect, no resolve operation is performed for the depth attachment. If VkSubpassDescriptionDepthStencilResolve::stencilResolveMode is RESOLVE_MODE_NONE or the pDepthStencilResolveAttachment does not have a stencil aspect, no resolve operation is performed for the stencil attachment.

If the image subresource range referenced by the depth/stencil attachment is created with IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, then the multisample resolve operation uses the sample locations state specified in the sampleLocationsInfo member of the element of the VkRenderPassSampleLocationsBeginInfoEXT::pPostSubpassSampleLocations for the subpass.

If pDepthStencilAttachment is NULL, or if its attachment index is ATTACHMENT_UNUSED, it indicates that no depth/stencil attachment will be used in the subpass.

The contents of an attachment within the render area become undefined at the start of a subpass S if all of the following conditions are true:

In addition, the contents of an attachment within the render area become undefined at the start of a subpass S if all of the following conditions are true:

Once the contents of an attachment become undefined in subpass S, they remain undefined for subpasses in subpass dependency chains starting with subpass S until they are written again. However, they remain valid for subpasses in other subpass dependency chains starting with subpass S1 if those subpasses use or preserve the attachment.

Valid Usage
Valid Usage (Implicit)
See Also

VkAttachmentReference, VkRenderPassCreateInfo

Layout


struct VkSubpassDescription {
    VkSubpassDescriptionFlags flags;
    VkPipelineBindPoint pipelineBindPoint;
    uint32_t inputAttachmentCount;
    VkAttachmentReference const * pInputAttachments;
    uint32_t colorAttachmentCount;
    VkAttachmentReference const * pColorAttachments;
    VkAttachmentReference const * pResolveAttachments;
    VkAttachmentReference const * pDepthStencilAttachment;
    uint32_t preserveAttachmentCount;
    uint32_t const * pPreserveAttachments;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
COLORATTACHMENTCOUNT

The struct member offsets.

public static final int
FLAGS

The struct member offsets.

public static final int
INPUTATTACHMENTCOUNT

The struct member offsets.

public static final int
PCOLORATTACHMENTS

The struct member offsets.

public static final int
PDEPTHSTENCILATTACHMENT

The struct member offsets.

public static final int
PINPUTATTACHMENTS

The struct member offsets.

public static final int
PIPELINEBINDPOINT

The struct member offsets.

public static final int
PPRESERVEATTACHMENTS

The struct member offsets.

public static final int
PRESERVEATTACHMENTCOUNT

The struct member offsets.

public static final int
PRESOLVEATTACHMENTS

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
VkSubpassDescription(long address, ByteBuffer container)

public
VkSubpassDescription(ByteBuffer container)

Creates a VkSubpassDescription instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static VkSubpassDescription
calloc()

Returns a new VkSubpassDescription instance allocated with memCalloc.

public static VkSubpassDescription.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new VkSubpassDescription.Buffer instance allocated with memCalloc.

public static VkSubpassDescription
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSubpassDescription instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VkSubpassDescription.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSubpassDescription.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VkSubpassDescription
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VkSubpassDescription
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSubpassDescription.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSubpassDescription.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public int
colorAttachmentCount()

the number of color attachments.

public VkSubpassDescription
colorAttachmentCount(int value)

Sets the specified value to the colorAttachmentCount field.

protected VkSubpassDescription
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static VkSubpassDescription
create()

Returns a new VkSubpassDescription instance allocated with BufferUtils.

public static VkSubpassDescription
create(long address)

Returns a new VkSubpassDescription instance for the specified memory address.

public static VkSubpassDescription.Buffer
create(int
the buffer capacity
capacity
)

Returns a new VkSubpassDescription.Buffer instance allocated with BufferUtils.

public static VkSubpassDescription.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a VkSubpassDescription.Buffer instance at the specified memory.

public static VkSubpassDescription
createSafe(long address)

Like create, but returns null if address is NULL.

public static VkSubpassDescription.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public int
flags()

a bitmask of VkSubpassDescriptionFlagBits specifying usage of the subpass.

public VkSubpassDescription
flags(int value)

Sets the specified value to the flags field.

public int
inputAttachmentCount()

the number of input attachments.

public static VkSubpassDescription
malloc()

Returns a new VkSubpassDescription instance allocated with memAlloc.

public static VkSubpassDescription.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new VkSubpassDescription.Buffer instance allocated with memAlloc.

public static VkSubpassDescription
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSubpassDescription instance allocated on the specified MemoryStack.

public static VkSubpassDescription.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSubpassDescription.Buffer instance allocated on the specified MemoryStack.

public static VkSubpassDescription
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VkSubpassDescription
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSubpassDescription.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSubpassDescription.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static int
ncolorAttachmentCount(long struct)

Unsafe version of colorAttachmentCount.

public static void
ncolorAttachmentCount(long struct, int value)

Sets the specified value to the colorAttachmentCount field of the specified struct.

public static int
nflags(long struct)

Unsafe version of flags.

public static void
nflags(long struct, int value)

Unsafe version of flags.

public static int
ninputAttachmentCount(long struct)

Unsafe version of inputAttachmentCount.

public static void
ninputAttachmentCount(long struct, int value)

Sets the specified value to the inputAttachmentCount field of the specified struct.

public static VkAttachmentReference.Buffer
npColorAttachments(long struct)

Unsafe version of pColorAttachments.

public static void
npColorAttachments(long struct, VkAttachmentReference.Buffer value)

Unsafe version of pColorAttachments.

public static VkAttachmentReference
npDepthStencilAttachment(long struct)

Unsafe version of pDepthStencilAttachment.

public static void
public static VkAttachmentReference.Buffer
npInputAttachments(long struct)

Unsafe version of pInputAttachments.

public static void
npInputAttachments(long struct, VkAttachmentReference.Buffer value)

Unsafe version of pInputAttachments.

public static int
npipelineBindPoint(long struct)

Unsafe version of pipelineBindPoint.

public static void
npipelineBindPoint(long struct, int value)

Unsafe version of pipelineBindPoint.

public static IntBuffer
npPreserveAttachments(long struct)

Unsafe version of pPreserveAttachments.

public static void
npPreserveAttachments(long struct, IntBuffer value)

Unsafe version of pPreserveAttachments.

public static int
npreserveAttachmentCount(long struct)

Unsafe version of preserveAttachmentCount.

public static void
npreserveAttachmentCount(long struct, int value)

Sets the specified value to the preserveAttachmentCount field of the specified struct.

public static VkAttachmentReference.Buffer
npResolveAttachments(long struct)

Unsafe version of pResolveAttachments.

public static void
public VkAttachmentReference.Buffer
pColorAttachments()

a pointer to an array of colorAttachmentCount VkAttachmentReference structures defining the color attachments for this subpass and their layouts.

public VkSubpassDescription
public VkAttachmentReference
pDepthStencilAttachment()

a pointer to a VkAttachmentReference structure specifying the depth/stencil attachment for this subpass and its layout.

public VkSubpassDescription
public VkAttachmentReference.Buffer
pInputAttachments()

a pointer to an array of VkAttachmentReference structures defining the input attachments for this subpass and their layouts.

public VkSubpassDescription
public int
pipelineBindPoint()

a VkPipelineBindPoint value specifying the pipeline type supported for this subpass.

public VkSubpassDescription
pipelineBindPoint(int value)

Sets the specified value to the pipelineBindPoint field.

public IntBuffer
pPreserveAttachments()

a pointer to an array of preserveAttachmentCount render pass attachment indices identifying attachments that are not used by this subpass, but whose contents must be preserved throughout the subpass.

public VkSubpassDescription
pPreserveAttachments(IntBuffer value)

Sets the address of the specified IntBuffer to the pPreserveAttachments field.

public int
preserveAttachmentCount()

the number of preserved attachments.

public VkAttachmentReference.Buffer
pResolveAttachments()

NULL or a pointer to an array of colorAttachmentCount VkAttachmentReference structures defining the resolve attachments for this subpass and their layouts.

public VkSubpassDescription
public VkSubpassDescription
set(int flags, int pipelineBindPoint, VkAttachmentReference.Buffer pInputAttachments, int colorAttachmentCount, VkAttachmentReference.Buffer pColorAttachments, VkAttachmentReference.Buffer pResolveAttachments, VkAttachmentReference pDepthStencilAttachment, IntBuffer pPreserveAttachments)

Initializes this struct with the specified values.

public VkSubpassDescription

Returns:

this struct
set
(VkSubpassDescription
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public static void
validate(long
the struct to validate
struct
)

Validates pointer members that should not be NULL.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate