glsl: pass symbols rather than shader to _mesa_get_main_function_signature()
authorTimothy Arceri <timothy.arceri@collabora.com>
Mon, 27 Jun 2016 06:25:00 +0000 (16:25 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 30 Jun 2016 06:51:25 +0000 (16:51 +1000)
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 <itoral@igalia.com>
src/compiler/glsl/builtin_functions.cpp
src/compiler/glsl/builtin_variables.cpp
src/compiler/glsl/ir.h
src/compiler/glsl/linker.cpp
src/compiler/glsl/lower_vertex_id.cpp

index 018e4064f10fab069028562eb130fabbb1d8f9f6..ae4e8f2c455226251f71785c86f8271b5f43baf7 100644 (file)
@@ -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;
 
index e1a95e3bf8cddc1fb07ff5857e2ab005a7212ca8..a311047dced941e607634db59495ed498ccfba8b 100644 (file)
@@ -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);
index cd17f69c179f85b2fe99c28b94927aa29a7168d2..cd56a2a9f5263f1e044248511c388da9bf649c29 100644 (file)
@@ -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);
index 90d7831cde07d58623130989e7a403599dcbb0ae..411d2feec74d49115e6d6776e8f6a1f800ed9bfe 100644 (file)
@@ -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.
index 6f46945026c366011a458bff8654a41a6c094625..ee69d94038839a9f046bd70d9b83ba9d6aa87d06 100644 (file)
@@ -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;