book_4_sparkGenerated
code_blocksInput

Description

The ViewportSize property provides a handle to the viewport size within the CommandList class. This handle is used to manage and access the dimensions of the rendering viewport, which is crucial for rendering operations that depend on the size of the viewport.

Usage

Use the ViewportSize property when you need to retrieve or manipulate the size of the viewport in rendering operations. This property is particularly useful in scenarios where rendering logic needs to adapt to different viewport sizes, such as in dynamic resolution scaling or when rendering to different target sizes.

Example

// Example of accessing the ViewportSize property
var commandList = new CommandList();
var viewportSizeHandle = commandList.ViewportSize;

// Use the viewportSizeHandle in rendering operations
// For example, setting it as a parameter in a shader or adjusting rendering logic