Skip to content

Commit

Permalink
disable r_particles_multithreaded on platforms missing library support
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 committed Sep 23, 2023
1 parent b37dc0b commit 2b94414
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/playsim/p_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
** more useful.
*/

#include <execution>
#if __has_include(<execution>)

#include <execution>

#endif

#include "doomtype.h"
#include "doomstat.h"
Expand All @@ -58,7 +62,12 @@ CVAR (Bool, r_rail_smartspiral, false, CVAR_ARCHIVE);
CVAR (Int, r_rail_spiralsparsity, 1, CVAR_ARCHIVE);
CVAR (Int, r_rail_trailsparsity, 1, CVAR_ARCHIVE);
CVAR (Bool, r_particles, true, 0);
CVAR (Bool, r_particles_multithreaded, true, CVAR_ARCHIVE);

#if __has_include(<execution>)

CVAR (Bool, r_particles_multithreaded, true, CVAR_ARCHIVE);

#endif
EXTERN_CVAR(Int, r_maxparticles);

FRandom pr_railtrail("RailTrail");
Expand Down Expand Up @@ -280,6 +289,7 @@ void P_ThinkParticles (FLevelLocals *Level)
{
uint64_t startNs = I_nsTime();
std::deque<particle_t>::iterator newEnd;
#if __has_include(<execution>)
if(r_particles_multithreaded)
{
newEnd = std::remove_if(std::execution::par_unseq, Level->Particles.begin(), Level->Particles.end(), [Level](particle_t &p)
Expand All @@ -288,6 +298,7 @@ void P_ThinkParticles (FLevelLocals *Level)
});
}
else
#endif
{
newEnd = std::remove_if(Level->Particles.begin(), Level->Particles.end(), [Level](particle_t &p)
{
Expand Down

0 comments on commit 2b94414

Please sign in to comment.