Despite their names, minDepth can be less than, equal to, or greater than maxDepth.
The framebuffer depth coordinate zf may be represented using either a fixed-point or floating-point representation. However, a floating-point representation must be used if the depth/stencil attachment has a floating-point depth component. If an m-bit fixed-point representation is used, we assume that it represents each value k / (2m - 1), where k ∈ { 0, 1, …, 2m-1 }, as k (e.g. 1.0 is represented in binary as a string of all ones).
The viewport parameters shown in the above equations are found from these values as
ox = x + width / 2oy = y + height / 2oz = minDepth (or (maxDepth + minDepth) / 2 if VkPipelineViewportDepthClipControlCreateInfoEXT::negativeOneToOne is TRUE)px = widthpy = heightpz = maxDepth - minDepth (or (maxDepth - minDepth) / 2 if VkPipelineViewportDepthClipControlCreateInfoEXT::negativeOneToOne is TRUE)If a render pass transform is enabled, the values (px,py) and (ox, oy) defining the viewport are transformed as described in render pass transform before participating in the viewport transform.
The application can specify a negative term for height, which has the effect of negating the y coordinate in clip space before performing the transform. When using a negative height, the application should also adjust the y value to point to the lower left corner of the viewport instead of the upper left corner. Using the negative height allows the application to avoid having to negate the y component of the Position output from the last pre-rasterization shader stage.
The width and height of the implementation-dependent maximum viewport dimensions must be greater than or equal to the width and height of the largest image which can be created and attached to a framebuffer.
The floating-point viewport bounds are represented with an implementation-dependent precision.
width must be greater than 0.0width must be less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[0]VK_KHR_maintenance1 extension is not enabled, the VK_AMD_negative_viewport_height extension is not enabled, and VkPhysicalDeviceProperties::apiVersion is less than Vulkan 1.1, height must be greater than 0.0height must be less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[1]x must be greater than or equal to viewportBoundsRange[0](x + width) must be less than or equal to viewportBoundsRange[1]y must be greater than or equal to viewportBoundsRange[0]y must be less than or equal to viewportBoundsRange[1](y + height) must be greater than or equal to viewportBoundsRange[0](y + height) must be less than or equal to viewportBoundsRange[1]VK_EXT_depth_range_unrestricted extension is not enabled, minDepth must be between 0.0 and 1.0, inclusiveVK_EXT_depth_range_unrestricted extension is not enabled, maxDepth must be between 0.0 and 1.0, inclusiveVkCommandBufferInheritanceViewportScissorInfoNV, VkPipelineViewportStateCreateInfo, CmdSetViewport, CmdSetViewportWithCount, CmdSetViewportWithCountEXT
struct VkViewport {
float x;
float y;
float width;
float height;
float minDepth;
float maxDepth;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | VkViewport.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | HEIGHT
The struct member offsets. |
| public static final int | MAXDEPTH
The struct member offsets. |
| public static final int | MINDEPTH
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | WIDTH
The struct member offsets. |
| public static final int | X
The struct member offsets. |
| public static final int | Y
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkViewport(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static VkViewport | |
| public static VkViewport. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkViewport | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkViewport. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkViewport | |
| public static VkViewport | |
| public static VkViewport. | |
| public static VkViewport. | |
| protected VkViewport | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkViewport | |
| public static VkViewport | |
| public static VkViewport. | create(int
the buffer capacity capacity)Returns a new |
| public static VkViewport. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkViewport | |
| public static VkViewport. | |
| public float | |
| public VkViewport | |
| public static VkViewport | |
| public static VkViewport. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkViewport | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkViewport. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkViewport | |
| public static VkViewport | |
| public static VkViewport. | |
| public static VkViewport. | |
| public float | |
| public VkViewport | |
| public float | |
| public VkViewport | |
| public static float | |
| public static void | |
| public static float | |
| public static void | |
| public static float | |
| public static void | |
| public static float | |
| public static void | |
| public static float | |
| public static void | |
| public static float | |
| public static void | |
| public VkViewport | set(float x, float y, float width, float height, float minDepth, float maxDepth)
Initializes this struct with the specified values. |
| public VkViewport | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public float | |
| public VkViewport | |
| public float | |
| public VkViewport | |
| public float | |
| public VkViewport |
| ALIGNOF | back to summary |
|---|---|
| public static final int ALIGNOF The struct alignment in bytes. | |
| HEIGHT | back to summary |
|---|---|
| public static final int HEIGHT The struct member offsets. | |
| MAXDEPTH | back to summary |
|---|---|
| public static final int MAXDEPTH The struct member offsets. | |
| MINDEPTH | back to summary |
|---|---|
| public static final int MINDEPTH The struct member offsets. | |
| SIZEOF | back to summary |
|---|---|
| public static final int SIZEOF The struct size in bytes. | |
| WIDTH | back to summary |
|---|---|
| public static final int WIDTH The struct member offsets. | |
| X | back to summary |
|---|---|
| public static final int X The struct member offsets. | |
| Y | back to summary |
|---|---|
| public static final int Y The struct member offsets. | |
| VkViewport | back to summary |
|---|---|
| protected VkViewport(long address, ByteBuffer container) | |
| VkViewport | back to summary |
|---|---|
| public VkViewport(ByteBuffer container) Creates a The created instance holds a strong reference to the container object. | |
| calloc | back to summary |
|---|---|
| public static VkViewport calloc() Returns a new | |
| calloc | back to summary |
|---|---|
| public static VkViewport. Returns a new
| |
| calloc | back to summary |
|---|---|
| public static VkViewport calloc(MemoryStack stack) Returns a new
| |
| calloc | back to summary |
|---|---|
| public static VkViewport. Returns a new
| |
| callocStack | back to summary |
|---|---|
| public static VkViewport callocStack()
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static VkViewport callocStack(MemoryStack stack)
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static VkViewport. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static VkViewport. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| create | back to summary |
|---|---|
| protected VkViewport create(long address, ByteBuffer container) Implements abstract org. Doc from org. Similar to Effectively, every
| |
| create | back to summary |
|---|---|
| public static VkViewport create() Returns a new | |
| create | back to summary |
|---|---|
| public static VkViewport create(long address) Returns a new | |
| create | back to summary |
|---|---|
| public static VkViewport. Returns a new
| |
| create | back to summary |
|---|---|
| public static VkViewport. Create a
| |
| createSafe | back to summary |
|---|---|
| public static VkViewport createSafe(long address) Like
| |
| createSafe | back to summary |
|---|---|
| public static VkViewport. Like
| |
| height | back to summary |
|---|---|
| public float height() see | |
| height | back to summary |
|---|---|
| public VkViewport height(float value) Sets the specified value to the | |
| malloc | back to summary |
|---|---|
| public static VkViewport malloc() Returns a new | |
| malloc | back to summary |
|---|---|
| public static VkViewport. Returns a new
| |
| malloc | back to summary |
|---|---|
| public static VkViewport malloc(MemoryStack stack) Returns a new
| |
| malloc | back to summary |
|---|---|
| public static VkViewport. Returns a new
| |
| mallocStack | back to summary |
|---|---|
| public static VkViewport mallocStack()
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static VkViewport mallocStack(MemoryStack stack)
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static VkViewport. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static VkViewport. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| maxDepth | back to summary |
|---|---|
| public float maxDepth() see | |
| maxDepth | back to summary |
|---|---|
| public VkViewport maxDepth(float value) Sets the specified value to the | |
| minDepth | back to summary |
|---|---|
| public float minDepth()
| |
| minDepth | back to summary |
|---|---|
| public VkViewport minDepth(float value) Sets the specified value to the | |
| nheight | back to summary |
|---|---|
| public static float nheight(long struct) Unsafe version of | |
| nheight | back to summary |
|---|---|
| public static void nheight(long struct, float value) Unsafe version of | |
| nmaxDepth | back to summary |
|---|---|
| public static float nmaxDepth(long struct) Unsafe version of | |
| nmaxDepth | back to summary |
|---|---|
| public static void nmaxDepth(long struct, float value) Unsafe version of | |
| nminDepth | back to summary |
|---|---|
| public static float nminDepth(long struct) Unsafe version of | |
| nminDepth | back to summary |
|---|---|
| public static void nminDepth(long struct, float value) Unsafe version of | |
| nwidth | back to summary |
|---|---|
| public static float nwidth(long struct) Unsafe version of | |
| nwidth | back to summary |
|---|---|
| public static void nwidth(long struct, float value) Unsafe version of | |
| nx | back to summary |
|---|---|
| public static float nx(long struct) Unsafe version of | |
| nx | back to summary |
|---|---|
| public static void nx(long struct, float value) Unsafe version of | |
| ny | back to summary |
|---|---|
| public static float ny(long struct) Unsafe version of | |
| ny | back to summary |
|---|---|
| public static void ny(long struct, float value) Unsafe version of | |
| set | back to summary |
|---|---|
| public VkViewport set(float x, float y, float width, float height, float minDepth, float maxDepth) Initializes this struct with the specified values. | |
| set | back to summary |
|---|---|
| public VkViewport set(VkViewport src) Copies the specified struct data to this struct.
| |
| sizeof | back to summary |
|---|---|
| public int sizeof() Implements abstract org. Doc from org. Returns
| |
| width | back to summary |
|---|---|
| public float width()
| |
| width | back to summary |
|---|---|
| public VkViewport width(float value) Sets the specified value to the | |
| x | back to summary |
|---|---|
| public float x()
| |
| x | back to summary |
|---|---|
| public VkViewport x(float value) Sets the specified value to the | |
| y | back to summary |
|---|---|
| public float y() see | |
| y | back to summary |
|---|---|
| public VkViewport y(float value) Sets the specified value to the | |
VkViewport structs.
| Modifier and Type | Field and Description |
|---|---|
| private static final VkViewport |
| Access | Constructor and Description |
|---|---|
| public | Buffer(ByteBuffer container)
Creates a new |
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected VkViewport | |
| public float | |
| public VkViewport. | |
| public float | |
| public VkViewport. | |
| public float | |
| public VkViewport. | |
| protected VkViewport. | |
| public float | |
| public VkViewport. | |
| public float | |
| public VkViewport. | |
| public float | |
| public VkViewport. |
| ELEMENT_FACTORY | back to summary |
|---|---|
| private static final VkViewport ELEMENT_FACTORY | |
| Buffer | back to summary |
|---|---|
| public Buffer(ByteBuffer container) Creates a new Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
by The created buffer instance holds a strong reference to the container object. | |
| Buffer | back to summary |
|---|---|
| public Buffer(long address, int cap) | |
| Buffer | back to summary |
|---|---|
| pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap) | |
| getElementFactory | back to summary |
|---|---|
| protected VkViewport getElementFactory() Implements abstract org.
| |
| height | back to summary |
|---|---|
public float height()
| |
| height | back to summary |
|---|---|
| public VkViewport. Sets the specified value to the | |
| maxDepth | back to summary |
|---|---|
public float maxDepth()
| |
| maxDepth | back to summary |
|---|---|
| public VkViewport. Sets the specified value to the | |
| minDepth | back to summary |
|---|---|
public float minDepth()
| |
| minDepth | back to summary |
|---|---|
| public VkViewport. Sets the specified value to the | |
| self | back to summary |
|---|---|
| protected VkViewport. Implements abstract org.
| |
| width | back to summary |
|---|---|
public float width()
| |
| width | back to summary |
|---|---|
| public VkViewport. Sets the specified value to the | |
| x | back to summary |
|---|---|
public float x()
| |
| x | back to summary |
|---|---|
| public VkViewport. Sets the specified value to the | |
| y | back to summary |
|---|---|
public float y()
| |
| y | back to summary |
|---|---|
| public VkViewport. Sets the specified value to the | |