Vireo  0.0
Vireo 3D Rendering Hardware Interface
Viewports and scissors

A viewport basically describes the region of the framebuffer that the output will be rendered to. This will almost always be (0, 0) to (width, height).

While viewports define the transformation from the image to the framebuffer, scissor rectangles define in which regions pixels will actually be stored. Any pixels outside the scissor rectangles will be discarded by the rasterizer. They function like a filter rather than a transformation (image is from the Vulkan tutorial):

viewports_scissors.png

We need to record the commands to set the viewports & scissors at the start of the render pass :

frameData.commandList->setViewport(vireo::Viewport{
.width = static_cast<float>(swapChain->getExtent().width),
.height = static_cast<float>(swapChain->getExtent().height)});
frameData.commandList->setScissors(vireo::Rect{
.width = swapChain->getExtent().width,
.height = swapChain->getExtent().height});
// commands will be recorded and submitted here

Next : Vertex data