Class VkRenderPassMultiviewCreateInfo
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
- Direct Known Subclasses:
VkRenderPassMultiviewCreateInfoKHR
Description
When a subpass uses a non-zero view mask, multiview functionality is considered to be enabled. Multiview is all-or-nothing for a render pass - that is, either all subpasses must have a non-zero view mask (though some subpasses may have only one view) or all must be zero. Multiview causes all drawing and clear commands in the subpass to behave as if they were broadcast to each view, where a view is represented by one layer of the framebuffer attachments. All draws and clears are broadcast to each view index whose bit is set in the view mask. The view index is provided in the ViewIndex shader input variable, and color, depth/stencil, and input attachments all read/write the layer of the framebuffer corresponding to the view index.
If the view mask is zero for all subpasses, multiview is considered to be disabled and all drawing commands execute normally, without this additional broadcasting.
Some implementations may not support multiview in conjunction with mesh shaders, geometry shaders or tessellation shaders.
When multiview is enabled, the DEPENDENCY_VIEW_LOCAL_BIT bit in a dependency can be used to express a view-local dependency, meaning that each view in the destination subpass depends on a single view in the source subpass. Unlike pipeline barriers, a subpass dependency can potentially have a different view mask in the source subpass and the destination subpass. If the dependency is view-local, then each view (dstView) in the destination subpass depends on the view dstView + pViewOffsets[dependency] in the source subpass. If there is not such a view in the source subpass, then this dependency does not affect that view in the destination subpass. If the dependency is not view-local, then all views in the destination subpass depend on all views in the source subpass, and the view offset is ignored. A non-zero view offset is not allowed in a self-dependency.
The elements of pCorrelationMasks are a set of masks of views indicating that views in the same mask may exhibit spatial coherency between the views, making it more efficient to render them concurrently. Correlation masks must not have a functional effect on the results of the multiview rendering.
When multiview is enabled, at the beginning of each subpass all non-render pass state is undefined. In particular, each time CmdBeginRenderPass or CmdNextSubpass is called the graphics pipeline must be bound, any relevant descriptor sets or vertex/index buffers must be bound, and any relevant dynamic state or push constants must be set before they are used.
A multiview subpass can declare that its shaders will write per-view attributes for all views in a single invocation, by setting the SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX bit in the subpass description. The only supported per-view attributes are position and viewport mask, and per-view position and viewport masks are written to output array variables decorated with PositionPerViewNV and ViewportMaskPerViewNV, respectively. If the VK_NV_viewport_array2 extension is not supported and enabled, ViewportMaskPerViewNV must not be used. Values written to elements of PositionPerViewNV and ViewportMaskPerViewNV must not depend on the ViewIndex. The shader must also write to an output variable decorated with Position, and the value written to Position must equal the value written to PositionPerViewNV[ViewIndex]. Similarly, if ViewportMaskPerViewNV is written to then the shader must also write to an output variable decorated with ViewportMaskNV, and the value written to ViewportMaskNV must equal the value written to ViewportMaskPerViewNV[ViewIndex]. Implementations will either use values taken from Position and ViewportMaskNV and invoke the shader once for each view, or will use values taken from PositionPerViewNV and ViewportMaskPerViewNV and invoke the shader fewer times. The values written to Position and ViewportMaskNV must not depend on the values written to PositionPerViewNV and ViewportMaskPerViewNV, or vice versa (to allow compilers to eliminate the unused outputs). All attributes that do not have *PerViewNV counterparts must not depend on ViewIndex.
Per-view attributes are all-or-nothing for a subpass. That is, all pipelines compiled against a subpass that includes the SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX bit must write per-view attributes to the *PerViewNV[] shader outputs, in addition to the non-per-view (e.g. Position) outputs. Pipelines compiled against a subpass that does not include this bit must not include the *PerViewNV[] outputs in their interfaces.
Valid Usage
- Each view index must not be set in more than one element of
pCorrelationMasks - If the
multiviewfeature is not enabled, each element ofpViewMasksmust be 0 - The index of the most significant bit in each element of
pViewMasksmust be less thanmaxMultiviewViewCount
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO- If
subpassCountis not 0,pViewMasksmust be a valid pointer to an array ofsubpassCountuint32_tvalues - If
dependencyCountis not 0,pViewOffsetsmust be a valid pointer to an array ofdependencyCountint32_tvalues - If
correlationMaskCountis not 0,pCorrelationMasksmust be a valid pointer to an array ofcorrelationMaskCountuint32_tvalues
Layout
struct VkRenderPassMultiviewCreateInfo {
VkStructureType sType();
void const * pNext();
uint32_t subpassCount();
uint32_t const * pViewMasks();
uint32_t dependencyCount();
int32_t const * pViewOffsets();
uint32_t correlationMaskCount();
uint32_t const * pCorrelationMasks();
}-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn array ofVkRenderPassMultiviewCreateInfostructs.Nested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVkRenderPassMultiviewCreateInfo(ByteBuffer container) Creates aVkRenderPassMultiviewCreateInfoinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptioncalloc()Returns a newVkRenderPassMultiviewCreateInfoinstance allocated withmemCalloc.calloc(int capacity) Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.calloc(org.lwjgl.system.MemoryStack stack) Returns a newVkRenderPassMultiviewCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.Deprecated.callocStack(int capacity) Deprecated.callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.callocStack(org.lwjgl.system.MemoryStack stack) Deprecated.intzero or the number of correlation masks.create()Returns a newVkRenderPassMultiviewCreateInfoinstance allocated withBufferUtils.create(int capacity) Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated withBufferUtils.create(long address) Returns a newVkRenderPassMultiviewCreateInfoinstance for the specified memory address.create(long address, int capacity) Create aVkRenderPassMultiviewCreateInfo.Bufferinstance at the specified memory.static @Nullable VkRenderPassMultiviewCreateInfocreateSafe(long address) static @Nullable VkRenderPassMultiviewCreateInfo.BuffercreateSafe(long address, int capacity) intzero or the number of dependencies in the render pass.malloc()Returns a newVkRenderPassMultiviewCreateInfoinstance allocated withmemAlloc.malloc(int capacity) Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.malloc(org.lwjgl.system.MemoryStack stack) Returns a newVkRenderPassMultiviewCreateInfoinstance allocated on the specifiedMemoryStack.Deprecated.mallocStack(int capacity) Deprecated.mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.mallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static intncorrelationMaskCount(long struct) Unsafe version ofcorrelationMaskCount().static voidncorrelationMaskCount(long struct, int value) Sets the specified value to thecorrelationMaskCountfield of the specifiedstruct.static intndependencyCount(long struct) Unsafe version ofdependencyCount().static voidndependencyCount(long struct, int value) Sets the specified value to thedependencyCountfield of the specifiedstruct.static @Nullable IntBuffernpCorrelationMasks(long struct) Unsafe version ofpCorrelationMasks.static voidnpCorrelationMasks(long struct, @Nullable IntBuffer value) Unsafe version ofpCorrelationMasks.static longnpNext(long struct) Unsafe version ofpNext().static voidnpNext(long struct, long value) Unsafe version ofpNext.static @Nullable IntBuffernpViewMasks(long struct) Unsafe version ofpViewMasks.static voidnpViewMasks(long struct, @Nullable IntBuffer value) Unsafe version ofpViewMasks.static @Nullable IntBuffernpViewOffsets(long struct) Unsafe version ofpViewOffsets.static voidnpViewOffsets(long struct, @Nullable IntBuffer value) Unsafe version ofpViewOffsets.static intnsType(long struct) Unsafe version ofsType().static voidnsType(long struct, int value) Unsafe version ofsType.static intnsubpassCount(long struct) Unsafe version ofsubpassCount().static voidnsubpassCount(long struct, int value) Sets the specified value to thesubpassCountfield of the specifiedstruct.@Nullable IntBuffera pointer to an array ofcorrelationMaskCountview masks indicating sets of views that may be more efficient to render concurrently.pCorrelationMasks(@Nullable IntBuffer value) Sets the address of the specifiedIntBufferto thepCorrelationMasks()field.longpNext()NULLor a pointer to a structure extending this structure.pNext(long value) Sets the specified value to thepNext()field.@Nullable IntBuffera pointer to an array ofsubpassCountview masks, where each mask is a bitfield of view indices describing which views rendering is broadcast to in each subpass, when multiview is enabled.pViewMasks(@Nullable IntBuffer value) Sets the address of the specifiedIntBufferto thepViewMasks()field.@Nullable IntBuffera pointer to an array ofdependencyCountview offsets, one for each dependency.pViewOffsets(@Nullable IntBuffer value) Sets the address of the specifiedIntBufferto thepViewOffsets()field.set(int sType, long pNext, @Nullable IntBuffer pViewMasks, @Nullable IntBuffer pViewOffsets, @Nullable IntBuffer pCorrelationMasks) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()intsType()aVkStructureTypevalue identifying this structure.sType(int value) Sets the specified value to thesType()field.Sets theSTRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFOvalue to thesType()field.intzero or the number of subpasses in the render pass.static voidvalidate(long struct) Validates pointer members that should not beNULL.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
STYPE
public static final int STYPEThe struct member offsets. -
PNEXT
public static final int PNEXTThe struct member offsets. -
SUBPASSCOUNT
public static final int SUBPASSCOUNTThe struct member offsets. -
PVIEWMASKS
public static final int PVIEWMASKSThe struct member offsets. -
DEPENDENCYCOUNT
public static final int DEPENDENCYCOUNTThe struct member offsets. -
PVIEWOFFSETS
public static final int PVIEWOFFSETSThe struct member offsets. -
CORRELATIONMASKCOUNT
public static final int CORRELATIONMASKCOUNTThe struct member offsets. -
PCORRELATIONMASKS
public static final int PCORRELATIONMASKSThe struct member offsets.
-
-
Constructor Details
-
VkRenderPassMultiviewCreateInfo
Creates aVkRenderPassMultiviewCreateInfoinstance at the current position of the specifiedByteBuffercontainer. 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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VkRenderPassMultiviewCreateInfo>
-
sType
public int sType()aVkStructureTypevalue identifying this structure. -
pNext
public long pNext()NULLor a pointer to a structure extending this structure. -
subpassCount
public int subpassCount()zero or the number of subpasses in the render pass. -
pViewMasks
a pointer to an array ofsubpassCountview masks, where each mask is a bitfield of view indices describing which views rendering is broadcast to in each subpass, when multiview is enabled. IfsubpassCountis zero, each view mask is treated as zero. -
dependencyCount
public int dependencyCount()zero or the number of dependencies in the render pass. -
pViewOffsets
a pointer to an array ofdependencyCountview offsets, one for each dependency. IfdependencyCountis zero, each dependency’s view offset is treated as zero. Each view offset controls which views in the source subpass the views in the destination subpass depend on. -
correlationMaskCount
public int correlationMaskCount()zero or the number of correlation masks. -
pCorrelationMasks
a pointer to an array ofcorrelationMaskCountview masks indicating sets of views that may be more efficient to render concurrently. -
sType
Sets the specified value to thesType()field. -
sType$Default
Sets theSTRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFOvalue to thesType()field. -
pNext
Sets the specified value to thepNext()field. -
pViewMasks
Sets the address of the specifiedIntBufferto thepViewMasks()field. -
pViewOffsets
Sets the address of the specifiedIntBufferto thepViewOffsets()field. -
pCorrelationMasks
Sets the address of the specifiedIntBufferto thepCorrelationMasks()field. -
set
public VkRenderPassMultiviewCreateInfo set(int sType, long pNext, @Nullable IntBuffer pViewMasks, @Nullable IntBuffer pViewOffsets, @Nullable IntBuffer pCorrelationMasks) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVkRenderPassMultiviewCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkRenderPassMultiviewCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkRenderPassMultiviewCreateInfoinstance allocated withBufferUtils. -
create
Returns a newVkRenderPassMultiviewCreateInfoinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkRenderPassMultiviewCreateInfo.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
public static @Nullable VkRenderPassMultiviewCreateInfo.Buffer createSafe(long address, int capacity) -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
@Deprecated public static VkRenderPassMultiviewCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
@Deprecated public static VkRenderPassMultiviewCreateInfo callocStack(org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
mallocStack
@Deprecated public static VkRenderPassMultiviewCreateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
@Deprecated public static VkRenderPassMultiviewCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newVkRenderPassMultiviewCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkRenderPassMultiviewCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkRenderPassMultiviewCreateInfo.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkRenderPassMultiviewCreateInfo.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkRenderPassMultiviewCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nsType
public static int nsType(long struct) Unsafe version ofsType(). -
npNext
public static long npNext(long struct) Unsafe version ofpNext(). -
nsubpassCount
public static int nsubpassCount(long struct) Unsafe version ofsubpassCount(). -
npViewMasks
Unsafe version ofpViewMasks. -
ndependencyCount
public static int ndependencyCount(long struct) Unsafe version ofdependencyCount(). -
npViewOffsets
Unsafe version ofpViewOffsets. -
ncorrelationMaskCount
public static int ncorrelationMaskCount(long struct) Unsafe version ofcorrelationMaskCount(). -
npCorrelationMasks
Unsafe version ofpCorrelationMasks. -
nsType
public static void nsType(long struct, int value) Unsafe version ofsType. -
npNext
public static void npNext(long struct, long value) Unsafe version ofpNext. -
nsubpassCount
public static void nsubpassCount(long struct, int value) Sets the specified value to thesubpassCountfield of the specifiedstruct. -
npViewMasks
Unsafe version ofpViewMasks. -
ndependencyCount
public static void ndependencyCount(long struct, int value) Sets the specified value to thedependencyCountfield of the specifiedstruct. -
npViewOffsets
Unsafe version ofpViewOffsets. -
ncorrelationMaskCount
public static void ncorrelationMaskCount(long struct, int value) Sets the specified value to thecorrelationMaskCountfield of the specifiedstruct. -
npCorrelationMasks
Unsafe version ofpCorrelationMasks. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-