Removed r_columnmethod as its performance gains are too insignificant to justify its complexity on the codebase

This commit is contained in:
Magnus Norddahl 2016-12-25 05:05:53 +01:00
parent 8231032f89
commit b0febec986
7 changed files with 10 additions and 207 deletions

View file

@ -445,7 +445,7 @@ namespace swrenderer
if (style.BlendOp == STYLEOP_Fuzz) if (style.BlendOp == STYLEOP_Fuzz)
{ {
colfunc = fuzzcolfunc; colfunc = fuzzcolfunc;
return DoDraw0; return DoDraw;
} }
else if (style == LegacyRenderStyles[STYLE_Shaded]) else if (style == LegacyRenderStyles[STYLE_Shaded])
{ {
@ -466,8 +466,7 @@ namespace swrenderer
{ {
R_SetColorMapLight(basecolormap, 0, 0); R_SetColorMapLight(basecolormap, 0, 0);
} }
bool active_columnmethod = r_columnmethod && !r_swtruecolor; return DoDraw;
return active_columnmethod ? DoDraw1 : DoDraw0;
} }
fglevel = GetAlpha(style.SrcAlpha, alpha); fglevel = GetAlpha(style.SrcAlpha, alpha);
@ -500,8 +499,7 @@ namespace swrenderer
{ {
return DontDraw; return DontDraw;
} }
bool active_columnmethod = r_columnmethod && !r_swtruecolor; return DoDraw;
return active_columnmethod ? DoDraw1 : DoDraw0;
} }
ESPSResult R_SetPatchStyle(FRenderStyle style, float alpha, int translation, uint32_t color) ESPSResult R_SetPatchStyle(FRenderStyle style, float alpha, int translation, uint32_t color)

View file

@ -15,7 +15,6 @@ EXTERN_CVAR(Float, r_lod_bias);
EXTERN_CVAR(Int, r_drawfuzz); EXTERN_CVAR(Int, r_drawfuzz);
EXTERN_CVAR(Bool, r_drawtrans); EXTERN_CVAR(Bool, r_drawtrans);
EXTERN_CVAR(Float, transsouls); EXTERN_CVAR(Float, transsouls);
EXTERN_CVAR(Int, r_columnmethod);
EXTERN_CVAR(Bool, r_dynlights); EXTERN_CVAR(Bool, r_dynlights);
namespace swrenderer namespace swrenderer
@ -131,8 +130,7 @@ namespace swrenderer
enum ESPSResult enum ESPSResult
{ {
DontDraw, // not useful to draw this DontDraw, // not useful to draw this
DoDraw0, // draw this as if r_columnmethod is 0 DoDraw // draw this
DoDraw1, // draw this as if r_columnmethod is 1
}; };
ESPSResult R_SetPatchStyle(FRenderStyle style, fixed_t alpha, int translation, uint32_t color); ESPSResult R_SetPatchStyle(FRenderStyle style, fixed_t alpha, int translation, uint32_t color);

View file

