Skip to content
Permalink
Browse files

- rewrite screen triangle drawer to be more modular and better suppor…

…t the hwrenderer shaders
  • Loading branch information...
dpjudas committed Aug 5, 2019
1 parent ebe377e commit f73470dcf4181efab22312beb6d0b7cbc2d9c687
@@ -909,6 +909,7 @@ void PolyTriangleThreadData::DrawShadedTriangle(const ShadedTriVertex *const* ve
}
#endif

#if 0
// Keep varyings in -128 to 128 range if possible
// But don't do this for the skycap mode since the V texture coordinate is used for blending
if (numclipvert > 0 && drawargs.BlendMode() != TriBlendMode::Skycap)
@@ -921,6 +922,7 @@ void PolyTriangleThreadData::DrawShadedTriangle(const ShadedTriVertex *const* ve
clippedvert[i].v -= newOriginV;
}
}
#endif

if (twosided && numclipvert > 2)
{
@@ -198,16 +198,20 @@ class PolyTriangleThreadData
return MAX(c, 0);
}

// Varyings
float worldposX[MAXWIDTH];
float worldposY[MAXWIDTH];
float worldposZ[MAXWIDTH];
uint32_t texel[MAXWIDTH];
int32_t texelV[MAXWIDTH];
uint16_t lightarray[MAXWIDTH];
uint32_t dynlights[MAXWIDTH];
float depthvalues[MAXWIDTH];
uint8_t alphatestbuffer[MAXWIDTH];
struct Scanline
{
float W[MAXWIDTH];
float U[MAXWIDTH];
float V[MAXWIDTH];
float WorldX[MAXWIDTH];
float WorldY[MAXWIDTH];
float WorldZ[MAXWIDTH];
uint32_t FragColor[MAXWIDTH];
#if 0
uint16_t lightarray[MAXWIDTH];
uint32_t dynlights[MAXWIDTH];
#endif
} scanline;

static PolyTriangleThreadData *Get(DrawerThread *thread);

0 comments on commit f73470d

Please sign in to comment.
You can’t perform that action at this time.