srp
software rendering pipeline
Loading...
Searching...
No Matches
triangle.c File Reference
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include "srp/context.h"
#include "srp/vertex.h"
#include "srp/shaders.h"
#include "srp/color.h"
#include "srp/vec.h"
#include "raster/triangle.h"
#include "raster/fragment.h"
#include "core/framebuffer_p.h"
#include "pipeline/vertex_processing.h"
#include "pipeline/interpolation.h"
#include "math/utils.h"
#include "utils/message_callback_p.h"
#include "utils/voidptr.h"
Include dependency graph for triangle.c:

Functions

static float signedAreaParallelogram (const vec3 *restrict a, const vec3 *restrict b)
 
static bool shouldCullTriangle (const SRPTriangle *tri, bool *isCCW, bool *isFrontFacing)
 
static void triangleChangeWinding (SRPTriangle *tri)
 
static void calculateBarycentrics (SRPTriangle *tri, float areaX2, vec2 point)
 
static bool isEdgeFlatTopOrLeft (const vec3 *restrict edge)
 
static void triangleInterpolateData (SRPTriangle *tri, const SRPShaderProgram *restrict sp, SRPInterpolated *pInterpolatedBuffer, float *depth, float *recIntInvW)
 
void rasterizeTriangle (SRPTriangle *tri, const SRPFramebuffer *fb, const SRPShaderProgram *restrict sp, void *interpolatedBuffer)
 
bool setupTriangle (SRPTriangle *tri, const SRPFramebuffer *fb)
 

Detailed Description

Triangle rasterization implementation