20#ifndef RHI_LAYER_DRAW_PLAN_H
21#define RHI_LAYER_DRAW_PLAN_H
61 const std::vector<POLARITY_RUN>& aRuns = {} )
65 std::vector<LAYER_DRAW_STEP> steps;
71 const POLARITY_RUN& run = aRuns[ii];
74 for(
int shape = 0; shape <
RHI_SHAPES; ++shape )
76 steps.push_back( {
RHI_SHAPE( shape ), mode, run.negative,
false,
true, run.start[shape],
84 auto instances = [&](
LAYER_DRAW_MODE aMode,
bool aNegatives,
bool aNearHalf )
88 steps.push_back( {
RHI_SHAPE( shape ), aMode, aNegatives, aNearHalf,
false,
90 aNegatives ? aRange.
negCount[shape] : aRange.
count[shape] } );
97 instances( fill,
false,
false );
The Cairo implementation of the graphics abstraction layer.
RHI_SHAPE
Shapes a frame draws, each with its own array and pipelines.
constexpr int RHI_INSTANCED_SHAPES
@ MARK
write depth only, so the layer's later draws stay out of these pixels
@ NEGATIVE
erase what the layer has drawn so far, inside a temp target
@ ONCE
blend, but let each pixel take the layer only once
@ BLEND
ordinary alpha blending
std::vector< LAYER_DRAW_STEP > RhiPlanLayerDraws(const LAYER_RANGE &aRange, const std::vector< POLARITY_RUN > &aRuns={})
Order the draws of one layer range.
One draw of a layer range.
bool ordered
part of a polarity run, taken from the range's drawing order
bool negatives
draws the range's negative elements instead of its normal ones
bool nearHalf
drawn in the nearer half of the layer's depth slice
uint32_t start
first element, or first vertex of a polygon step
One layer's instance ranges within the flat GPU buffers, normal instances before negatives.
RHI_SHAPE_COUNTS negStart
bool singleCoverage
Draw straight into the target using the range's own depth slice, either taking each pixel once at tra...
RHI_SHAPE_COUNTS negCount
RHI_SHAPE_COUNTS start
Each shape's normal elements, then for an instanced shape its negatives.
uint32_t runStart
The range's runs in FRAME_DRAW_DESC::polarityRuns, none when its order does not matter.