mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 05:17:40 -07:00
remove templates
seems to just make things sliiightly slower on my machine
This commit is contained in:
parent
0c8095c1bb
commit
3facbe90c9
@ -741,8 +741,8 @@ void SoftRenderer::RenderShadowMaskScanline(RendererPolygon* rp, s32 y)
|
||||
interp_start = &rp->SlopeR.Interp;
|
||||
interp_end = &rp->SlopeL.Interp;
|
||||
|
||||
rp->SlopeR.EdgeParams<true>(&l_edgelen, &l_edgecov);
|
||||
rp->SlopeL.EdgeParams<true>(&r_edgelen, &r_edgecov);
|
||||
rp->SlopeR.EdgeParams(&l_edgelen, &l_edgecov, true);
|
||||
rp->SlopeL.EdgeParams(&r_edgelen, &r_edgecov, true);
|
||||
|
||||
std::swap(xstart, xend);
|
||||
std::swap(wl, wr);
|
||||
@ -773,9 +773,9 @@ void SoftRenderer::RenderShadowMaskScanline(RendererPolygon* rp, s32 y)
|
||||
interp_start = &rp->SlopeL.Interp;
|
||||
interp_end = &rp->SlopeR.Interp;
|
||||
|
||||
rp->SlopeL.EdgeParams<false>(&l_edgelen, &l_edgecov);
|
||||
rp->SlopeR.EdgeParams<false>(&r_edgelen, &r_edgecov);
|
||||
|
||||
rp->SlopeL.EdgeParams(&l_edgelen, &l_edgecov, false);
|
||||
rp->SlopeR.EdgeParams(&r_edgelen, &r_edgecov, false);
|
||||
|
||||
// CHECKME: edge fill rules for unswapped opaque shadow mask polygons
|
||||
if ((GPU.GPU3D.RenderDispCnt & ((1<<4)|(1<<5))) || ((polyalpha < 31) && (GPU.GPU3D.RenderDispCnt & (1<<3))) || wireframe)
|
||||
{
|
||||
@ -970,8 +970,8 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
||||
interp_start = &rp->SlopeR.Interp;
|
||||
interp_end = &rp->SlopeL.Interp;
|
||||
|
||||
rp->SlopeR.EdgeParams<true>(&l_edgelen, &l_edgecov);
|
||||
rp->SlopeL.EdgeParams<true>(&r_edgelen, &r_edgecov);
|
||||
rp->SlopeR.EdgeParams(&l_edgelen, &l_edgecov, true);
|
||||
rp->SlopeL.EdgeParams(&r_edgelen, &r_edgecov, true);
|
||||
|
||||
std::swap(xstart, xend);
|
||||
std::swap(wl, wr);
|
||||
@ -1008,8 +1008,8 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
||||
interp_start = &rp->SlopeL.Interp;
|
||||
interp_end = &rp->SlopeR.Interp;
|
||||
|
||||
rp->SlopeL.EdgeParams<false>(&l_edgelen, &l_edgecov);
|
||||
rp->SlopeR.EdgeParams<false>(&r_edgelen, &r_edgecov);
|
||||
rp->SlopeL.EdgeParams(&l_edgelen, &l_edgecov, false);
|
||||
rp->SlopeR.EdgeParams(&r_edgelen, &r_edgecov, false);
|
||||
|
||||
// edge fill rules for unswapped opaque edges:
|
||||
// * right edge is filled if slope > 1
|
||||
|
@ -347,13 +347,12 @@ private:
|
||||
else if (ret > xmax) ret = xmax;
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<bool swapped>
|
||||
constexpr void EdgeParams_XMajor(s32* length, s32* coverage) const
|
||||
|
||||
constexpr void EdgeParams_XMajor(s32* length, s32* coverage, bool swapped) const
|
||||
{
|
||||
// only do length calc for right side when swapped as it's
|
||||
// only needed for aa calcs, as actual line spans are broken
|
||||
if constexpr (!swapped || side)
|
||||
if (!swapped || side)
|
||||
{
|
||||
if (side ^ Negative)
|
||||
*length = (dx >> 18) - ((dx-Increment) >> 18);
|
||||
@ -379,11 +378,10 @@ private:
|
||||
|
||||
*coverage = startcov;
|
||||
|
||||
if constexpr (swapped) *length = 1;
|
||||
if (swapped) *length = 1;
|
||||
}
|
||||
|
||||
template<bool swapped>
|
||||
constexpr void EdgeParams_YMajor(s32* length, s32* coverage) const
|
||||
constexpr void EdgeParams_YMajor(s32* length, s32* coverage, bool swapped) const
|
||||
{
|
||||
*length = 1;
|
||||
|
||||
@ -404,14 +402,13 @@ private:
|
||||
*coverage = cov << 5;
|
||||
}
|
||||
}
|
||||
|
||||
template<bool swapped>
|
||||
constexpr void EdgeParams(s32* length, s32* coverage) const
|
||||
|
||||
constexpr void EdgeParams(s32* length, s32* coverage, bool swapped) const
|
||||
{
|
||||
if (XMajor)
|
||||
return EdgeParams_XMajor<swapped>(length, coverage);
|
||||
return EdgeParams_XMajor(length, coverage, swapped);
|
||||
else
|
||||
return EdgeParams_YMajor<swapped>(length, coverage);
|
||||
return EdgeParams_YMajor(length, coverage, swapped);
|
||||
}
|
||||
|
||||
s32 Increment;
|
||||
|
Loading…
Reference in New Issue
Block a user