summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2018-09-06 11:12:24 -0700
committerMatt Turner <[email protected]>2019-01-09 16:42:40 -0800
commitdde73e646fe22e50878783580d1707a2acceb054 (patch)
tree9ce2f4b77b3bc847f98c3eda585020dda212c1be /src/compiler/glsl
parent393b59e0772e7bf0426bdf61c740752c4e09dde1 (diff)
nir: Tag entrypoint for easy recognition by nir_shader_get_entrypoint()
We're going to have multiple functions, so nir_shader_get_entrypoint() needs to do something a little smarter. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 3e198e0cbef..fac9a6a0f50 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -478,6 +478,8 @@ nir_visitor::create_function(ir_function_signature *ir)
return;
nir_function *func = nir_function_create(shader, ir->function_name());
+ if (strcmp(ir->function_name(), "main") == 0)
+ func->is_entrypoint = true;
func->num_params = ir->parameters.length() +
(ir->return_type != glsl_type::void_type);