mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use thread_local instead from some static settings (#5955)
thread_local permits to limit variable lifetime to thread duration. Use it on each setting place which uses static to cache variable result only for thread lifetime. This permits to keep the same performance level & reconfigure server from MT gui in those various variables places. Add thread_local to undersampling calculation too.
This commit is contained in:
parent
ff73c7a5da
commit
65819f3b9f
8 changed files with 22 additions and 16 deletions
|
@ -271,7 +271,7 @@ static u16 getSmoothLightCombined(v3s16 p, MeshMakeData *data)
|
|||
|
||||
if (ambient_occlusion > 4)
|
||||
{
|
||||
static const float ao_gamma = rangelim(
|
||||
static thread_local const float ao_gamma = rangelim(
|
||||
g_settings->getFloat("ambient_occlusion_gamma"), 0.25, 4.0);
|
||||
|
||||
// Table of gamma space multiply factors.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue