glsl: Move builtin_function related prototypes to a separate file

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Ian Romanick
2016-10-14 11:02:18 -07:00
parent 8358e58f25
commit aa38bf1e59
12 changed files with 56 additions and 19 deletions

View 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 \

View 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);

View File

@@ -58,6 +58,7 @@
#include "main/shaderobj.h"
#include "ir.h"
#include "ir_builder.h"
#include "builtin_functions.h"
using namespace ir_builder;

View 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)

View File

@@ -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 */

View 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;

View 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.

View 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);

View 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"

View 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;

View File

@@ -37,6 +37,7 @@
#include "ir_builder.h"
#include "linker.h"
#include "program/prog_statevars.h"
#include "builtin_functions.h"
namespace {

View 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 {