From 016a6dcd84be77e284f34f3d8f5a4fb06c936097 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 10 Apr 2018 15:42:42 -0700 Subject: [PATCH] use ref for HDR_FORMAT to avoid static order --- libraries/image/src/image/Image.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/image/src/image/Image.cpp b/libraries/image/src/image/Image.cpp index 696e311495..584b1f421d 100644 --- a/libraries/image/src/image/Image.cpp +++ b/libraries/image/src/image/Image.cpp @@ -37,7 +37,9 @@ bool DEV_DECIMATE_TEXTURES = false; std::atomic DECIMATED_TEXTURE_COUNT{ 0 }; std::atomic RECTIFIED_TEXTURE_COUNT{ 0 }; -static const auto HDR_FORMAT = gpu::Element::COLOR_R11G11B10; +// we use a ref here to work around static order initialization +// possibly causing the element not to be constructed yet +static const auto& HDR_FORMAT = gpu::Element::COLOR_R11G11B10; static std::atomic compressColorTextures { false }; static std::atomic compressNormalTextures { false };