TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::PrimitiveRenderTarget Struct Reference

#include <gui_core/graphics/gui_primitive_renderer.h>

Classes

struct  Stream
 Per-kind primitive stream: CPU bytes appended by the emit methods and packed together into the current frame slot's GPU upload arena. More...
struct  ScopeReplay
 A cached scope drawn here, moved delta window pixels from where it was captured; its primitives' draw orders start at baseOrder. More...

Public Member Functions

void FinishRenderPass ()
void StartRenderPass (PrimitiveKind kind)
void AppendCaptured (const PrimitiveRenderTarget &src, tachyon::int2 delta)
 Appends another target's passes, translated by delta pixels.
void AddReplay (tachyon::ID scope, tachyon::int2 delta, uint32_t primitiveCount)
 Closes the open pass and adds a pass that draws cached scope scope, moved by delta; it takes primitiveCount draw orders.
size_t Render (RHI::RenderCommandList &cmdList, const PipelineSet &pipelines, GPUDrawPushConstants &push_constants)
 Uploads the streams and draws the passes; replay passes are left to the caller (PrimitiveRenderer).
void Reset ()
void SetTransform (tachyon::float3x2 transform)
void SetOpacity (float opacity)
void RenderBox (tachyon::IntRect rect, tachyon::IntRect clipRect, uint32_t fromStyleIndex, uint32_t toStyleIndex, float blendT, tachyon::VisualColorStyleIndex colorStyleIndex={}, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, tachyon::IntRect snappedPx={})
void RenderGlyph (tachyon::float2 pos, tachyon::float2 size, tachyon::float2 uvMin, tachyon::float2 uvMax, float scale, int bpp, int mode, tachyon::VisualColorStyleIndex textColorIndex, tachyon::IntRect clipRect, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, float shadowBlur=-1.0f)
void RenderLine (tachyon::int2 p0, tachyon::int2 p1, tachyon::int2 p2, tachyon::int2 p3, tachyon::IntRect clipRect, const tachyon::LineStyle &lineStyle)
void RenderCircle (tachyon::float2 center, float radius, tachyon::IntRect clipRect, const tachyon::LineStyle &lineStyle)
void RenderDot (tachyon::float2 pos, tachyon::IntRect clipRect, float size, tachyon::color4f color)
void RenderTriangle (tachyon::float2 p0, tachyon::float2 p1, tachyon::float2 p2, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, TriangleEdges hardEdges=TriangleEdges::None)
void RenderQuad (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius=0.0f, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid)
void RenderShadow (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius, int blur)
void RenderOccluder (tachyon::IntRect rect, tachyon::IntRect clipRect)

Public Attributes

std::array< Stream, kPrimitiveKindCount > streams
std::vector< PrimitiveRenderPass > renderPasses
int currentKind = -1
 kind of the open pass; -1 when none
tachyon::float3x2 currentTransform
float currentOpacity = 1.0f
 0 to 1, stamped into each primitive
std::vector< ScopeReplay > replays
uint32_t nextOrder = 0
 The draw order the next primitive gets; also counts a replay's primitives.

Member Function Documentation

◆ FinishRenderPass()

void tachyon::PrimitiveRenderTarget::FinishRenderPass ( )

◆ StartRenderPass()

void tachyon::PrimitiveRenderTarget::StartRenderPass ( PrimitiveKind kind)

◆ AppendCaptured()

void tachyon::PrimitiveRenderTarget::AppendCaptured ( const PrimitiveRenderTarget & src,
tachyon::int2 delta )

Appends another target's passes, translated by delta pixels.

Works for every kind: each primitive starts with the same header (transform0, transform1, clipMin, clipMax).

◆ AddReplay()

void tachyon::PrimitiveRenderTarget::AddReplay ( tachyon::ID scope,
tachyon::int2 delta,
uint32_t primitiveCount )

Closes the open pass and adds a pass that draws cached scope scope, moved by delta; it takes primitiveCount draw orders.

◆ Render()

size_t tachyon::PrimitiveRenderTarget::Render ( RHI::RenderCommandList & cmdList,
const PipelineSet & pipelines,
GPUDrawPushConstants & push_constants )

Uploads the streams and draws the passes; replay passes are left to the caller (PrimitiveRenderer).

