summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-06-27 16:25:00 +1000
committerTimothy Arceri <[email protected]>2016-06-30 16:51:25 +1000
commit47f83817303e0f24f2d410450f897945a5746ef2 (patch)
treee8dd06b8d0574f5c8851d470dab44929a69607f1 /src
parent9e9d01cbe802df386586db3fde1a531151b6d66a (diff)
glsl: pass symbols rather than shader to _mesa_get_main_function_signature()
This will allow us to split gl_shader into two different structs, one for shader objects and one for linked shaders. Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/builtin_functions.cpp4
-rw-r--r--src/compiler/glsl/builtin_variables.cpp2
-rw-r--r--src/compiler/glsl/ir.h2
-rw-r--r--src/compiler/glsl/linker.cpp4
-rw-r--r--src/compiler/glsl/lower_vertex_id.cpp2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 018e4064f10..ae4e8f2c455 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -5658,9 +5658,9 @@ _mesa_glsl_get_builtin_function_shader()
* Get the function signature for main from a shader
*/
ir_function_signature *
-_mesa_get_main_function_signature(gl_shader *sh)
+_mesa_get_main_function_signature(glsl_symbol_table *symbols)
{
- ir_function *const f = sh->symbols->get_function("main");
+ ir_function *const f = symbols->get_function("main");
if (f != NULL) {
exec_list void_parameters;
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index e1a95e3bf8c..a311047dced 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1456,7 +1456,7 @@ _mesa_glsl_initialize_derived_variables(struct gl_context *ctx,
if (shader->Stage == MESA_SHADER_COMPUTE &&
ctx->Const.LowerCsDerivedVariables) {
ir_function_signature *const main_sig =
- _mesa_get_main_function_signature(shader);
+ _mesa_get_main_function_signature(shader->symbols);
if (main_sig != NULL)
initialize_cs_derived_variables(shader, main_sig);
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index cd17f69c179..cd56a2a9f52 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -2593,7 +2593,7 @@ extern gl_shader *
_mesa_glsl_get_builtin_function_shader(void);
extern ir_function_signature *
-_mesa_get_main_function_signature(gl_shader *sh);
+_mesa_get_main_function_signature(glsl_symbol_table *symbols);
extern void
_mesa_glsl_release_functions(void);
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 90d7831cde0..411d2feec74 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -2216,7 +2216,7 @@ link_intrastage_shaders(void *mem_ctx,
*/
gl_shader *main = NULL;
for (unsigned i = 0; i < num_shaders; i++) {
- if (_mesa_get_main_function_signature(shader_list[i]) != NULL) {
+ if (!_mesa_get_main_function_signature(shader_list[i]->symbols)) {
main = shader_list[i];
break;
}
@@ -2246,7 +2246,7 @@ link_intrastage_shaders(void *mem_ctx,
* copy of the original shader that contained the main function).
*/
ir_function_signature *const main_sig =
- _mesa_get_main_function_signature(linked);
+ _mesa_get_main_function_signature(linked->symbols);
/* Move any instructions other than variable declarations or function
* declarations into main.
diff --git a/src/compiler/glsl/lower_vertex_id.cpp b/src/compiler/glsl/lower_vertex_id.cpp
index 6f46945026c..ee69d940388 100644
--- a/src/compiler/glsl/lower_vertex_id.cpp
+++ b/src/compiler/glsl/lower_vertex_id.cpp
@@ -130,7 +130,7 @@ lower_vertex_id(gl_shader *shader)
return false;
ir_function_signature *const main_sig =
- _mesa_get_main_function_signature(shader);
+ _mesa_get_main_function_signature(shader->symbols);
if (main_sig == NULL) {
assert(main_sig != NULL);
return false;