Functions related to vertex processing and post-VS cache.
More...
|
| struct | VertexCacheEntry |
| |
| typedef struct VertexCacheEntry | VertexCacheEntry |
| |
| typedef struct VertexCache | VertexCache |
| |
| static void | computeMinMaxVI (const SRPIndexBuffer *ib, size_t startIndex, size_t vertexCount, size_t *outMinVI, size_t *outMaxVI) |
| |
| void | allocateVertexCache (VertexCache *cache, const SRPIndexBuffer *ib, size_t startIndex, size_t vertexCount, size_t varyingSize) |
| |
| SRPVertexShaderOut * | vertexCacheFetch (VertexCache *cache, size_t vertexIndex, const SRPVertexBuffer *vb, const SRPShaderProgram *sp) |
| |
| void | processVertex (size_t vertexIndex, void *varyingBlock, size_t varyingIndex, const SRPVertexBuffer *vb, const SRPShaderProgram *sp, SRPVertexShaderOut *outV) |
| |
| void | applyPerspectiveDivide (SRPVertexShaderOut *output, float *outInvW) |
| |
Functions related to vertex processing and post-VS cache.
◆ VertexCache
◆ VertexCacheEntry
◆ allocateVertexCache()
| void allocateVertexCache |
( |
VertexCache * |
cache, |
|
|
const SRPIndexBuffer * |
ib, |
|
|
size_t |
startIndex, |
|
|
size_t |
vertexCount, |
|
|
size_t |
varyingSize |
|
) |
| |
Initialize / allocate vertex cache
- Parameters
-
| [in] | cache | Pointer to the cache |
| [in] | ib | The SRPIndexBuffer being used |
| [in] | startIndex | First stream index |
| [in] | vertexCount | How many vertices from the ib you want to process |
| [in] | varyingSize | The size of varying vertex parameters, in bytes |
◆ applyPerspectiveDivide()
Apply perspective divide to the output of the vertex shader, optionally saving the 1 / W_clip value
- Parameters
-
| [in] | output | Output of the vertex shader |
| [out] | outInvW | Pointer where 1/W value will be stored. May be NULL |
◆ computeMinMaxVI()
| static void computeMinMaxVI |
( |
const SRPIndexBuffer * |
ib, |
|
|
size_t |
startIndex, |
|
|
size_t |
vertexCount, |
|
|
size_t * |
outMinVI, |
|
|
size_t * |
outMaxVI |
|
) |
| |
|
static |
Compute minimal and maximal vertex indices given stream indices
◆ processVertex()
Run vertex shader
- Parameters
-
| [in] | vertexIndex | The index of the vertex to process (not its stream index!) |
| [in] | varyingBlock | Pointer to the block where vertex varyings are stored |
| [in] | varyingIndex | Index into the varyingBlock |
| [in] | vb | The SRPVertexBuffer being used |
| [in] | sp | The SRPShaderProgram being used |
| [out] | outV | Where to store the processed vertex |
◆ vertexCacheFetch()
Fetch vertex shader output from post-VS cache. If not found, compute and store it. Returns clip-space positions (does not perform perspective divide)
- Parameters
-
| [in] | cache | The vertex cache |
| [in] | vertexIndex | The index of the vertex to fetch (not its stream index!) |
| [in] | vb | The SRPVertexBuffer being used |
| [in] | sp | The SRPShaderProgram being used |
- Returns
- The processed, post-VS vertex