summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/builtin_functions.h
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-03-07 18:37:58 +0000
committerLionel Landwerlin <[email protected]>2017-03-09 08:30:36 +0000
commitf81ede469910d80ef000f313e3388d65a6bd0afd (patch)
tree6934ba3bba1f42f80bd9656c33be44c8f9269d6d /src/compiler/glsl/builtin_functions.h
parent071d80bde2a78f464a7f54c3e6c6e42845ef52e4 (diff)
glsl: builtin: always return clones of the builtins
Builtins are created once and allocated using their own private ralloc context. When reparenting IR that includes builtins, we might be steal bits of builtins. This is problematic because these builtins might now be freed when the shader that includes then last is disposed. This might also lead to inconsistent ralloc trees/lists if shaders are created on multiple threads. Rather than including builtins directly into a shader's IR, we should include clones of them in the ralloc context of the shader that requires them. This fixes double free issues we've been seeing when running shader-db on a big multicore (72 threads) server. v2: Also rename _mesa_glsl_find_builtin_function_by_name() to better reflect how this function is used. (Ken) v3: Rename ctx to mem_ctx (Ken) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/builtin_functions.h')
-rw-r--r--src/compiler/glsl/builtin_functions.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/glsl/builtin_functions.h b/src/compiler/glsl/builtin_functions.h
index 7ae211b48aa..14a52b94027 100644
--- a/src/compiler/glsl/builtin_functions.h
+++ b/src/compiler/glsl/builtin_functions.h
@@ -31,8 +31,8 @@ extern ir_function_signature *
_mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state,
const char *name, exec_list *actual_parameters);
-extern ir_function *
-_mesa_glsl_find_builtin_function_by_name(const char *name);
+extern bool
+_mesa_glsl_has_builtin_function(const char *name);
extern gl_shader *
_mesa_glsl_get_builtin_function_shader(void);