Fix crash for uneven core count and clock the draw times
This commit is contained in:
parent
c7a5914609
commit
00e200559a
2 changed files with 7 additions and 5 deletions
|
|
@ -453,15 +453,13 @@ void HWDrawInfo::RenderPVS(bool drawpsprites, FRenderState& state)
|
|||
multithread = false;
|
||||
uselevelmesh = true;
|
||||
|
||||
ClipWall.Clock();
|
||||
Bsp.Clock();
|
||||
|
||||
ClipWall.Clock();
|
||||
static HWVisibleSetThreads threads;
|
||||
threads.FindPVS(this);
|
||||
|
||||
ClipWall.Unclock();
|
||||
|
||||
Bsp.Clock();
|
||||
|
||||
if (!gl_levelmesh) // Update sector heights for the non-levelmesh rendering of sectors
|
||||
{
|
||||
for (int sectorIndex : SeenSectors.Get())
|
||||
|
|
@ -830,14 +828,18 @@ void HWDrawInfo::RenderScene(FRenderState &state)
|
|||
|
||||
void HWDrawInfo::DrawSeenSides(FRenderState& state, LevelMeshDrawType drawType, bool noFragmentShader)
|
||||
{
|
||||
RenderWall.Clock();
|
||||
for (int sideIndex : SeenSides.Get())
|
||||
level.levelMesh->DrawSide(state, sideIndex, drawType, noFragmentShader);
|
||||
RenderWall.Unclock();
|
||||
}
|
||||
|
||||
void HWDrawInfo::DrawSeenFlats(FRenderState& state, LevelMeshDrawType drawType, bool noFragmentShader)
|
||||
{
|
||||
RenderFlat.Clock();
|
||||
for (int sectorIndex : SeenSectors.Get())
|
||||
level.levelMesh->DrawSector(state, sectorIndex, drawType, noFragmentShader);
|
||||
RenderFlat.Unclock();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ void HWVisibleSetThreads::WorkerMain(int sliceIndex)
|
|||
bool isLeft = sliceIndex % 2 == 0;
|
||||
int left = isLeft ? sliceIndex : sliceIndex - 1;
|
||||
int right = isLeft ? sliceIndex + 1 : sliceIndex;
|
||||
if ((isLeft && !WorkFlags[right]) || (!isLeft && !WorkFlags[left]))
|
||||
if (right < SliceCount && ((isLeft && !WorkFlags[right]) || (!isLeft && !WorkFlags[left])))
|
||||
{
|
||||
// Other side is also done. Merge results.
|
||||
lock.unlock();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue