glsl: Move builtin_function related prototypes to a separate file
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 14 Oct 2016 18:02:18 +0000 (11:02 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 20 Jan 2017 23:41:23 +0000 (15:41 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
12 files changed:
src/compiler/Makefile.sources
src/compiler/glsl/ast_function.cpp
src/compiler/glsl/ast_to_hir.cpp
src/compiler/glsl/builtin_functions.cpp
src/compiler/glsl/builtin_functions.h [new file with mode: 0644]
src/compiler/glsl/builtin_variables.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/ir.h
src/compiler/glsl/linker.cpp
src/compiler/glsl/lower_blend_equation_advanced.cpp
src/compiler/glsl/lower_vertex_id.cpp
src/compiler/glsl/standalone.cpp

index 063cf50be5b13e6207deb419ee7432f17ddc1070..3e16316669e23107bb8e0d438e8bfcb4109aacdf 100644 (file)
@@ -20,6 +20,7 @@ LIBGLSL_FILES = \
        glsl/blob.c \
        glsl/blob.h \
        glsl/builtin_functions.cpp \
+       glsl/builtin_functions.h \
        glsl/builtin_types.cpp \
        glsl/builtin_variables.cpp \
        glsl/glsl_parser_extras.cpp \
index 2a2c17bd42cd10116df9e8534714359e83f779c0..0665e0c3938223c5d89ce3cbe7c016b0daa53a16 100644 (file)
@@ -27,6 +27,7 @@
 #include "ir.h"
 #include "main/core.h" /* for MIN2 */
 #include "main/shaderobj.h"
+#include "builtin_functions.h"
 
 static ir_rvalue *
 convert_component(ir_rvalue *src, const glsl_type *desired_type);
index 0cd552eb490c46040a57db004374b91e9092cc34..b31b61d1ed690112e8df5c0528120e38c9434dea 100644 (file)
@@ -58,6 +58,7 @@
 #include "main/shaderobj.h"
 #include "ir.h"
 #include "ir_builder.h"
+#include "builtin_functions.h"
 
 using namespace ir_builder;
 
index 0749ba1d448f52eb4ffff427cf3d77f698619f7f..307cc58a6ea3a92d9cb803b73365faf2b34eaf58 100644 (file)
@@ -61,6 +61,7 @@
 #include "glsl_parser_extras.h"
 #include "program/prog_instruction.h"
 #include <math.h>
+#include "builtin_functions.h"
 
 #define M_PIf   ((float) M_PI)
 #define M_PI_2f ((float) M_PI_2)
diff --git a/src/compiler/glsl/builtin_functions.h b/src/compiler/glsl/builtin_functions.h
new file mode 100644 (file)
index 0000000..747b4fb
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef BULITIN_FUNCTIONS_H
+#define BULITIN_FUNCTIONS_H
+
+extern void
+_mesa_glsl_initialize_builtin_functions();
+
+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 gl_shader *
+_mesa_glsl_get_builtin_function_shader(void);
+
+extern ir_function_signature *
+_mesa_get_main_function_signature(glsl_symbol_table *symbols);
+
+extern void
+_mesa_glsl_release_builtin_functions(void);
+
+#endif /* BULITIN_FUNCTIONS_H */
index d6dac6d7de5696eacc70492fbdf1d6ec8865c0fe..4eb275e9a6de6f395b2203713b811a3acf267105 100644 (file)
@@ -30,6 +30,7 @@
 #include "main/uniforms.h"
 #include "program/prog_statevars.h"
 #include "program/prog_instruction.h"
+#include "builtin_functions.h"
 
 using namespace ir_builder;
 
index f542ce7f8ba34482313d418b8b9fff08a5c555d9..e888090f209b80010a897ade42daeb8c753c3f92 100644 (file)
@@ -37,6 +37,7 @@
 #include "glsl_parser.h"
 #include "ir_optimization.h"
 #include "loop_analysis.h"
+#include "builtin_functions.h"
 
 /**
  * Format a short human-readable description of the given GLSL version.
index afcbe295c395782b91206eda48faa33309274d69..4317c54d4986f0d15c08226f3668f30395402ff0 100644 (file)
@@ -2383,25 +2383,6 @@ extern void
 _mesa_glsl_initialize_derived_variables(struct gl_context *ctx,
                                         gl_shader *shader);
 
-extern void
-_mesa_glsl_initialize_builtin_functions();
-
-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 gl_shader *
-_mesa_glsl_get_builtin_function_shader(void);
-
-extern ir_function_signature *
-_mesa_get_main_function_signature(glsl_symbol_table *symbols);
-
-extern void
-_mesa_glsl_release_builtin_functions(void);
-
 extern void
 reparent_ir(exec_list *list, void *mem_ctx);
 
index 61dfa55681055f733944c6f6b4c11bacdafaa2df..fb26be489509a77b5d213c431a15731c42b3528a 100644 (file)
@@ -80,6 +80,7 @@
 #include "ir_optimization.h"
 #include "ir_rvalue_visitor.h"
 #include "ir_uniform.h"
+#include "builtin_functions.h"
 
 #include "main/shaderobj.h"
 #include "main/enums.h"
index 4f9cd8387ffb92a11e9fd2e812fbec3e352280cb..c6db58142cd76847752e485ca4aaca4d7b089443 100644 (file)
@@ -28,6 +28,7 @@
 #include "program/prog_instruction.h"
 #include "program/prog_statevars.h"
 #include "util/bitscan.h"
+#include "builtin_functions.h"
 
 using namespace ir_builder;
 
index 412b97e527bf3bb738b8ca8d8d624ddd28ca9c20..6b41fee055a16c6582084cf3fea497b80dae9288 100644 (file)
@@ -37,6 +37,7 @@
 #include "ir_builder.h"
 #include "linker.h"
 #include "program/prog_statevars.h"
+#include "builtin_functions.h"
 
 namespace {
 
index 9a8d75d28639021b00f0c30d5b161effe89a315b..44f2c0f36b116cd96b6d27e0ccb7acf781146cc3 100644 (file)
@@ -41,6 +41,7 @@
 #include "linker.h"
 #include "glsl_parser_extras.h"
 #include "ir_builder_print_visitor.h"
+#include "builtin_functions.h"
 #include "opt_add_neg_to_sub.h"
 
 class dead_variable_visitor : public ir_hierarchical_visitor {