- added missing memory barrier

This commit is contained in:
Magnus Norddahl 2017-03-16 17:58:41 +01:00
parent f1b03b48e9
commit dbea29e02c

View file

@ -55,6 +55,7 @@
#include "templates.h" #include "templates.h"
#include "r_utility.h" #include "r_utility.h"
#include "r_renderer.h" #include "r_renderer.h"
#include <atomic>
FDynamicColormap NormalLight; FDynamicColormap NormalLight;
FDynamicColormap FullNormalLight; //[SP] Emulate GZDoom brightness FDynamicColormap FullNormalLight; //[SP] Emulate GZDoom brightness
@ -95,10 +96,13 @@ static FDynamicColormap *CreateSpecialLights (PalEntry color, PalEntry fade, int
colormap->Color = color; colormap->Color = color;
colormap->Fade = fade; colormap->Fade = fade;
colormap->Desaturate = desaturate; colormap->Desaturate = desaturate;
NormalLight.Next = colormap;
colormap->Maps = new uint8_t[NUMCOLORMAPS*256]; colormap->Maps = new uint8_t[NUMCOLORMAPS*256];
colormap->BuildLights (); colormap->BuildLights ();
// Make sure colormap is fully built before making it publicly visible
std::atomic_thread_fence(std::memory_order_release);
NormalLight.Next = colormap;
return colormap; return colormap;
} }