srp
software rendering pipeline
Loading...
Searching...
No Matches
topology.h File Reference
#include "core/buffer_p.h"
Include dependency graph for topology.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

size_t computeTriangleCount (size_t vertexCount, SRPPrimitive prim)
 
void resolveTriangleTopology (size_t base, size_t rawTriIdx, SRPPrimitive prim, size_t *out)
 
size_t computeLineCount (size_t vertexCount, SRPPrimitive prim)
 
void resolveLineTopology (size_t base, size_t rawLineIdx, SRPPrimitive prim, size_t vertexCount, size_t *out)
 

Detailed Description

Topology-related functions

Function Documentation

◆ computeLineCount()

size_t computeLineCount ( size_t  vertexCount,
SRPPrimitive  prim 
)

Deduce the number of lines to assemble based on the number of vertices and primitive type

Parameters
[in]vertexCountNumber of vertices
[in]primPrimitive type
Returns
Number of lines that should be assembled

◆ resolveLineTopology()

void resolveLineTopology ( size_t  base,
size_t  rawLineIdx,
SRPPrimitive  prim,
size_t  vertexCount,
size_t *  out 
)

Determine the stream indices for a line based on its type

Parameters
[in]baseBase stream index
[in]rawLineIdxIndex of the primitive to assemble, starting from 0, including culled/skipped lines
[in]primPrimitive type
[in]vertexCountThe total amount of stream vertices for this draw call
[out]outArray of size 2 to store the resulting stream indices

◆ resolveTriangleTopology()

void resolveTriangleTopology ( size_t  base,
size_t  rawTriIdx,
SRPPrimitive  prim,
size_t *  out 
)

Determine the stream indices for a triangle based on its type

Parameters
[in]baseBase stream index
[in]rawTriIdxIndex of the primitive to assemble, starting from 0, including culled triangles
[in]primPrimitive type
[out]outArray of size 3 to store the resulting stream indices