Skip to content

Commit

Permalink
Merge dpJudas's renderslices branch (#1356)
Browse files Browse the repository at this point in the history
* Remove threading from the drawers

* Fix some r_scene_multithreaded related bugs

* Fix some r_scene_multithreaded crashes

* Fix fullbright shade bug

* Fix truecolor drawer crash

* Add debug code for showing the render slices

* Fix texture loading race condition and improve performance by only locking the load mutex if data hasn't already been updated for this frame

Co-authored-by: Magnus Norddahl <dpjudas@users.noreply.github.com>
  • Loading branch information
XaserAcheron and dpjudas committed Mar 26, 2021
1 parent c6073d9 commit a5cba1a
Show file tree
Hide file tree
Showing 29 changed files with 1,336 additions and 1,987 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 a5cba1a

Please sign in to comment.