Skip to content

Commit

Permalink
Remove threading from the drawers
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas authored and madame-rachelle committed Mar 26, 2021
1 parent 6e5dbbc commit 4cd994c
Show file tree
Hide file tree
Showing 19 changed files with 1,175 additions and 1,867 deletions.
401 changes: 55 additions & 346 deletions src/rendering/swrenderer/drawers/r_draw.cpp

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions src/rendering/swrenderer/drawers/r_draw.h
Expand Up @@ -19,14 +19,12 @@ EXTERN_CVAR(Float, transsouls);
EXTERN_CVAR(Bool, r_dynlights);
EXTERN_CVAR(Bool, r_fuzzscale);

class DrawerCommandQueue;
typedef std::shared_ptr<DrawerCommandQueue> DrawerCommandQueuePtr;

namespace swrenderer
{
class DrawerArgs;
class SkyDrawerArgs;
class WallDrawerArgs;
class WallColumnDrawerArgs;
class SpanDrawerArgs;
class SpriteDrawerArgs;
class VoxelBlock;
Expand Down Expand Up @@ -55,8 +53,8 @@ namespace swrenderer
class SWPixelFormatDrawers
{
public:
SWPixelFormatDrawers(DrawerCommandQueuePtr queue) : Queue(queue) { }
virtual ~SWPixelFormatDrawers() { }
SWPixelFormatDrawers(RenderThread* thread) : thread(thread) { }
virtual ~SWPixelFormatDrawers() = default;
virtual void DrawWall(const WallDrawerArgs &args) = 0;
virtual void DrawWallMasked(const WallDrawerArgs &args) = 0;
virtual void DrawWallAdd(const WallDrawerArgs &args) = 0;
Expand Down Expand Up @@ -94,11 +92,15 @@ namespace swrenderer
virtual void DrawTiltedSpan(const SpanDrawerArgs &args, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy, FDynamicColormap *basecolormap) = 0;
virtual void DrawColoredSpan(const SpanDrawerArgs &args) = 0;
virtual void DrawFogBoundaryLine(const SpanDrawerArgs &args) = 0;
virtual void DrawParticleColumn(int x, int yl, int ycount, uint32_t fg, uint32_t alpha, uint32_t fracposx) = 0;

void DrawDepthColumn(const WallColumnDrawerArgs& args, float idepth);
void DrawDepthSkyColumn(const SkyDrawerArgs &args, float idepth);
void DrawDepthSpan(const SpanDrawerArgs &args, float idepth1, float idepth2);

DrawerCommandQueuePtr Queue;

void SetLights(WallColumnDrawerArgs& drawerargs, int x, int y1, const WallDrawerArgs& wallargs);

RenderThread* thread = nullptr;
};

void R_InitShadeMaps();
Expand Down

0 comments on commit 4cd994c

Please sign in to comment.