Returns the bytes uploaded.

◆ Reset()

void tachyon::PrimitiveRenderTarget::Reset ( )

◆ SetTransform()

void tachyon::PrimitiveRenderTarget::SetTransform ( tachyon::float3x2 transform)

◆ SetOpacity()

void tachyon::PrimitiveRenderTarget::SetOpacity ( float opacity)
inline

◆ RenderBox()

void tachyon::PrimitiveRenderTarget::RenderBox ( tachyon::IntRect rect,
tachyon::IntRect clipRect,
uint32_t fromStyleIndex,
uint32_t toStyleIndex,
float blendT,
tachyon::VisualColorStyleIndex colorStyleIndex = {},
tachyon::ImageIndex textureIndex = tachyon::ImageIndex::Invalid,
tachyon::IntRect snappedPx = {} )

◆ RenderGlyph()

void tachyon::PrimitiveRenderTarget::RenderGlyph ( tachyon::float2 pos,
tachyon::float2 size,
tachyon::float2 uvMin,
tachyon::float2 uvMax,
float scale,
int bpp,
int mode,
tachyon::VisualColorStyleIndex textColorIndex,
tachyon::IntRect clipRect,
tachyon::ImageIndex textureIndex = tachyon::ImageIndex::Invalid,
float shadowBlur = -1.0f )

◆ RenderLine()

void tachyon::PrimitiveRenderTarget::RenderLine ( tachyon::int2 p0,
tachyon::int2 p1,
tachyon::int2 p2,
tachyon::int2 p3,
tachyon::IntRect clipRect,
const tachyon::LineStyle & lineStyle )

◆ RenderCircle()

void tachyon::PrimitiveRenderTarget::RenderCircle ( tachyon::float2 center,
float radius,
tachyon::IntRect clipRect,
const tachyon::LineStyle & lineStyle )

◆ RenderDot()

void tachyon::PrimitiveRenderTarget::RenderDot ( tachyon::float2 pos,
tachyon::IntRect clipRect,
float size,
tachyon::color4f color )

◆ RenderTriangle()

void tachyon::PrimitiveRenderTarget::RenderTriangle ( tachyon::float2 p0,
tachyon::float2 p1,
tachyon::float2 p2,
tachyon::IntRect clipRect,
tachyon::VisualColorStyleIndex colorStyleIndex,
tachyon::ImageIndex textureIndex = tachyon::ImageIndex::Invalid,
TriangleEdges hardEdges = TriangleEdges::None )

◆ RenderQuad()

void tachyon::PrimitiveRenderTarget::RenderQuad ( tachyon::IntRect rect,
tachyon::IntRect clipRect,
tachyon::VisualColorStyleIndex colorStyleIndex,
float cornerRadius = 0.0f,
tachyon::ImageIndex textureIndex = tachyon::ImageIndex::Invalid )

◆ RenderShadow()

void tachyon::PrimitiveRenderTarget::RenderShadow ( tachyon::IntRect rect,
tachyon::IntRect clipRect,
tachyon::VisualColorStyleIndex colorStyleIndex,
float cornerRadius,
int blur )

◆ RenderOccluder()

void tachyon::PrimitiveRenderTarget::RenderOccluder ( tachyon::IntRect rect,
tachyon::IntRect clipRect )

Member Data Documentation

◆ streams

std::array<Stream, kPrimitiveKindCount> tachyon::PrimitiveRenderTarget::streams

◆ renderPasses

std::vector<PrimitiveRenderPass> tachyon::PrimitiveRenderTarget::renderPasses

◆ currentKind

int tachyon::PrimitiveRenderTarget::currentKind = -1

kind of the open pass; -1 when none

◆ currentTransform

tachyon::float3x2 tachyon::PrimitiveRenderTarget::currentTransform

◆ currentOpacity

float tachyon::PrimitiveRenderTarget::currentOpacity = 1.0f

0 to 1, stamped into each primitive

◆ replays

std::vector<ScopeReplay> tachyon::PrimitiveRenderTarget::replays

◆ nextOrder

uint32_t tachyon::PrimitiveRenderTarget::nextOrder = 0

The draw order the next primitive gets; also counts a replay's primitives.


The documentation for this struct was generated from the following file: