From b0febec986f6f2b9e4e80ff763f23d242ecd0512 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 25 Dec 2016 05:05:53 +0100 Subject: [PATCH] Removed r_columnmethod as its performance gains are too insignificant to justify its complexity on the codebase --- src/r_draw.cpp | 8 ++--- src/r_draw.h | 4 +-- src/r_main.cpp | 12 ------- src/r_segs.cpp | 71 +------------------------------------- src/r_things.cpp | 72 +-------------------------------------- src/v_draw.cpp | 49 +++----------------------- wadsrc/static/menudef.txt | 1 - 7 files changed, 10 insertions(+), 207 deletions(-) diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 14b6ec55a..4ec274593 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -445,7 +445,7 @@ namespace swrenderer if (style.BlendOp == STYLEOP_Fuzz) { colfunc = fuzzcolfunc; - return DoDraw0; + return DoDraw; } else if (style == LegacyRenderStyles[STYLE_Shaded]) { @@ -466,8 +466,7 @@ namespace swrenderer { R_SetColorMapLight(basecolormap, 0, 0); } - bool active_columnmethod = r_columnmethod && !r_swtruecolor; - return active_columnmethod ? DoDraw1 : DoDraw0; + return DoDraw; } fglevel = GetAlpha(style.SrcAlpha, alpha); @@ -500,8 +499,7 @@ namespace swrenderer { return DontDraw; } - bool active_columnmethod = r_columnmethod && !r_swtruecolor; - return active_columnmethod ? DoDraw1 : DoDraw0; + return DoDraw; } ESPSResult R_SetPatchStyle(FRenderStyle style, float alpha, int translation, uint32_t color) diff --git a/src/r_draw.h b/src/r_draw.h index f0aee6f1a..367cba36b 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -15,7 +15,6 @@ EXTERN_CVAR(Float, r_lod_bias); EXTERN_CVAR(Int, r_drawfuzz); EXTERN_CVAR(Bool, r_drawtrans); EXTERN_CVAR(Float, transsouls); -EXTERN_CVAR(Int, r_columnmethod); EXTERN_CVAR(Bool, r_dynlights); namespace swrenderer @@ -131,8 +130,7 @@ namespace swrenderer enum ESPSResult { DontDraw, // not useful to draw this - DoDraw0, // draw this as if r_columnmethod is 0 - DoDraw1, // draw this as if r_columnmethod is 1 + DoDraw // draw this }; ESPSResult R_SetPatchStyle(FRenderStyle style, fixed_t alpha, int translation, uint32_t color); diff --git a/src/r_main.cpp b/src/r_main.cpp index 17b8e682f..c67b48a1b 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -65,18 +65,6 @@ CVAR (String, r_viewsize, "", CVAR_NOSET) 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(Bool, r_highlight_portals, false, CVAR_ARCHIVE) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 14abcfc24..f171d7933 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -415,46 +415,13 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) mceilingclip = wallupper; // draw the columns one at a time - if (drawmode == DoDraw0) + if (drawmode == DoDraw) { for (dc_x = x1; dc_x < x2; ++dc_x) { 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 { // Texture does wrap vertically. @@ -2346,42 +2313,6 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, } 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) { if (calclighting) diff --git a/src/r_things.cpp b/src/r_things.cpp index 53e3c0589..7b6114d00 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -530,7 +530,7 @@ void R_DrawVisSprite (vissprite_t *vis) { fixed_t frac; FTexture *tex; - int x2, stop4; + int x2; fixed_t xiscale; ESPSResult mode; 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 == 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; spryscale = vis->yscale; sprflipvert = false; @@ -592,27 +581,6 @@ void R_DrawVisSprite (vissprite_t *vis) 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) { if (ispsprite || !R_ClipSpriteColumnWithPortals(vis)) @@ -708,44 +676,6 @@ void R_DrawWallSprite(vissprite_t *spr) } 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) { if (calclighting) diff --git a/src/v_draw.cpp b/src/v_draw.cpp index b529770d6..0e75bc282 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -210,8 +210,6 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms) if (mode != DontDraw) { - int stop4; - double centeryback = CenterY; CenterY = 0; @@ -277,56 +275,17 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms) 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); int x2_i = int(x2); fixed_t xiscale_i = FLOAT2FIXED(xiscale); - if (mode == DoDraw0) + while (dc_x < x2_i) { - // One column at a time - stop4 = dc_x; - } - else // DoDraw1` - { - // Up to four columns at a time - stop4 = x2_i & ~3; + R_DrawMaskedColumn(img, frac, false, !parms.masked); + dc_x++; + frac += xiscale_i; } - 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; } R_FinishSetPatchStyle (); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 8882c89ae..314534bb7 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -704,7 +704,6 @@ OptionMenu "VideoOptions" 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_WATERFADE", "underwater_fade_scalar", 0.0, 1.0, 0.05, 2 - Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods" Option "$DSPLYMNU_BLENDMETHOD", "r_blendmethod", "BlendMethods" StaticText " "