glsl: remove remaining tabs from ast_to_hir.cpp

Acked-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Timothy Arceri
2016-09-28 16:04:08 +10:00
parent fc1d200bc7
commit 222f66a812

View File

@@ -63,7 +63,7 @@ using namespace ir_builder;
static void static void
detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, detect_conflicting_assignments(struct _mesa_glsl_parse_state *state,
exec_list *instructions); exec_list *instructions);
static void static void
remove_per_vertex_blocks(exec_list *instructions, remove_per_vertex_blocks(exec_list *instructions,
_mesa_glsl_parse_state *state, ir_variable_mode mode); _mesa_glsl_parse_state *state, ir_variable_mode mode);
@@ -883,7 +883,7 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
/* Check for implicit conversion in GLSL 1.20 */ /* Check for implicit conversion in GLSL 1.20 */
if (apply_implicit_conversion(lhs->type, rhs, state)) { if (apply_implicit_conversion(lhs->type, rhs, state)) {
if (rhs->type == lhs->type) if (rhs->type == lhs->type)
return rhs; return rhs;
} }
_mesa_glsl_error(&loc, state, _mesa_glsl_error(&loc, state,
@@ -1029,11 +1029,11 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue)
ir_variable *var; ir_variable *var;
var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp", var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp",
ir_var_temporary); ir_var_temporary);
instructions->push_tail(var); instructions->push_tail(var);
instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var), instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
lvalue)); lvalue));
return new(ctx) ir_dereference_variable(var); return new(ctx) ir_dereference_variable(var);
} }
@@ -1160,11 +1160,11 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1)
*/ */
ir_rvalue * ir_rvalue *
get_scalar_boolean_operand(exec_list *instructions, get_scalar_boolean_operand(exec_list *instructions,
struct _mesa_glsl_parse_state *state, struct _mesa_glsl_parse_state *state,
ast_expression *parent_expr, ast_expression *parent_expr,
int operand, int operand,
const char *operand_name, const char *operand_name,
bool *error_emitted) bool *error_emitted)
{ {
ast_expression *expr = parent_expr->subexpressions[operand]; ast_expression *expr = parent_expr->subexpressions[operand];
void *ctx = state; void *ctx = state;
@@ -1457,8 +1457,8 @@ ast_expression::do_hir(exec_list *instructions,
* in a scalar boolean. See page 57 of the GLSL 1.50 spec. * in a scalar boolean. See page 57 of the GLSL 1.50 spec.
*/ */
assert(type->is_error() assert(type->is_error()
|| ((type->base_type == GLSL_TYPE_BOOL) || ((type->base_type == GLSL_TYPE_BOOL)
&& type->is_scalar())); && type->is_scalar()));
result = new(ctx) ir_expression(operations[this->oper], type, result = new(ctx) ir_expression(operations[this->oper], type,
op[0], op[1]); op[0], op[1]);
@@ -3401,9 +3401,9 @@ apply_layout_qualifier_to_variable(const struct ast_type_qualifier *qual,
? "origin_upper_left" : "pixel_center_integer"; ? "origin_upper_left" : "pixel_center_integer";
_mesa_glsl_error(loc, state, _mesa_glsl_error(loc, state,
"layout qualifier `%s' can only be applied to " "layout qualifier `%s' can only be applied to "
"fragment shader input `gl_FragCoord'", "fragment shader input `gl_FragCoord'",
qual_string); qual_string);
} }
if (qual->flags.q.explicit_location) { if (qual->flags.q.explicit_location) {
@@ -3717,7 +3717,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
else if (qual->flags.q.in) else if (qual->flags.q.in)
var->data.mode = is_parameter ? ir_var_function_in : ir_var_shader_in; var->data.mode = is_parameter ? ir_var_function_in : ir_var_shader_in;
else if (qual->flags.q.attribute else if (qual->flags.q.attribute
|| (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT))) || (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT)))
var->data.mode = ir_var_shader_in; var->data.mode = ir_var_shader_in;
else if (qual->flags.q.out) else if (qual->flags.q.out)
var->data.mode = is_parameter ? ir_var_function_out : ir_var_shader_out; var->data.mode = is_parameter ? ir_var_function_out : ir_var_shader_out;
@@ -4013,9 +4013,9 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc,
*/ */
ir_rvalue * ir_rvalue *
process_initializer(ir_variable *var, ast_declaration *decl, process_initializer(ir_variable *var, ast_declaration *decl,
ast_fully_specified_type *type, ast_fully_specified_type *type,
exec_list *initializer_instructions, exec_list *initializer_instructions,
struct _mesa_glsl_parse_state *state) struct _mesa_glsl_parse_state *state)
{ {
ir_rvalue *result = NULL; ir_rvalue *result = NULL;
@@ -4600,7 +4600,7 @@ ast_declarator_list::hir(exec_list *instructions,
* confusing error. * confusing error.
*/ */
assert(this->type->specifier->structure == NULL || decl_type != NULL assert(this->type->specifier->structure == NULL || decl_type != NULL
|| state->error); || state->error);
if (decl_type == NULL) { if (decl_type == NULL) {
_mesa_glsl_error(&loc, state, _mesa_glsl_error(&loc, state,
@@ -4752,7 +4752,7 @@ ast_declarator_list::hir(exec_list *instructions,
} }
apply_type_qualifier_to_variable(& this->type->qualifier, var, state, apply_type_qualifier_to_variable(& this->type->qualifier, var, state,
& loc, false); & loc, false);
apply_layout_qualifier_to_variable(&this->type->qualifier, var, state, apply_layout_qualifier_to_variable(&this->type->qualifier, var, state,
&loc); &loc);
@@ -5418,8 +5418,8 @@ ast_function::hir(exec_list *instructions,
state->is_version(120, 100)) { state->is_version(120, 100)) {
YYLTYPE loc = this->get_location(); YYLTYPE loc = this->get_location();
_mesa_glsl_error(&loc, state, _mesa_glsl_error(&loc, state,
"declaration of function `%s' not allowed within " "declaration of function `%s' not allowed within "
"function body", name); "function body", name);
} }
validate_identifier(name, this->get_location(), state); validate_identifier(name, this->get_location(), state);
@@ -6094,9 +6094,7 @@ ast_switch_statement::test_to_hir(exec_list *instructions,
*/ */
test_expression->set_is_lhs(true); test_expression->set_is_lhs(true);
/* Cache value of test expression. */ /* Cache value of test expression. */
ir_rvalue *const test_val = ir_rvalue *const test_val = test_expression->hir(instructions, state);
test_expression->hir(instructions,
state);
state->switch_state.test_var = new(ctx) ir_variable(test_val->type, state->switch_state.test_var = new(ctx) ir_variable(test_val->type,
"switch_test_tmp", "switch_test_tmp",
@@ -7858,7 +7856,7 @@ ast_interface_block::hir(exec_list *instructions,
ir_rvalue * ir_rvalue *
ast_tcs_output_layout::hir(exec_list *instructions, ast_tcs_output_layout::hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state) struct _mesa_glsl_parse_state *state)
{ {
YYLTYPE loc = this->get_location(); YYLTYPE loc = this->get_location();
@@ -7876,10 +7874,10 @@ ast_tcs_output_layout::hir(exec_list *instructions,
*/ */
if (state->tcs_output_size != 0 && state->tcs_output_size != num_vertices) { if (state->tcs_output_size != 0 && state->tcs_output_size != num_vertices) {
_mesa_glsl_error(&loc, state, _mesa_glsl_error(&loc, state,
"this tessellation control shader output layout " "this tessellation control shader output layout "
"specifies %u vertices, but a previous output " "specifies %u vertices, but a previous output "
"is declared with size %u", "is declared with size %u",
num_vertices, state->tcs_output_size); num_vertices, state->tcs_output_size);
return NULL; return NULL;
} }
@@ -7891,21 +7889,21 @@ ast_tcs_output_layout::hir(exec_list *instructions,
foreach_in_list (ir_instruction, node, instructions) { foreach_in_list (ir_instruction, node, instructions) {
ir_variable *var = node->as_variable(); ir_variable *var = node->as_variable();
if (var == NULL || var->data.mode != ir_var_shader_out) if (var == NULL || var->data.mode != ir_var_shader_out)
continue; continue;
/* Note: Not all tessellation control shader output are arrays. */ /* Note: Not all tessellation control shader output are arrays. */
if (!var->type->is_unsized_array() || var->data.patch) if (!var->type->is_unsized_array() || var->data.patch)
continue; continue;
if (var->data.max_array_access >= (int)num_vertices) { if (var->data.max_array_access >= (int)num_vertices) {
_mesa_glsl_error(&loc, state, _mesa_glsl_error(&loc, state,
"this tessellation control shader output layout " "this tessellation control shader output layout "
"specifies %u vertices, but an access to element " "specifies %u vertices, but an access to element "
"%u of output `%s' already exists", num_vertices, "%u of output `%s' already exists", num_vertices,
var->data.max_array_access, var->name); var->data.max_array_access, var->name);
} else { } else {
var->type = glsl_type::get_array_instance(var->type->fields.array, var->type = glsl_type::get_array_instance(var->type->fields.array,
num_vertices); num_vertices);
} }
} }
@@ -8093,9 +8091,9 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state,
gl_FragColor_assigned = true; gl_FragColor_assigned = true;
else if (strcmp(var->name, "gl_FragData") == 0) else if (strcmp(var->name, "gl_FragData") == 0)
gl_FragData_assigned = true; gl_FragData_assigned = true;
else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0) else if (strcmp(var->name, "gl_SecondaryFragColorEXT") == 0)
gl_FragSecondaryColor_assigned = true; gl_FragSecondaryColor_assigned = true;
else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0) else if (strcmp(var->name, "gl_SecondaryFragDataEXT") == 0)
gl_FragSecondaryData_assigned = true; gl_FragSecondaryData_assigned = true;
else if (!is_gl_identifier(var->name)) { else if (!is_gl_identifier(var->name)) {
if (state->stage == MESA_SHADER_FRAGMENT && if (state->stage == MESA_SHADER_FRAGMENT &&