[Mesa-dev] [PATCH] Revert "glsl: Mark functions static"
Timothy Arceri
tarceri at itsqueeze.com
Tue Aug 22 01:48:30 UTC 2017
This reverts commit ca73c3358c91434e68ab31c23d13986d87c661cd.
This commit broke 'make check' revert it for now.
---
src/compiler/glsl/ast_function.cpp | 10 +++++-----
src/compiler/glsl/ast_to_hir.cpp | 6 +++---
src/compiler/glsl/glsl_parser_extras.cpp | 2 +-
src/compiler/glsl/ir_validate.cpp | 2 +-
src/compiler/glsl/link_uniform_initializers.cpp | 10 +++++-----
src/compiler/glsl/link_varyings.cpp | 8 ++++----
src/compiler/glsl/linker.cpp | 20 ++++++++++----------
src/compiler/glsl/lower_if_to_cond_assign.cpp | 4 ++--
src/compiler/glsl/lower_vector.cpp | 2 +-
src/compiler/glsl/main.cpp | 2 +-
src/compiler/glsl/standalone.cpp | 6 +++---
11 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
index d528eccf31..b121ab9210 100644
--- a/src/compiler/glsl/ast_function.cpp
+++ b/src/compiler/glsl/ast_function.cpp
@@ -1270,42 +1270,42 @@ process_array_constructor(exec_list *instructions,
i++;
}
return new(ctx) ir_dereference_variable(var);
}
/**
* Determine if a list consists of a single scalar r-value
*/
-static bool
+bool
single_scalar_parameter(exec_list *parameters)
{
const ir_rvalue *const p = (ir_rvalue *) parameters->get_head_raw();
assert(((ir_rvalue *)p)->as_rvalue() != NULL);
return (p->type->is_scalar() && p->next->is_tail_sentinel());
}
/**
* Generate inline code for a vector constructor
*
* The generated constructor code will consist of a temporary variable
* declaration of the same type as the constructor. A sequence of assignments
* from constructor parameters to the temporary will follow.
*
* \return
* An \c ir_dereference_variable of the temprorary generated in the constructor
* body.
*/
-static ir_rvalue *
+ir_rvalue *
emit_inline_vector_constructor(const glsl_type *type,
exec_list *instructions,
exec_list *parameters,
void *ctx)
{
assert(!parameters->is_empty());
ir_variable *var = new(ctx) ir_variable(type, "vec_ctor", ir_var_temporary);
instructions->push_tail(var);
@@ -1455,21 +1455,21 @@ emit_inline_vector_constructor(const glsl_type *type,
*
* \param src_base First component of the source to be used in assignment
* \param column Column of destination to be assiged
* \param row_base First component of the destination column to be assigned
* \param count Number of components to be assigned
*
* \note
* \c src_base + \c count must be less than or equal to the number of
* components in the source vector.
*/
-static ir_instruction *
+ir_instruction *
assign_to_matrix_column(ir_variable *var, unsigned column, unsigned row_base,
ir_rvalue *src, unsigned src_base, unsigned count,
void *mem_ctx)
{
ir_constant *col_idx = new(mem_ctx) ir_constant(column);
ir_dereference *column_ref = new(mem_ctx) ir_dereference_array(var,
col_idx);
assert(column_ref->type->components() >= (row_base + count));
assert(src->type->components() >= (src_base + count));
@@ -1495,21 +1495,21 @@ assign_to_matrix_column(ir_variable *var, unsigned column, unsigned row_base,
* Generate inline code for a matrix constructor
*
* The generated constructor code will consist of a temporary variable
* declaration of the same type as the constructor. A sequence of assignments
* from constructor parameters to the temporary will follow.
*
* \return
* An \c ir_dereference_variable of the temprorary generated in the constructor
* body.
*/
-static ir_rvalue *
+ir_rvalue *
emit_inline_matrix_constructor(const glsl_type *type,
exec_list *instructions,
exec_list *parameters,
void *ctx)
{
assert(!parameters->is_empty());
ir_variable *var = new(ctx) ir_variable(type, "mat_ctor", ir_var_temporary);
instructions->push_tail(var);
@@ -1764,21 +1764,21 @@ emit_inline_matrix_constructor(const glsl_type *type,
col_idx++;
}
} while(remaining_slots > 0 && rhs_base < rhs_components);
}
}
return new(ctx) ir_dereference_variable(var);
}
-static ir_rvalue *
+ir_rvalue *
emit_inline_record_constructor(const glsl_type *type,
exec_list *instructions,
exec_list *parameters,
void *mem_ctx)
{
ir_variable *const var =
new(mem_ctx) ir_variable(type, "record_ctor", ir_var_temporary);
ir_dereference_variable *const d =
new(mem_ctx) ir_dereference_variable(var);
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 98d2f94e12..f0a96c3e1e 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -1175,21 +1175,21 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1)
if (cmp == NULL)
cmp = new(mem_ctx) ir_constant(true);
return cmp;
}
/* For logical operations, we want to ensure that the operands are
* scalar booleans. If it isn't, emit an error and return a constant
* boolean to avoid triggering cascading error messages.
*/
-static ir_rvalue *
+ir_rvalue *
get_scalar_boolean_operand(exec_list *instructions,
struct _mesa_glsl_parse_state *state,
ast_expression *parent_expr,
int operand,
const char *operand_name,
bool *error_emitted)
{
ast_expression *expr = parent_expr->subexpressions[operand];
void *ctx = state;
ir_rvalue *val = expr->hir(instructions, state);
@@ -4315,21 +4315,21 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc,
} else {
_mesa_glsl_error(&loc, state, "`%s' redeclared", var->name);
}
return earlier;
}
/**
* Generate the IR for an initializer in a variable declaration
*/
-static ir_rvalue *
+ir_rvalue *
process_initializer(ir_variable *var, ast_declaration *decl,
ast_fully_specified_type *type,
exec_list *initializer_instructions,
struct _mesa_glsl_parse_state *state)
{
void *mem_ctx = state;
ir_rvalue *result = NULL;
YYLTYPE initializer_loc = decl->initializer->get_location();
@@ -4712,21 +4712,21 @@ handle_geometry_shader_input_decl(struct _mesa_glsl_parse_state *state,
/* To avoid cascading failures, short circuit the checks below. */
return;
}
validate_layout_qualifier_vertex_count(state, loc, var, num_vertices,
&state->gs_input_size,
"geometry shader input");
}
-static void
+void
validate_identifier(const char *identifier, YYLTYPE loc,
struct _mesa_glsl_parse_state *state)
{
/* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec,
*
* "Identifiers starting with "gl_" are reserved for use by
* OpenGL, and may not be declared in a shader as either a
* variable or a function."
*/
if (is_gl_identifier(identifier)) {
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index cfb214e440..8f1651d494 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1072,21 +1072,21 @@ _mesa_ast_process_interface_block(YYLTYPE *locp,
}
if (!(q.flags.q.in || q.flags.q.out) && qualifier.flags.q.invariant)
_mesa_glsl_error(locp, state,
"invariant qualifiers can be used only "
"in interface block members for shader "
"inputs or outputs");
}
}
-static void
+void
_mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q)
{
if (q->is_subroutine_decl())
printf("subroutine ");
if (q->subroutine_list) {
printf("subroutine (");
q->subroutine_list->print();
printf(")");
}
diff --git a/src/compiler/glsl/ir_validate.cpp b/src/compiler/glsl/ir_validate.cpp
index becce771be..397cd080b1 100644
--- a/src/compiler/glsl/ir_validate.cpp
+++ b/src/compiler/glsl/ir_validate.cpp
@@ -1036,21 +1036,21 @@ ir_validate::validate_ir(ir_instruction *ir, void *data)
if (_mesa_set_search(ir_set, ir)) {
printf("Instruction node present twice in ir tree:\n");
ir->print();
printf("\n");
abort();
}
_mesa_set_add(ir_set, ir);
}
-static void
+void
check_node_type(ir_instruction *ir, void *data)
{
(void) data;
if (ir->ir_type >= ir_type_max) {
printf("Instruction node with unset type\n");
ir->print(); printf("\n");
}
ir_rvalue *value = ir->as_rvalue();
if (value != NULL)
diff --git a/src/compiler/glsl/link_uniform_initializers.cpp b/src/compiler/glsl/link_uniform_initializers.cpp
index 24b9ba5748..e7f9c9d8ac 100644
--- a/src/compiler/glsl/link_uniform_initializers.cpp
+++ b/src/compiler/glsl/link_uniform_initializers.cpp
@@ -26,32 +26,32 @@
#include "linker.h"
#include "ir_uniform.h"
#include "util/string_to_uint_map.h"
/* These functions are put in a "private" namespace instead of being marked
* static so that the unit tests can access them. See
* http://code.google.com/p/googletest/wiki/AdvancedGuide#Testing_Private_Code
*/
namespace linker {
-static gl_uniform_storage *
+gl_uniform_storage *
get_storage(struct gl_shader_program *prog, const char *name)
{
unsigned id;
if (prog->UniformHash->get(id, name))
return &prog->data->UniformStorage[id];
assert(!"No uniform storage found!");
return NULL;
}
-static void
+void
copy_constant_to_storage(union gl_constant_value *storage,
const ir_constant *val,
const enum glsl_base_type base_type,
const unsigned int elements,
unsigned int boolean_true)
{
for (unsigned int i = 0; i < elements; i++) {
switch (base_type) {
case GLSL_TYPE_UINT:
storage[i].u = val->value.u[i];
@@ -88,21 +88,21 @@ copy_constant_to_storage(union gl_constant_value *storage,
break;
}
}
}
/**
* Initialize an opaque uniform from the value of an explicit binding
* qualifier specified in the shader. Atomic counters are different because
* they have no storage and should be handled elsewhere.
*/
-static void
+void
set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
const ir_variable *var, const glsl_type *type,
const char *name, int *binding)
{
if (type->is_array() && type->fields.array->is_array()) {
const glsl_type *const element_type = type->fields.array;
for (unsigned int i = 0; i < type->length; i++) {
const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
@@ -172,41 +172,41 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
break;
shader->Program->sh.ImageUnits[index] =
storage->storage[i].i;
}
}
}
}
}
}
-static void
+void
set_block_binding(gl_shader_program *prog, const char *block_name,
unsigned mode, int binding)
{
unsigned num_blocks = mode == ir_var_uniform ?
prog->data->NumUniformBlocks :
prog->data->NumShaderStorageBlocks;
struct gl_uniform_block *blks = mode == ir_var_uniform ?
prog->data->UniformBlocks : prog->data->ShaderStorageBlocks;
for (unsigned i = 0; i < num_blocks; i++) {
if (!strcmp(blks[i].Name, block_name)) {
blks[i].Binding = binding;
return;
}
}
unreachable("Failed to initialize block binding");
}
-static void
+void
set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
const char *name, const glsl_type *type,
ir_constant *val, unsigned int boolean_true)
{
const glsl_type *t_without_array = type->without_array();
if (type->is_record()) {
ir_constant *field_constant;
field_constant = (ir_constant *)val->components.get_head();
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index a6a76ae531..fa99b4b4f3 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1886,21 +1886,21 @@ private:
* Total number of varying floats that have been visited so far. This is
* used to determine the offset to each varying within the toplevel
* variable.
*/
unsigned varying_floats;
};
namespace linker {
-static void
+void
populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
hash_table *consumer_inputs,
hash_table *consumer_interface_inputs,
ir_variable *consumer_inputs_with_locations[VARYING_SLOT_TESS_MAX])
{
memset(consumer_inputs_with_locations,
0,
sizeof(consumer_inputs_with_locations[0]) * VARYING_SLOT_TESS_MAX);
foreach_in_list(ir_instruction, node, ir) {
@@ -1944,21 +1944,21 @@ populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
}
}
}
/**
* Find a variable from the consumer that "matches" the specified variable
*
* This function only finds inputs with names that match. There is no
* validation (here) that the types, etc. are compatible.
*/
-static ir_variable *
+ir_variable *
get_matching_input(void *mem_ctx,
const ir_variable *output_var,
hash_table *consumer_inputs,
hash_table *consumer_interface_inputs,
ir_variable *consumer_inputs_with_locations[VARYING_SLOT_TESS_MAX])
{
ir_variable *input_var;
if (output_var->data.explicit_location) {
input_var = consumer_inputs_with_locations[output_var->data.location];
@@ -2342,21 +2342,21 @@ assign_varying_locations(struct gl_context *ctx,
if (consumer) {
lower_packed_varyings(mem_ctx, slots_used, components, ir_var_shader_in,
consumer_vertices, consumer,
disable_varying_packing, xfb_enabled);
}
return true;
}
-static bool
+bool
check_against_output_limit(struct gl_context *ctx,
struct gl_shader_program *prog,
gl_linked_shader *producer,
unsigned num_explicit_locations)
{
unsigned output_vectors = num_explicit_locations;
foreach_in_list(ir_instruction, node, producer->ir) {
ir_variable *const var = node->as_variable();
@@ -2386,21 +2386,21 @@ check_against_output_limit(struct gl_context *ctx,
_mesa_shader_stage_to_string(producer->Stage),
output_components,
max_output_components);
return false;
}
return true;
}
-static bool
+bool
check_against_input_limit(struct gl_context *ctx,
struct gl_shader_program *prog,
gl_linked_shader *consumer,
unsigned num_explicit_locations)
{
unsigned input_vectors = num_explicit_locations;
foreach_in_list(ir_instruction, node, consumer->ir) {
ir_variable *const var = node->as_variable();
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 131518b15f..fa0afe6c16 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -668,21 +668,21 @@ analyze_clip_cull_usage(struct gl_shader_program *prog,
/**
* Verify that a vertex shader executable meets all semantic requirements.
*
* Also sets info.clip_distance_array_size and
* info.cull_distance_array_size as a side effect.
*
* \param shader Vertex shader executable to be verified
*/
-static void
+void
validate_vertex_shader_executable(struct gl_shader_program *prog,
struct gl_linked_shader *shader,
struct gl_context *ctx)
{
if (shader == NULL)
return;
/* From the GLSL 1.10 spec, page 48:
*
* "The variable gl_Position is available only in the vertex
@@ -723,40 +723,40 @@ validate_vertex_shader_executable(struct gl_shader_program *prog,
}
return;
}
}
analyze_clip_cull_usage(prog, shader, ctx,
&shader->Program->info.clip_distance_array_size,
&shader->Program->info.cull_distance_array_size);
}
-static void
+void
validate_tess_eval_shader_executable(struct gl_shader_program *prog,
struct gl_linked_shader *shader,
struct gl_context *ctx)
{
if (shader == NULL)
return;
analyze_clip_cull_usage(prog, shader, ctx,
&shader->Program->info.clip_distance_array_size,
&shader->Program->info.cull_distance_array_size);
}
/**
* Verify that a fragment shader executable meets all semantic requirements
*
* \param shader Fragment shader executable to be verified
*/
-static void
+void
validate_fragment_shader_executable(struct gl_shader_program *prog,
struct gl_linked_shader *shader)
{
if (shader == NULL)
return;
find_variable gl_FragColor("gl_FragColor");
find_variable gl_FragData("gl_FragData");
find_variable * const variables[] = { &gl_FragColor, &gl_FragData, NULL };
find_assignments(shader->ir, variables);
@@ -768,21 +768,21 @@ validate_fragment_shader_executable(struct gl_shader_program *prog,
}
/**
* Verify that a geometry shader executable meets all semantic requirements
*
* Also sets prog->Geom.VerticesIn, and info.clip_distance_array_sizeand
* info.cull_distance_array_size as a side effect.
*
* \param shader Geometry shader executable to be verified
*/
-static void
+void
validate_geometry_shader_executable(struct gl_shader_program *prog,
struct gl_linked_shader *shader,
struct gl_context *ctx)
{
if (shader == NULL)
return;
unsigned num_vertices =
vertices_per_prim(shader->Program->info.gs.input_primitive);
prog->Geom.VerticesIn = num_vertices;
@@ -885,21 +885,21 @@ validate_intrastage_arrays(struct gl_shader_program *prog,
}
}
}
return false;
}
/**
* Perform validation of global variables used across multiple shaders
*/
-static void
+void
cross_validate_globals(struct gl_shader_program *prog,
struct exec_list *ir, glsl_symbol_table *variables,
bool uniforms_only)
{
foreach_in_list(ir_instruction, node, ir) {
ir_variable *const var = node->as_variable();
if (var == NULL)
continue;
@@ -1128,21 +1128,21 @@ cross_validate_globals(struct gl_shader_program *prog,
}
} else
variables->add_variable(var);
}
}
/**
* Perform validation of uniforms used across multiple shader stages
*/
-static void
+void
cross_validate_uniforms(struct gl_shader_program *prog)
{
glsl_symbol_table variables;
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
if (prog->_LinkedShaders[i] == NULL)
continue;
cross_validate_globals(prog, prog->_LinkedShaders[i]->ir, &variables,
true);
}
@@ -1285,21 +1285,21 @@ populate_symbol_table(gl_linked_shader *sh)
* If there is no matching variable in the target shader, a clone of the
* \c ir_variable is made and added to the target shader. The new variable is
* added to \b both the instruction stream and the symbol table.
*
* \param inst IR tree that is to be processed.
* \param symbols Symbol table containing global scope symbols in the
* linked shader.
* \param instructions Instruction stream where new variable declarations
* should be added.
*/
-static void
+void
remap_variables(ir_instruction *inst, struct gl_linked_shader *target,
hash_table *temps)
{
class remap_visitor : public ir_hierarchical_visitor {
public:
remap_visitor(struct gl_linked_shader *target, hash_table *temps)
{
this->target = target;
this->symbols = target->symbols;
this->instructions = target->ir;
@@ -1359,21 +1359,21 @@ remap_variables(ir_instruction *inst, struct gl_linked_shader *target,
* inserted in the target instruction stream
* \param make_copies Flag selecting whether instructions in \c instructions
* should be copied (via \c ir_instruction::clone) into the
* target list or moved.
*
* \return
* The new "last" instruction in the target instruction stream. This pointer
* is suitable for use as the \c last parameter of a later call to this
* function.
*/
-static exec_node *
+exec_node *
move_non_declarations(exec_list *instructions, exec_node *last,
bool make_copies, gl_linked_shader *target)
{
hash_table *temps = NULL;
if (make_copies)
temps = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
foreach_in_list_safe(ir_instruction, inst, instructions) {
@@ -2541,21 +2541,21 @@ resize_tes_inputs(struct gl_context *ctx,
/**
* Find a contiguous set of available bits in a bitmask.
*
* \param used_mask Bits representing used (1) and unused (0) locations
* \param needed_count Number of contiguous bits needed.
*
* \return
* Base location of the available bits on success or -1 on failure.
*/
-static int
+int
find_available_slots(unsigned used_mask, unsigned needed_count)
{
unsigned needed_mask = (1 << needed_count) - 1;
const int max_bit_to_test = (8 * sizeof(used_mask)) - needed_count;
/* The comparison to 32 is redundant, but without it GCC emits "warning:
* cannot optimize possibly infinite loops" for the loop below.
*/
if ((needed_count == 0) || (max_bit_to_test < 0) || (max_bit_to_test > 32))
return -1;
@@ -2578,21 +2578,21 @@ find_available_slots(unsigned used_mask, unsigned needed_count)
* \param prog Shader program whose variables need locations assigned
* \param constants Driver specific constant values for the program.
* \param target_index Selector for the program target to receive location
* assignmnets. Must be either \c MESA_SHADER_VERTEX or
* \c MESA_SHADER_FRAGMENT.
*
* \return
* If locations are successfully assigned, true is returned. Otherwise an
* error is emitted to the shader link log and false is returned.
*/
-static bool
+bool
assign_attribute_or_color_locations(void *mem_ctx,
gl_shader_program *prog,
struct gl_constants *constants,
unsigned target_index)
{
/* Maximum number of generic locations. This corresponds to either the
* maximum number of draw buffers or the maximum number of generic
* attributes.
*/
unsigned max_index = (target_index == MESA_SHADER_VERTEX) ?
diff --git a/src/compiler/glsl/lower_if_to_cond_assign.cpp b/src/compiler/glsl/lower_if_to_cond_assign.cpp
index 54bcae75ec..37f1ec8600 100644
--- a/src/compiler/glsl/lower_if_to_cond_assign.cpp
+++ b/src/compiler/glsl/lower_if_to_cond_assign.cpp
@@ -108,21 +108,21 @@ lower_if_to_cond_assign(gl_shader_stage stage, exec_list *instructions,
if (max_depth == UINT_MAX)
return false;
ir_if_to_cond_assign_visitor v(stage, max_depth, min_branch_cost);
visit_list_elements(&v, instructions);
return v.progress;
}
-static void
+void
check_ir_node(ir_instruction *ir, void *data)
{
ir_if_to_cond_assign_visitor *v = (ir_if_to_cond_assign_visitor *)data;
switch (ir->ir_type) {
case ir_type_call:
case ir_type_discard:
case ir_type_loop:
case ir_type_loop_jump:
case ir_type_return:
@@ -161,21 +161,21 @@ check_ir_node(ir_instruction *ir, void *data)
v->then_cost++;
else
v->else_cost++;
break;
default:
break;
}
}
-static void
+void
move_block_to_cond_assign(void *mem_ctx,
ir_if *if_ir, ir_rvalue *cond_expr,
exec_list *instructions,
struct set *set)
{
foreach_in_list_safe(ir_instruction, ir, instructions) {
if (ir->ir_type == ir_type_assignment) {
ir_assignment *assign = (ir_assignment *)ir;
if (_mesa_set_search(set, assign) == NULL) {
diff --git a/src/compiler/glsl/lower_vector.cpp b/src/compiler/glsl/lower_vector.cpp
index 4024644b06..72192b1b25 100644
--- a/src/compiler/glsl/lower_vector.cpp
+++ b/src/compiler/glsl/lower_vector.cpp
@@ -51,21 +51,21 @@ public:
};
} /* anonymous namespace */
/**
* Determine if an IR expression tree looks like an extended swizzle
*
* Extended swizzles consist of access of a single vector source (with possible
* per component negation) and the constants -1, 0, or 1.
*/
-static bool
+bool
is_extended_swizzle(ir_expression *ir)
{
/* Track any variables that are accessed by this expression.
*/
ir_variable *var = NULL;
assert(ir->operation == ir_quadop_vector);
for (unsigned i = 0; i < ir->type->vector_elements; i++) {
ir_rvalue *op = ir->operands[i];
diff --git a/src/compiler/glsl/main.cpp b/src/compiler/glsl/main.cpp
index 123e41f9dc..e0d3ab75d1 100644
--- a/src/compiler/glsl/main.cpp
+++ b/src/compiler/glsl/main.cpp
@@ -45,21 +45,21 @@ const struct option compiler_opts[] = {
{ "dump-builder", no_argument, &options.dump_builder, 1 },
{ "link", no_argument, &options.do_link, 1 },
{ "just-log", no_argument, &options.just_log, 1 },
{ "version", required_argument, NULL, 'v' },
{ NULL, 0, NULL, 0 }
};
/**
* \brief Print proper usage and exit with failure.
*/
-static void
+void
usage_fail(const char *name)
{
const char *header =
"usage: %s [options] <file.vert | file.tesc | file.tese | file.geom | file.frag | file.comp>\n"
"\n"
"Possible options are:\n";
printf(header, name);
for (const struct option *o = compiler_opts; o->name != 0; ++o) {
printf(" --%s\n", o->name);
diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index 7e5c06d205..8e5bc352fc 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -93,29 +93,29 @@ public:
assert(ir->ir_type == ir_type_variable);
ir->remove();
}
}
private:
set *variables;
};
-static void
+void
init_gl_program(struct gl_program *prog, GLenum target, bool is_arb_asm)
{
prog->RefCount = 1;
prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
prog->is_arb_asm = is_arb_asm;
}
-static struct gl_program *
+struct gl_program *
new_program(struct gl_context *ctx, GLenum target, GLuint id, bool is_arb_asm)
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
case GL_GEOMETRY_PROGRAM_NV:
case GL_TESS_CONTROL_PROGRAM_NV:
case GL_TESS_EVALUATION_PROGRAM_NV:
case GL_FRAGMENT_PROGRAM_ARB:
case GL_COMPUTE_PROGRAM_NV: {
struct gl_program *prog = rzalloc(NULL, struct gl_program);
@@ -367,21 +367,21 @@ load_text_file(void *ctx, const char *file_name)
text[total_read] = '\0';
error:;
}
fclose(fp);
return text;
}
-static void
+void
compile_shader(struct gl_context *ctx, struct gl_shader *shader)
{
struct _mesa_glsl_parse_state *state =
new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader);
_mesa_glsl_compile_shader(ctx, shader, options->dump_ast,
options->dump_hir, true);
/* Print out the resulting IR */
if (!state->error && options->dump_lir) {
--
2.13.4
More information about the mesa-dev
mailing list