mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- removed gl_render_subsectors test CVAR and disabled vertex buffer generation for legacy mode
To reduce the performance impact, legacy mode will now always create flat vertex data on the fly instead of relying on the vertex buffer. This makes the CVAR mostly redundant as on anything more modern rendering per subsector will always be slower.
This commit is contained in:
parent
b612e182b4
commit
044c8a2034
2 changed files with 14 additions and 13 deletions
|
@ -249,7 +249,10 @@ void FFlatVertexBuffer::Unmap()
|
|||
void FFlatVertexBuffer::CreateVBO()
|
||||
{
|
||||
vbo_shadowdata.Resize(mNumReserved);
|
||||
FFlatVertexGenerator::CreateVertices();
|
||||
if (!gl.legacyMode)
|
||||
{
|
||||
FFlatVertexGenerator::CreateVertices();
|
||||
}
|
||||
mCurIndex = mIndex = vbo_shadowdata.Size();
|
||||
Map();
|
||||
memcpy(map, &vbo_shadowdata[0], vbo_shadowdata.Size() * sizeof(FFlatVertex));
|
||||
|
|
|
@ -48,8 +48,6 @@
|
|||
#include "gl/scene/gl_scenedrawer.h"
|
||||
#include "gl/renderer/gl_quaddrawer.h"
|
||||
|
||||
CVAR(Bool, gl_render_subsectors, false, 0)
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Flats
|
||||
|
@ -166,24 +164,24 @@ void FDrawInfo::DrawSubsector(GLFlat *flat, subsector_t * sub)
|
|||
void FDrawInfo::ProcessLights(GLFlat *flat, bool istrans)
|
||||
{
|
||||
flat->dynlightindex = GLRenderer->mLights->GetIndexPtr();
|
||||
|
||||
if (flat->sector->ibocount > 0 && !gl_render_subsectors && !gl_RenderState.GetClipLineShouldBeActive())
|
||||
|
||||
if (flat->sector->ibocount > 0 && !gl_RenderState.GetClipLineShouldBeActive())
|
||||
{
|
||||
SetupSectorLights(flat, GLPASS_LIGHTSONLY, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw the subsectors belonging to this sector
|
||||
// Draw the subsectors belonging to this sector
|
||||
for (int i = 0; i < flat->sector->subsectorcount; i++)
|
||||
{
|
||||
subsector_t * sub = flat->sector->subsectors[i];
|
||||
if (ss_renderflags[sub->Index()] & flat->renderflags || istrans)
|
||||
{
|
||||
SetupSubsectorLights(flat, GLPASS_LIGHTSONLY, sub, nullptr);
|
||||
subsector_t * sub = flat->sector->subsectors[i];
|
||||
if (ss_renderflags[sub->Index()] & flat->renderflags || istrans)
|
||||
{
|
||||
SetupSubsectorLights(flat, GLPASS_LIGHTSONLY, sub, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Draw the subsectors assigned to it due to missing textures
|
||||
if (!(flat->renderflags&SSRF_RENDER3DPLANES))
|
||||
{
|
||||
|
@ -214,7 +212,7 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool
|
|||
if (gl.legacyMode) processlights = false;
|
||||
|
||||
auto vcount = flat->sector->ibocount;
|
||||
if (vcount > 0 && !gl_render_subsectors && !gl_RenderState.GetClipLineShouldBeActive())
|
||||
if (vcount > 0 && !gl_RenderState.GetClipLineShouldBeActive())
|
||||
{
|
||||
if (processlights) SetupSectorLights(flat, GLPASS_ALL, &dli);
|
||||
drawcalls.Clock();
|
||||
|
|
Loading…
Reference in a new issue