aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-11-21 18:04:21 -0800
committerMatt Turner <[email protected]>2014-12-01 11:32:48 -0800
commit9db278d0e2b3bf35b28f00ab7ec3392443aae6b3 (patch)
tree1b3eb4b315e25370d54297dcec91e300d4d84802 /src/glsl/glsl_parser_extras.cpp
parenta5299e9e1ca45f7bcf72347dc0fd47986d779769 (diff)
glsl: Initialize static temporaries_allocate_names once per process.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.cpp')
-rw-r--r--src/glsl/glsl_parser_extras.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 27e3301e209..5772d1389e1 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -29,6 +29,7 @@ extern "C" {
#include "main/core.h" /* for struct gl_context */
#include "main/context.h"
#include "main/shaderobj.h"
+#include "util/u_atomic.h" /* for p_atomic_cmpxchg */
}
#include "util/ralloc.h"
@@ -1447,7 +1448,8 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
const char *source = shader->Source;
if (ctx->Const.GenerateTemporaryNames)
- ir_variable::temporaries_allocate_names = true;
+ (void) p_atomic_cmpxchg(&ir_variable::temporaries_allocate_names,
+ false, true);
state->error = glcpp_preprocess(state, &source, &state->info_log,
&ctx->Extensions, ctx);