@ -65,18 +65,6 @@
CVAR (String, r_viewsize, "", CVAR_NOSET) CVAR (String, r_viewsize, "", CVAR_NOSET)
CVAR (Bool, r_shadercolormaps, true, CVAR_ARCHIVE) CVAR (Bool, r_shadercolormaps, true, CVAR_ARCHIVE)
CUSTOM_CVAR (Int, r_columnmethod, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{
if (self != 0 && self != 1)
{
self = 1;
}
else
{ // Trigger the change
setsizeneeded = true;
}
}
CVAR(Int, r_portal_recursions, 4, CVAR_ARCHIVE) CVAR(Int, r_portal_recursions, 4, CVAR_ARCHIVE)
CVAR(Bool, r_highlight_portals, false, CVAR_ARCHIVE) CVAR(Bool, r_highlight_portals, false, CVAR_ARCHIVE)

View file

@ -415,46 +415,13 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
mceilingclip = wallupper; mceilingclip = wallupper;
// draw the columns one at a time // draw the columns one at a time
if (drawmode == DoDraw0) if (drawmode == DoDraw)
{ {
for (dc_x = x1; dc_x < x2; ++dc_x) for (dc_x = x1; dc_x < x2; ++dc_x)
{ {
BlastMaskedColumn (tex, false); BlastMaskedColumn (tex, false);
} }
} }
else
{
// [RH] Draw up to four columns at once
int stop = x2 & ~3;
if (x1 >= x2)
goto clearfog;
dc_x = x1;
while ((dc_x < stop) && (dc_x & 3))
{
BlastMaskedColumn (tex, false);
dc_x++;
}
while (dc_x < stop)
{
rt_initcols(nullptr);
BlastMaskedColumn (tex, true); dc_x++;
BlastMaskedColumn (tex, true); dc_x++;
BlastMaskedColumn (tex, true); dc_x++;
BlastMaskedColumn (tex, true);
rt_draw4cols (dc_x - 3);
dc_x++;
}
while (dc_x < x2)
{
BlastMaskedColumn (tex, false);
dc_x++;
}
}
} }
else else
{ // Texture does wrap vertically. { // Texture does wrap vertically.
@ -2346,42 +2313,6 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper,
} }
else else
{ {
int stop4;
if (mode == DoDraw0)
{ // 1 column at a time
stop4 = dc_x;
}
else // DoDraw1
{ // up to 4 columns at a time
stop4 = x2 & ~3;
}
while ((dc_x < stop4) && (dc_x & 3))
{
if (calclighting)
{ // calculate lighting
R_SetColorMapLight(usecolormap, rw_light, wallshade);
}
R_WallSpriteColumn (false);
dc_x++;
}
while (dc_x < stop4)
{
if (calclighting)
{ // calculate lighting
R_SetColorMapLight(usecolormap, rw_light, wallshade);
}
rt_initcols(nullptr);
for (int zz = 4; zz; --zz)
{
R_WallSpriteColumn (true);
dc_x++;
}
rt_draw4cols (dc_x - 4);
}
while (dc_x < x2) while (dc_x < x2)
{ {
if (calclighting) if (calclighting)

View file

@ -530,7 +530,7 @@ void R_DrawVisSprite (vissprite_t *vis)
{ {
fixed_t frac; fixed_t frac;
FTexture *tex; FTexture *tex;
int x2, stop4; int x2;
fixed_t xiscale; fixed_t xiscale;
ESPSResult mode; ESPSResult mode;
bool ispsprite = (!vis->sector && vis->gpos != FVector3(0, 0, 0)); bool ispsprite = (!vis->sector && vis->gpos != FVector3(0, 0, 0));
@ -554,17 +554,6 @@ void R_DrawVisSprite (vissprite_t *vis)
if (mode != DontDraw) if (mode != DontDraw)
{ {
if (mode == DoDraw0)
{
// One column at a time
stop4 = vis->x1;
}
else // DoDraw1
{
// Up to four columns at a time
stop4 = vis->x2 & ~3;
}
tex = vis->pic; tex = vis->pic;
spryscale = vis->yscale; spryscale = vis->yscale;
sprflipvert = false; sprflipvert = false;
@ -592,27 +581,6 @@ void R_DrawVisSprite (vissprite_t *vis)
if (dc_x < x2) if (dc_x < x2)
{ {
while ((dc_x < stop4) && (dc_x & 3))
{
if (ispsprite || !R_ClipSpriteColumnWithPortals(vis))
R_DrawMaskedColumn (tex, frac, false);
dc_x++;
frac += xiscale;
}
while (dc_x < stop4)
{
rt_initcols(nullptr);
for (int zz = 4; zz; --zz)
{
if (ispsprite || !R_ClipSpriteColumnWithPortals(vis))
R_DrawMaskedColumn (tex, frac, true);
dc_x++;
frac += xiscale;
}
rt_draw4cols (dc_x - 4);
}
while (dc_x < x2) while (dc_x < x2)
{ {
if (ispsprite || !R_ClipSpriteColumnWithPortals(vis)) if (ispsprite || !R_ClipSpriteColumnWithPortals(vis))
@ -708,44 +676,6 @@ void R_DrawWallSprite(vissprite_t *spr)
} }
else else
{ {
int stop4;
if (mode == DoDraw0)
{ // 1 column at a time
stop4 = dc_x;
}
else // DoDraw1
{ // up to 4 columns at a time
stop4 = x2 & ~3;
}
while ((dc_x < stop4) && (dc_x & 3))
{
if (calclighting)
{ // calculate lighting
R_SetColorMapLight(usecolormap, rw_light, shade);
}
if (!R_ClipSpriteColumnWithPortals(spr))
R_WallSpriteColumn(false);
dc_x++;
}
while (dc_x < stop4)
{
if (calclighting)
{ // calculate lighting
R_SetColorMapLight(usecolormap, rw_light, shade);
}
rt_initcols(nullptr);
for (int zz = 4; zz; --zz)
{
if (!R_ClipSpriteColumnWithPortals(spr))
R_WallSpriteColumn(true);
dc_x++;
}
rt_draw4cols(dc_x - 4);
}
while (dc_x < x2) while (dc_x < x2)
{ {
if (calclighting) if (calclighting)

View file

@ -210,8 +210,6 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
if (mode != DontDraw) if (mode != DontDraw)
{ {
int stop4;
double centeryback = CenterY; double centeryback = CenterY;
CenterY = 0; CenterY = 0;
@ -277,56 +275,17 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
x2 = parms.rclip; x2 = parms.rclip;
} }
// Drawing short output ought to fit in the data cache well enough
// if we draw one column at a time, so do that, since it's simpler.
if (parms.destheight < 32 || (parms.dclip - parms.uclip) < 32)
{
mode = DoDraw0;
}
dc_x = int(x0); dc_x = int(x0);
int x2_i = int(x2); int x2_i = int(x2);
fixed_t xiscale_i = FLOAT2FIXED(xiscale); fixed_t xiscale_i = FLOAT2FIXED(xiscale);
if (mode == DoDraw0) while (dc_x < x2_i)
{ {
// One column at a time R_DrawMaskedColumn(img, frac, false, !parms.masked);
stop4 = dc_x; dc_x++;
} frac += xiscale_i;
else // DoDraw1`
{
// Up to four columns at a time
stop4 = x2_i & ~3;
} }
if (dc_x < x2_i)
{
while ((dc_x < stop4) && (dc_x & 3))
{
R_DrawMaskedColumn(img, frac, false, !parms.masked);
dc_x++;
frac += xiscale_i;
}
while (dc_x < stop4)
{
rt_initcols(nullptr);
for (int zz = 4; zz; --zz)
{
R_DrawMaskedColumn(img, frac, true, !parms.masked);
dc_x++;
frac += xiscale_i;
}
rt_draw4cols(dc_x - 4);
}
while (dc_x < x2_i)
{
R_DrawMaskedColumn(img, frac, false, !parms.masked);
dc_x++;
frac += xiscale_i;
}
}
CenterY = centeryback; CenterY = centeryback;
} }
R_FinishSetPatchStyle (); R_FinishSetPatchStyle ();

View file

@ -704,7 +704,6 @@ OptionMenu "VideoOptions"
Slider "$DSPLYMNU_BLOODFADE", "blood_fade_scalar", 0.0, 1.0, 0.05, 2 Slider "$DSPLYMNU_BLOODFADE", "blood_fade_scalar", 0.0, 1.0, 0.05, 2
Slider "$DSPLYMNU_PICKUPFADE", "pickup_fade_scalar", 0.0, 1.0, 0.05, 2 Slider "$DSPLYMNU_PICKUPFADE", "pickup_fade_scalar", 0.0, 1.0, 0.05, 2
Slider "$DSPLYMNU_WATERFADE", "underwater_fade_scalar", 0.0, 1.0, 0.05, 2 Slider "$DSPLYMNU_WATERFADE", "underwater_fade_scalar", 0.0, 1.0, 0.05, 2
Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods"
Option "$DSPLYMNU_BLENDMETHOD", "r_blendmethod", "BlendMethods" Option "$DSPLYMNU_BLENDMETHOD", "r_blendmethod", "BlendMethods"
StaticText " " StaticText " "