vis: revert alloca() back to stack storage in ClipStackWinding

- the MAX_WINDING limit was already enforced
- on Windows, alloca() generates __chkstk calls which adds a bit of overhead

gmsp3v2 benchmark (32 threads, 2 runs per config):

before (with alloca): 58.8s, 59.1s
this commit (no alloca): 56.2s, 56.4s
This commit is contained in:
Eric Wasylishen 2023-11-08 22:18:09 -07:00
parent f1bf0f546d
commit 54e7aadda7
1 changed files with 2 additions and 2 deletions

View File

@ -114,8 +114,8 @@ void FreeStackWinding(viswinding_t *&w, pstack_t &stack)
*/
viswinding_t *ClipStackWinding(visstats_t &stats, viswinding_t *in, pstack_t &stack, const qplane3d &split)
{
vec_t *dists = (vec_t *)alloca(sizeof(vec_t) * (in->size() + 1));
int *sides = (int *)alloca(sizeof(int) * (in->size() + 1));
vec_t dists[MAX_WINDING + 1];
int sides[MAX_WINDING + 1];
int counts[3];
int i, j;