srp
software rendering pipeline
Loading...
Searching...
No Matches
Draw dispatch

Draw dispatch functions. More...

Collaboration diagram for Draw dispatch:

Files

file  draw.c
 
file  draw.h
 
static void drawTriangles (const SRPIndexBuffer *ib, const SRPVertexBuffer *vb, const SRPFramebuffer *fb, const SRPShaderProgram *sp, SRPPrimitive primitive, size_t startIndex, size_t count)
 
static void drawLines (const SRPIndexBuffer *ib, const SRPVertexBuffer *vb, const SRPFramebuffer *fb, const SRPShaderProgram *sp, SRPPrimitive primitive, size_t startIndex, size_t count)
 
static void drawPoints (const SRPIndexBuffer *ib, const SRPVertexBuffer *vb, const SRPFramebuffer *fb, const SRPShaderProgram *sp, SRPPrimitive primitive, size_t startIndex, size_t count)
 
static bool checkOOB (const SRPIndexBuffer *ib, const SRPVertexBuffer *vb, size_t startIndex, size_t count)
 
static bool isPrimitiveTriangle (SRPPrimitive primitive)
 
static bool isPrimitiveLine (SRPPrimitive primitive)
 
static bool isPrimitivePoint (SRPPrimitive primitive)
 
void drawBuffer (const SRPIndexBuffer *ib, const SRPVertexBuffer *vb, const SRPFramebuffer *fb, const SRPShaderProgram *sp, SRPPrimitive primitive, size_t startIndex, size_t count)
 

Detailed Description

Draw dispatch functions.

Function Documentation

◆ checkOOB()

static bool checkOOB ( const SRPIndexBuffer ib,
const SRPVertexBuffer vb,
size_t  startIndex,
size_t  count 
)
static

Check if the draw call tries to access out-of-bounds memory and if so, send an error message

See also
drawBuffer() for parameter documentation

◆ drawBuffer()

void drawBuffer ( const SRPIndexBuffer ib,
const SRPVertexBuffer vb,
const SRPFramebuffer fb,
const SRPShaderProgram sp,
SRPPrimitive  primitive,
size_t  startIndex,
size_t  count 
)

Draw either SRPIndexBuffer or SRPVertexBuffer. If ib == NULL, draws the vertex buffer, else draws index buffer. Created because vertex and index buffer drawing are very similar, with an intent to avoid code duplication

See also
srpDrawVertexBuffer() srpDrawIndexBuffer() for parameter documentation

◆ drawLines()

static void drawLines ( const SRPIndexBuffer ib,
const SRPVertexBuffer vb,
const SRPFramebuffer fb,
const SRPShaderProgram sp,
SRPPrimitive  primitive,
size_t  startIndex,
size_t  count 
)
static

Draw line-based primitives from either SRPIndexBuffer or SRPVertexBuffer

See also
drawBuffer() for parameter documentation

◆ drawPoints()

static void drawPoints ( const SRPIndexBuffer ib,
const SRPVertexBuffer vb,
const SRPFramebuffer fb,
const SRPShaderProgram sp,
SRPPrimitive  primitive,
size_t  startIndex,
size_t  count 
)
static

Draw points from either SRPIndexBuffer or SRPVertexBuffer

See also
drawBuffer() for parameter documentation

◆ drawTriangles()

static void drawTriangles ( const SRPIndexBuffer ib,
const SRPVertexBuffer vb,
const SRPFramebuffer fb,
const SRPShaderProgram sp,
SRPPrimitive  primitive,
size_t  startIndex,
size_t  count 
)
static

Draw triangle-based primitives from either SRPIndexBuffer or SRPVertexBuffer

See also
drawBuffer() for parameter documentation

◆ isPrimitiveLine()

static bool isPrimitiveLine ( SRPPrimitive  primitive)
static

Determine if a primitive is line-based

Parameters
[in]primitivePrimitive type
Returns
true if the primitive is line-based, false otherwise

◆ isPrimitivePoint()

static bool isPrimitivePoint ( SRPPrimitive  primitive)
static

Determine if a primitive is a point

Parameters
[in]primitivePrimitive type
Returns
true if the primitive is a point, false otherwise

◆ isPrimitiveTriangle()

static bool isPrimitiveTriangle ( SRPPrimitive  primitive)
static

Determine if a primitive is triangle-based

Parameters
[in]primitivePrimitive type
Returns
true if the primitive is triangle-based, false otherwise