struct render::BlitInformation

Information describing a blit operation from a source texture to a render target.

Public

Methods

staticBlitColor

static BlitInformation BlitColor(const SPtr<Texture> &inputTexture, const SPtr<RenderTarget> &outputRenderTarget, const Area2I &inputArea = Area2I::kEmpty, RenderSurfaceMask readOnlyMask = RT_NONE, RenderSurfaceMask loadMask = RT_NONE)

Helper to create blit information with commonly used settings for copying a color texture (no blending, no filtering, no UV flip).

staticBlitDepth

static BlitInformation BlitDepth(const SPtr<Texture> &inputTexture, const SPtr<RenderTarget> &outputRenderTarget, const Area2I &inputArea = Area2I::kEmpty, RenderSurfaceMask readOnlyMask = RT_NONE, RenderSurfaceMask loadMask = RT_NONE)

Helper to create blit information with commonly used settings for copying a depth texture (no blending, no filtering, no UV flip).

staticBlend

static BlitInformation Blend(const SPtr<Texture> &inputTexture, const SPtr<RenderTarget> &outputRenderTarget, const Area2I &inputArea = Area2I::kEmpty, RenderSurfaceMask readOnlyMask = RT_NONE, RenderSurfaceMask loadMask = RT_NONE)

Helper to create blit information with commonly used settings for blending a color texture with the currently bound render target (no filtering, no UV flip).

Fields

InputTexture

SPtr<Texture> InputTexture

Source texture to blit from.

This texture will be sampled and copied to the output render target. The texture can be either a color or depth texture, determined by the parameter.

InputArea

Area2I InputArea

Area of the source texture to blit from, in pixel coordinates.

If set to Area2I::kEmpty (default), the entire source texture will be used. The area is used to control which portion of the source texture is sampled when useFiltering is false. When useFiltering is true, the entire texture is always sampled with normalized UV coordinates.

OutputRenderTarget

SPtr<RenderTarget> OutputRenderTarget

Destination render target to blit to.

The blit operation will render into this target's color and/or depth surfaces depending on the isDepth parameter.

OutputArea

TOptional<Area2> OutputArea

Optional viewport area for the output render target, in normalized coordinates [0,1].

If not specified, the current viewport remains unchanged. If specified, the viewport will be set to this area before rendering, allowing the blit to target a specific region of the output render target.

LoadMask

RenderSurfaceMask LoadMask

Determines which render surfaces should not be loaded from memory at the start of the render pass.

This is a performance optimization - surfaces that will be completely overwritten don't need to be loaded. Use RenderSurfaceMask flags (RT_NONE, RT_COLOR0, RT_DEPTH, etc.) to specify surfaces. Default is RT_NONE (no surfaces are loaded).

ReadOnlyMask

RenderSurfaceMask ReadOnlyMask

Determines which render surfaces should be treated as read-only during the render pass.

Read-only surfaces cannot be written to and may enable additional optimizations (e.g., keeping depth buffer in compressed state). Use RenderSurfaceMask flags (RT_NONE, RT_COLOR0, RT_DEPTH, RT_ALL, etc.) to specify surfaces. Default is RT_NONE (all surfaces are writable).

ClearMask

RenderSurfaceMask ClearMask

Determines which render surfaces to clear.

FlipUV

bool FlipUV

If true, the vertical texture coordinates will be flipped during the blit.

This is useful when blitting between render targets with different coordinate systems (e.g., OpenGL vs DirectX).

IsDepth

bool IsDepth

If true, the source texture is treated as a depth texture and the blit will write to the output's depth surface.

If false, the source is treated as a color texture and writes to the color surface. Depth blits use point sampling and write depth values directly.

UseFiltering

bool UseFiltering

If true, bilinear filtering is used when sampling the source texture.

This produces smoother results when scaling but may introduce blur. If false, point sampling is used which preserves sharp edges but may show aliasing when scaling. Note: Ignored when is true (depth always uses point sampling).

UseBlend

bool UseBlend

If true, the blit will blend with the existing contents of the output render target using standard alpha blending (source alpha, inverse source alpha, add).

If false, the source texture completely replaces the destination. Only relevant if is false.

WriteAlpha

bool WriteAlpha

Controls whether the alpha channel is written during blending operations.

Only relevant when is true. If false, only RGB channels are written and alpha is preserved. If true, all RGBA channels are written.