From cb4ffbf053b37c6917e6387de48553ce8f4f31be Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 28 Oct 2018 19:06:29 +0100 Subject: [PATCH] - moved the draw lists back to the API independent side. The original idea was to let Vulkan do this completely differently, but if that comes to pass it should be done without having generic data maintenance code on the API side. --- src/CMakeLists.txt | 2 +- src/gl/scene/gl_drawinfo.h | 5 ----- src/hwrenderer/scene/hw_drawinfo.h | 8 +++---- .../scene/hw_drawlistadd.cpp} | 21 +++++++------------ 4 files changed, 12 insertions(+), 24 deletions(-) rename src/{gl/scene/gl_walls_draw.cpp => hwrenderer/scene/hw_drawlistadd.cpp} (90%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93ee0b4b2..6a945d6bb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -821,7 +821,6 @@ set( FASTMATH_SOURCES textures/hires/xbr/xbrz_old.cpp gl/scene/gl_drawinfo.cpp gl/scene/gl_scene.cpp - gl/scene/gl_walls_draw.cpp gl_load/gl_load.c hwrenderer/postprocessing/hw_postprocess_cvars.cpp hwrenderer/postprocessing/hw_postprocessshader.cpp @@ -831,6 +830,7 @@ set( FASTMATH_SOURCES hwrenderer/scene/hw_decal.cpp hwrenderer/scene/hw_drawinfo.cpp hwrenderer/scene/hw_drawlist.cpp + hwrenderer/scene/hw_drawlistadd.cpp hwrenderer/scene/hw_clipper.cpp hwrenderer/scene/hw_flats.cpp hwrenderer/scene/hw_portal.cpp diff --git a/src/gl/scene/gl_drawinfo.h b/src/gl/scene/gl_drawinfo.h index f64c1ef48..eddd40ce2 100644 --- a/src/gl/scene/gl_drawinfo.h +++ b/src/gl/scene/gl_drawinfo.h @@ -14,11 +14,6 @@ struct FDrawInfo : public HWDrawInfo { - void AddWall(GLWall *wall) override; - void AddMirrorSurface(GLWall *w) override; - void AddFlat(GLFlat *flat, bool fog) override; - void AddSprite(GLSprite *sprite, bool translucent) override; - void Draw(EDrawType dt, FRenderState &state, int index, int count, bool apply = true) override; void DrawIndexed(EDrawType dt, FRenderState &state, int index, int count, bool apply = true) override; void RenderPortal(HWPortal *p, bool stencil) override; diff --git a/src/hwrenderer/scene/hw_drawinfo.h b/src/hwrenderer/scene/hw_drawinfo.h index 1a2f3e2eb..acee209f9 100644 --- a/src/hwrenderer/scene/hw_drawinfo.h +++ b/src/hwrenderer/scene/hw_drawinfo.h @@ -351,10 +351,10 @@ public: void ProcessLowerMinisegs(TArray &lowersegs); virtual void AddSubsectorToPortal(FSectorPortalGroup *portal, subsector_t *sub) = 0; - virtual void AddWall(GLWall *w) = 0; - virtual void AddMirrorSurface(GLWall *w) = 0; - virtual void AddFlat(GLFlat *flat, bool fog) = 0; - virtual void AddSprite(GLSprite *sprite, bool translucent) = 0; + void AddWall(GLWall *w); + void AddMirrorSurface(GLWall *w); + void AddFlat(GLFlat *flat, bool fog); + void AddSprite(GLSprite *sprite, bool translucent); virtual bool SetDepthClamp(bool on) = 0; diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/hwrenderer/scene/hw_drawlistadd.cpp similarity index 90% rename from src/gl/scene/gl_walls_draw.cpp rename to src/hwrenderer/scene/hw_drawlistadd.cpp index 8901d9971..a1657b396 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/hwrenderer/scene/hw_drawlistadd.cpp @@ -20,19 +20,12 @@ //-------------------------------------------------------------------------- // -#include "gl_load/gl_system.h" -#include "p_local.h" -#include "p_lnspec.h" -#include "a_sharedglobal.h" -#include "g_levellocals.h" -#include "actorinlines.h" #include "hwrenderer/dynlights/hw_dynlightdata.h" - -#include "gl_load/gl_interface.h" #include "hwrenderer/utility/hw_cvars.h" -#include "gl/renderer/gl_renderer.h" #include "hwrenderer/dynlights/hw_lightbuffer.h" -#include "gl/scene/gl_drawinfo.h" +#include "hwrenderer/scene/hw_drawstructs.h" +#include "hwrenderer/scene/hw_drawinfo.h" +#include "hwrenderer/textures/hw_material.h" EXTERN_CVAR(Bool, gl_seamless) @@ -42,7 +35,7 @@ EXTERN_CVAR(Bool, gl_seamless) // //========================================================================== -void FDrawInfo::AddWall(GLWall *wall) +void HWDrawInfo::AddWall(GLWall *wall) { if (wall->flags & GLWall::GLWF_TRANSLUCENT) { @@ -73,7 +66,7 @@ void FDrawInfo::AddWall(GLWall *wall) // //========================================================================== -void FDrawInfo::AddMirrorSurface(GLWall *w) +void HWDrawInfo::AddMirrorSurface(GLWall *w) { w->type = RENDERWALL_MIRRORSURFACE; auto newwall = drawlists[GLDL_TRANSLUCENTBORDER].NewWall(); @@ -99,7 +92,7 @@ void FDrawInfo::AddMirrorSurface(GLWall *w) // //========================================================================== -void FDrawInfo::AddFlat(GLFlat *flat, bool fog) +void HWDrawInfo::AddFlat(GLFlat *flat, bool fog) { int list; @@ -138,7 +131,7 @@ void FDrawInfo::AddFlat(GLFlat *flat, bool fog) // // //========================================================================== -void FDrawInfo::AddSprite(GLSprite *sprite, bool translucent) +void HWDrawInfo::AddSprite(GLSprite *sprite, bool translucent) { int list; // [BB] Allow models to be drawn in the GLDL_TRANSLUCENT pass.