Class VkRenderPassMultiviewCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkRenderPassMultiviewCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
- Direct Known Subclasses:
VkRenderPassMultiviewCreateInfoKHR
public class VkRenderPassMultiviewCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure containing multiview info for all subpasses.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 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 viewdstView + 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
orCmdNextSubpass
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 withPositionPerViewNV
andViewportMaskPerViewNV
, respectively. IfVK_NV_viewport_array2
is not supported and enabled,ViewportMaskPerViewNV
must not be used. Values written to elements ofPositionPerViewNV
andViewportMaskPerViewNV
must not depend on theViewIndex
. The shader must also write to an output variable decorated withPosition
, and the value written toPosition
must equal the value written toPositionPerViewNV
[ViewIndex
]. Similarly, ifViewportMaskPerViewNV
is written to then the shader must also write to an output variable decorated withViewportMaskNV
, and the value written toViewportMaskNV
must equal the value written toViewportMaskPerViewNV
[ViewIndex
]. Implementations will either use values taken fromPosition
andViewportMaskNV
and invoke the shader once for each view, or will use values taken fromPositionPerViewNV
andViewportMaskPerViewNV
and invoke the shader fewer times. The values written toPosition
andViewportMaskNV
must not depend on the values written toPositionPerViewNV
andViewportMaskPerViewNV
, or vice versa (to allow compilers to eliminate the unused outputs). All attributes that do not have*PerViewNV
counterparts must not depend onViewIndex
.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
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO
- If
subpassCount
is not 0,pViewMasks
must be a valid pointer to an array ofsubpassCount
uint32_t
values - If
dependencyCount
is not 0,pViewOffsets
must be a valid pointer to an array ofdependencyCount
int32_t
values - If
correlationMaskCount
is not 0,pCorrelationMasks
must be a valid pointer to an array ofcorrelationMaskCount
uint32_t
values
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.subpassCount
– zero or is the number of subpasses in the render pass.pViewMasks
– points to an array ofsubpassCount
number of view masks, where each mask is a bitfield of view indices describing which views rendering is broadcast to in each subpass, when multiview is enabled. IfsubpassCount
is zero, each view mask is treated as zero.dependencyCount
– zero or the number of dependencies in the render pass.pViewOffsets
– points to an array ofdependencyCount
view offsets, one for each dependency. IfdependencyCount
is 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
– zero or a number of correlation masks.pCorrelationMasks
– an array of view masks indicating sets of views that may be more efficient to render concurrently.
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 Classes Modifier and Type Class Description static class
VkRenderPassMultiviewCreateInfo.Buffer
An array ofVkRenderPassMultiviewCreateInfo
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
CORRELATIONMASKCOUNT
DEPENDENCYCOUNT
PCORRELATIONMASKS
PNEXT
PVIEWMASKS
PVIEWOFFSETSThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
STYPE
SUBPASSCOUNTThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkRenderPassMultiviewCreateInfo(java.nio.ByteBuffer container)
Creates aVkRenderPassMultiviewCreateInfo
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 VkRenderPassMultiviewCreateInfo
calloc()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated withmemCalloc
.static VkRenderPassMultiviewCreateInfo.Buffer
calloc(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated withmemCalloc
.static VkRenderPassMultiviewCreateInfo
callocStack()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkRenderPassMultiviewCreateInfo.Buffer
callocStack(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkRenderPassMultiviewCreateInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkRenderPassMultiviewCreateInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.int
correlationMaskCount()
Returns the value of thecorrelationMaskCount
field.static VkRenderPassMultiviewCreateInfo
create()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated withBufferUtils
.static VkRenderPassMultiviewCreateInfo.Buffer
create(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated withBufferUtils
.static VkRenderPassMultiviewCreateInfo
create(long address)
Returns a newVkRenderPassMultiviewCreateInfo
instance for the specified memory address.static VkRenderPassMultiviewCreateInfo.Buffer
create(long address, int capacity)
Create aVkRenderPassMultiviewCreateInfo.Buffer
instance at the specified memory.static VkRenderPassMultiviewCreateInfo
createSafe(long address)
static VkRenderPassMultiviewCreateInfo.Buffer
createSafe(long address, int capacity)
int
dependencyCount()
Returns the value of thedependencyCount
field.static VkRenderPassMultiviewCreateInfo
malloc()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated withmemAlloc
.static VkRenderPassMultiviewCreateInfo.Buffer
malloc(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated withmemAlloc
.static VkRenderPassMultiviewCreateInfo
mallocStack()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the thread-localMemoryStack
.static VkRenderPassMultiviewCreateInfo.Buffer
mallocStack(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkRenderPassMultiviewCreateInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkRenderPassMultiviewCreateInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the specifiedMemoryStack
.static int
ncorrelationMaskCount(long struct)
Unsafe version ofcorrelationMaskCount()
.static void
ncorrelationMaskCount(long struct, int value)
Sets the specified value to thecorrelationMaskCount
field of the specifiedstruct
.static int
ndependencyCount(long struct)
Unsafe version ofdependencyCount()
.static void
ndependencyCount(long struct, int value)
Sets the specified value to thedependencyCount
field of the specifiedstruct
.static java.nio.IntBuffer
npCorrelationMasks(long struct)
Unsafe version ofpCorrelationMasks
.static void
npCorrelationMasks(long struct, java.nio.IntBuffer value)
Unsafe version ofpCorrelationMasks
.static long
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static java.nio.IntBuffer
npViewMasks(long struct)
Unsafe version ofpViewMasks
.static void
npViewMasks(long struct, java.nio.IntBuffer value)
Unsafe version ofpViewMasks
.static java.nio.IntBuffer
npViewOffsets(long struct)
Unsafe version ofpViewOffsets
.static void
npViewOffsets(long struct, java.nio.IntBuffer value)
Unsafe version ofpViewOffsets
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.static int
nsubpassCount(long struct)
Unsafe version ofsubpassCount()
.static void
nsubpassCount(long struct, int value)
Sets the specified value to thesubpassCount
field of the specifiedstruct
.java.nio.IntBuffer
pCorrelationMasks()
Returns aIntBuffer
view of the data pointed to by thepCorrelationMasks
field.VkRenderPassMultiviewCreateInfo
pCorrelationMasks(java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepCorrelationMasks
field.long
pNext()
Returns the value of thepNext
field.VkRenderPassMultiviewCreateInfo
pNext(long value)
Sets the specified value to thepNext
field.java.nio.IntBuffer
pViewMasks()
Returns aIntBuffer
view of the data pointed to by thepViewMasks
field.VkRenderPassMultiviewCreateInfo
pViewMasks(java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepViewMasks
field.java.nio.IntBuffer
pViewOffsets()
Returns aIntBuffer
view of the data pointed to by thepViewOffsets
field.VkRenderPassMultiviewCreateInfo
pViewOffsets(java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepViewOffsets
field.VkRenderPassMultiviewCreateInfo
set(int sType, long pNext, java.nio.IntBuffer pViewMasks, java.nio.IntBuffer pViewOffsets, java.nio.IntBuffer pCorrelationMasks)
Initializes this struct with the specified values.VkRenderPassMultiviewCreateInfo
set(VkRenderPassMultiviewCreateInfo src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkRenderPassMultiviewCreateInfo
sType(int value)
Sets the specified value to thesType
field.int
subpassCount()
Returns the value of thesubpassCount
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
VkRenderPassMultiviewCreateInfo
public VkRenderPassMultiviewCreateInfo(java.nio.ByteBuffer container)
Creates aVkRenderPassMultiviewCreateInfo
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
-
sType
public int sType()
Returns the value of thesType
field.
-
pNext
public long pNext()
Returns the value of thepNext
field.
-
subpassCount
public int subpassCount()
Returns the value of thesubpassCount
field.
-
pViewMasks
@Nullable public java.nio.IntBuffer pViewMasks()
Returns aIntBuffer
view of the data pointed to by thepViewMasks
field.
-
dependencyCount
public int dependencyCount()
Returns the value of thedependencyCount
field.
-
pViewOffsets
@Nullable public java.nio.IntBuffer pViewOffsets()
Returns aIntBuffer
view of the data pointed to by thepViewOffsets
field.
-
correlationMaskCount
public int correlationMaskCount()
Returns the value of thecorrelationMaskCount
field.
-
pCorrelationMasks
@Nullable public java.nio.IntBuffer pCorrelationMasks()
Returns aIntBuffer
view of the data pointed to by thepCorrelationMasks
field.
-
sType
public VkRenderPassMultiviewCreateInfo sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkRenderPassMultiviewCreateInfo pNext(long value)
Sets the specified value to thepNext
field.
-
pViewMasks
public VkRenderPassMultiviewCreateInfo pViewMasks(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepViewMasks
field.
-
pViewOffsets
public VkRenderPassMultiviewCreateInfo pViewOffsets(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepViewOffsets
field.
-
pCorrelationMasks
public VkRenderPassMultiviewCreateInfo pCorrelationMasks(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepCorrelationMasks
field.
-
set
public VkRenderPassMultiviewCreateInfo set(int sType, long pNext, @Nullable java.nio.IntBuffer pViewMasks, @Nullable java.nio.IntBuffer pViewOffsets, @Nullable java.nio.IntBuffer pCorrelationMasks)
Initializes this struct with the specified values.
-
set
public VkRenderPassMultiviewCreateInfo set(VkRenderPassMultiviewCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkRenderPassMultiviewCreateInfo malloc()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkRenderPassMultiviewCreateInfo calloc()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkRenderPassMultiviewCreateInfo create()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated withBufferUtils
.
-
create
public static VkRenderPassMultiviewCreateInfo create(long address)
Returns a newVkRenderPassMultiviewCreateInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VkRenderPassMultiviewCreateInfo createSafe(long address)
-
malloc
public static VkRenderPassMultiviewCreateInfo.Buffer malloc(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkRenderPassMultiviewCreateInfo.Buffer calloc(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkRenderPassMultiviewCreateInfo.Buffer create(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkRenderPassMultiviewCreateInfo.Buffer create(long address, int capacity)
Create aVkRenderPassMultiviewCreateInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkRenderPassMultiviewCreateInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkRenderPassMultiviewCreateInfo mallocStack()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkRenderPassMultiviewCreateInfo callocStack()
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkRenderPassMultiviewCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkRenderPassMultiviewCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkRenderPassMultiviewCreateInfo.Buffer mallocStack(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkRenderPassMultiviewCreateInfo.Buffer callocStack(int capacity)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkRenderPassMultiviewCreateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkRenderPassMultiviewCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkRenderPassMultiviewCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
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
@Nullable public static java.nio.IntBuffer npViewMasks(long struct)
Unsafe version ofpViewMasks
.
-
ndependencyCount
public static int ndependencyCount(long struct)
Unsafe version ofdependencyCount()
.
-
npViewOffsets
@Nullable public static java.nio.IntBuffer npViewOffsets(long struct)
Unsafe version ofpViewOffsets
.
-
ncorrelationMaskCount
public static int ncorrelationMaskCount(long struct)
Unsafe version ofcorrelationMaskCount()
.
-
npCorrelationMasks
@Nullable public static java.nio.IntBuffer npCorrelationMasks(long struct)
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 thesubpassCount
field of the specifiedstruct
.
-
npViewMasks
public static void npViewMasks(long struct, @Nullable java.nio.IntBuffer value)
Unsafe version ofpViewMasks
.
-
ndependencyCount
public static void ndependencyCount(long struct, int value)
Sets the specified value to thedependencyCount
field of the specifiedstruct
.
-
npViewOffsets
public static void npViewOffsets(long struct, @Nullable java.nio.IntBuffer value)
Unsafe version ofpViewOffsets
.
-
ncorrelationMaskCount
public static void ncorrelationMaskCount(long struct, int value)
Sets the specified value to thecorrelationMaskCount
field of the specifiedstruct
.
-
npCorrelationMasks
public static void npCorrelationMasks(long struct, @Nullable java.nio.IntBuffer value)
Unsafe version ofpCorrelationMasks
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-