[][src]Module vulkano::pipeline::viewport

Viewports and scissor boxes.

There are two different concepts to determine where things will be drawn:

In other words modifying the viewport will stretch the image, while modifying the scissor box acts like a filter.

It is legal and sensible to use a viewport that is larger than the target image or that only partially overlaps the target image.

Multiple viewports

In most situations, you only need a single viewport and a single scissor box.

If, however, you use a geometry shader, you can specify multiple viewports and scissor boxes. Then in your geometry shader you can specify in which viewport and scissor box the primitive should be written to. In GLSL this is done by writing to the special variable gl_ViewportIndex.

If you don't use a geometry shader or use a geometry shader where don't set which viewport to use, then the first viewport and scissor box will be used.

Dynamic and fixed

Vulkan allows four different setups:

In all cases the number of viewports and scissor boxes must be the same.

Structs

Scissor

State of a single scissor box.

Viewport

State of a single viewport.

Enums

ViewportsState

List of viewports and scissors that are used when creating a graphics pipeline object.