KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rhi_cull_runs.h File Reference
#include <rhi/frame_packet.h>
#include <rhi/rhi_instance.h>
#include <rhi/rhi_vertex.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <limits>
#include <vector>
#include <glm/glm.hpp>

Go to the source code of this file.

Classes

struct  KIGFX::RHI_RUN_BOUNDS
 
struct  KIGFX::RHI_RUN_TABLE
 Runs of each array a layer range draws from, indexed by element / RHI_CULL_RUN_LENGTH. More...
 
struct  KIGFX::RHI_CULL_VIEW
 The world rectangle a frame shows and the world size of one of its pixels. More...
 
struct  KIGFX::RHI_CULL_COUNT
 Runs a pass looked at and how many it drew, to tell how well culling works. More...
 

Namespaces

namespace  KIGFX
 The Cairo implementation of the graphics abstraction layer.
 

Functions

void KIGFX::RhiInstanceReach (const RHI_INSTANCE &aInstance, RHI_SHAPE aShape, float &aWorld, float &aPixels)
 How far an instance reaches from its position, in world units and in pixels.
 
RHI_RUN_BOUNDS KIGFX::RhiInstanceRun (const RHI_INSTANCE *aInstances, size_t aCount, RHI_SHAPE aShape)
 
RHI_RUN_BOUNDS KIGFX::RhiVertexRun (const RHI_VERTEX *aVertices, size_t aCount)
 
constexpr uint32_t KIGFX::RhiCullRunLength (int aShape)
 
RHI_CULL_VIEW KIGFX::RhiCullView (const FRAME_UBO_DATA &aFrame)
 Invert the frame's 2D projection over the normalized device square.
 
template<typename DRAW>
void KIGFX::RhiForVisibleStretches (const std::vector< RHI_RUN_BOUNDS > *aRuns, uint32_t aRunLength, uint32_t aStart, uint32_t aCount, const RHI_CULL_VIEW &aView, DRAW &&aDraw, RHI_CULL_COUNT *aTally=nullptr)
 Call aDraw( first, count ) for each stretch of [aStart, aStart + aCount) whose runs can reach aView.
 
bool KIGFX::RhiRangeReaches (const LAYER_RANGE &aRange, const RHI_CULL_VIEW &aView)
 A range without runs or with bitmaps always reaches.
 

Variables

constexpr uint32_t KIGFX::RHI_CULL_RUN_LENGTH = 256
 
constexpr float KIGFX::RHI_CULL_PIXEL_SLACK = 4.0f
 Reach of every element beyond its own extent for antialiasing padding, pixel snapping and the edge.
 
constexpr uint32_t KIGFX::RHI_CULL_VERTEX_RUN_LENGTH = 3 * RHI_CULL_RUN_LENGTH
 Polygon vertices per run, three per triangle.