"Another dumb polymost optimization. Probably worth few fps in heavy scenes"

Patch from Nuke.YKT

git-svn-id: https://svn.eduke32.com/eduke32@7865 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-08-01 06:50:21 +00:00 committed by Christoph Oelckers
parent 0652b5b6d6
commit 0091acc858

View file

@ -2816,12 +2816,22 @@ static void polymost_domost(float x0, float y0, float x1, float y1, float y0top
vec2f_t n0, n1; vec2f_t n0, n1;
float spx[4]; float spx[4];
int32_t spt[4]; int32_t spt[4];
int firstnode = vsp[0].n;
for (bssize_t newi, i=vsp[0].n; i; i=newi) for (bssize_t newi, i=vsp[0].n; i; i=newi)
{ {
newi = vsp[i].n; n0.x = vsp[i].x; n1.x = vsp[newi].x; newi = vsp[i].n; n0.x = vsp[i].x; n1.x = vsp[newi].x;
if ((dm0.x >= n1.x) || (n0.x >= dm1.x) || (vsp[i].ctag <= 0)) continue; if (dm0.x >= n1.x)
{
firstnode = i;
continue;
}
if (n0.x >= dm1.x)
break;
if (vsp[i].ctag <= 0) continue;
float const dx = n1.x-n0.x; float const dx = n1.x-n0.x;
float const cy[2] = { vsp[i].cy[0], vsp[i].fy[0] }, float const cy[2] = { vsp[i].cy[0], vsp[i].fy[0] },
@ -3143,10 +3153,13 @@ skip: ;
//Combine neighboring vertical strips with matching collinear top&bottom edges //Combine neighboring vertical strips with matching collinear top&bottom edges
//This prevents x-splits from propagating through the entire scan //This prevents x-splits from propagating through the entire scan
#ifdef COMBINE_STRIPS #ifdef COMBINE_STRIPS
int i = vsp[0].n; int i = firstnode;
do do
{ {
if (vsp[i].x >= dm1.x)
break;
if ((vsp[i].cy[0]+DOMOST_OFFSET*2 >= vsp[i].fy[0]) && (vsp[i].cy[1]+DOMOST_OFFSET*2 >= vsp[i].fy[1])) if ((vsp[i].cy[0]+DOMOST_OFFSET*2 >= vsp[i].fy[0]) && (vsp[i].cy[1]+DOMOST_OFFSET*2 >= vsp[i].fy[1]))
vsp[i].ctag = vsp[i].ftag = -1; vsp[i].ctag = vsp[i].ftag = -1;