Portal and high update count fixes

This commit is contained in:
Magnus Norddahl 2025-05-12 00:39:41 +02:00
commit 2c069349a3
9 changed files with 51 additions and 23 deletions

View file

@ -77,15 +77,17 @@ ADD_STAT(lightmap)
int indexBufferUsed = levelMesh->FreeLists.Index.GetUsedSize();
out.Format(
"Surfaces: %u (awaiting updates: %u)\n"
"Surface pixel area to update: %u\n"
"Surface pixel area: %u\nAtlas pixel area: %u\n"
"Tiles updated this frame: %d\n"
"Tiles: %u (%u out of date)\n"
"Tile pixel area to update: %u\n"
"Tile pixel area: %u\nAtlas pixel area: %u\n"
"Atlas efficiency: %.4f%%\n"
"Dynamic BLAS time: %2.3f ms\n"
"Level mesh process time: %2.3f ms\n"
"Level mesh index buffer: %d K used (%d%%)\n"
"Lightmap tiles in use: %d\n"
"Lightmap texture count: %d",
screen->FrameTileUpdates,
stats.tiles.total, stats.tiles.dirty,
stats.pixels.dirty,
stats.pixels.total,

View file

@ -139,11 +139,13 @@ void HWDrawInfo::StartScene(FRenderViewpoint &parentvp, HWViewpointUniforms *uni
for (int i = 0; i < GLDL_TYPES; i++) drawlists[i].Reset();
hudsprites.Clear();
Fogballs.Clear();
VisibleTiles.Clear();
vpIndex = 0;
static int counter = 1;
TileSeenCounter = ++counter;
if (!outer)
{
static int counter = 1;
TileSeenCounter = ++counter;
}
// Fullbright information needs to be propagated from the main view.
if (outer != nullptr) FullbrightFlags = outer->FullbrightFlags;
@ -717,7 +719,7 @@ void HWDrawInfo::PutWallPortal(HWWall wall, FRenderState& state)
void HWDrawInfo::UpdateLightmaps()
{
if (outer)
return;
outer->UpdateLightmaps();
/*
if (VisibleTiles.size() > (size_t)lm_max_updates)
VisibleTiles.resize(lm_max_updates);
@ -737,16 +739,9 @@ void HWDrawInfo::UpdateLightmaps()
*/
screen->UpdateLightmaps(VisibleTiles);
VisibleTiles.Clear();
}
//-----------------------------------------------------------------------------
//
// RenderScene
//
// Draws the current draw lists for the non GLSL renderer
//
//-----------------------------------------------------------------------------
void HWDrawInfo::RenderScene(FRenderState &state)
{
const auto &vp = Viewpoint;

View file

@ -241,7 +241,7 @@ public:
}
LightmapTile* tile = &Level->levelMesh->Lightmap.Tiles[tileIndex];
if (tile->LastSeen != TileSeenCounter)
if (tile->NeedsUpdate && tile->LastSeen != TileSeenCounter)
{
tile->LastSeen = TileSeenCounter;
VisibleTiles.Push(tile);

View file

@ -1146,6 +1146,11 @@ void HWWall::DoTexture(HWWallDispatcher *di, FRenderState& state, int _type,seg_
if (di->di)
{
if (seg->sidedef->Index() == 55)
{
type = _type;
}
if (seg->sidedef->LightmapTiles.Size() >= 4 && type >= RENDERWALL_TOP && type <= RENDERWALL_BOTTOM)
{
lightmaptile = seg->sidedef->LightmapTiles[type - RENDERWALL_TOP];