diff options
author | Timothy Arceri <[email protected]> | 2016-07-27 15:20:45 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-08-11 08:33:38 +1000 |
commit | 30e5ff706789823145c51313870c87bffab6943f (patch) | |
tree | a6fbb4dbdc20a535f25674bf8d04933292abba4a | |
parent | 549222f5f8ef4616f5e6ddeb5c29ea6446684e5e (diff) |
glsl: remove remaining tabs in link_uniform_initializers.cpp
Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r-- | src/compiler/glsl/link_uniform_initializers.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/compiler/glsl/link_uniform_initializers.cpp b/src/compiler/glsl/link_uniform_initializers.cpp index 3750021033f..021e95032f8 100644 --- a/src/compiler/glsl/link_uniform_initializers.cpp +++ b/src/compiler/glsl/link_uniform_initializers.cpp @@ -46,30 +46,30 @@ get_storage(struct gl_shader_program *prog, const char *name) void copy_constant_to_storage(union gl_constant_value *storage, - const ir_constant *val, - const enum glsl_base_type base_type, + 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]; - break; + storage[i].u = val->value.u[i]; + break; case GLSL_TYPE_INT: case GLSL_TYPE_SAMPLER: - storage[i].i = val->value.i[i]; - break; + storage[i].i = val->value.i[i]; + break; case GLSL_TYPE_FLOAT: - storage[i].f = val->value.f[i]; - break; + storage[i].f = val->value.f[i]; + break; case GLSL_TYPE_DOUBLE: /* XXX need to check on big-endian */ memcpy(&storage[i * 2].u, &val->value.d[i], sizeof(double)); break; case GLSL_TYPE_BOOL: - storage[i].b = val->value.b[i] ? boolean_true : 0; - break; + storage[i].b = val->value.b[i] ? boolean_true : 0; + break; case GLSL_TYPE_ARRAY: case GLSL_TYPE_STRUCT: case GLSL_TYPE_IMAGE: @@ -79,11 +79,11 @@ copy_constant_to_storage(union gl_constant_value *storage, case GLSL_TYPE_SUBROUTINE: case GLSL_TYPE_FUNCTION: case GLSL_TYPE_ERROR: - /* All other types should have already been filtered by other - * paths in the caller. - */ - assert(!"Should not get here."); - break; + /* All other types should have already been filtered by other + * paths in the caller. + */ + assert(!"Should not get here."); + break; } } } @@ -102,9 +102,9 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog, 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); + const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); - set_opaque_binding(mem_ctx, prog, element_type, + set_opaque_binding(mem_ctx, prog, element_type, element_name, binding); } } else { @@ -172,7 +172,7 @@ set_block_binding(gl_shader_program *prog, const char *block_name, void set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, - const char *name, const glsl_type *type, + const char *name, const glsl_type *type, ir_constant *val, unsigned int boolean_true) { const glsl_type *t_without_array = type->without_array(); @@ -182,12 +182,12 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, field_constant = (ir_constant *)val->components.get_head(); for (unsigned int i = 0; i < type->length; i++) { - const glsl_type *field_type = type->fields.structure[i].type; - const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name, - type->fields.structure[i].name); - set_uniform_initializer(mem_ctx, prog, field_name, + const glsl_type *field_type = type->fields.structure[i].type; + const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name, + type->fields.structure[i].name); + set_uniform_initializer(mem_ctx, prog, field_name, field_type, field_constant, boolean_true); - field_constant = (ir_constant *)field_constant->next; + field_constant = (ir_constant *)field_constant->next; } return; } else if (t_without_array->is_record() || @@ -195,9 +195,9 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, 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); + const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); - set_uniform_initializer(mem_ctx, prog, element_name, + set_uniform_initializer(mem_ctx, prog, element_name, element_type, val->array_elements[i], boolean_true); } @@ -211,25 +211,25 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, if (val->type->is_array()) { const enum glsl_base_type base_type = - val->array_elements[0]->type->base_type; + val->array_elements[0]->type->base_type; const unsigned int elements = val->array_elements[0]->type->components(); unsigned int idx = 0; unsigned dmul = glsl_base_type_is_64bit(base_type) ? 2 : 1; assert(val->type->length >= storage->array_elements); for (unsigned int i = 0; i < storage->array_elements; i++) { - copy_constant_to_storage(& storage->storage[idx], - val->array_elements[i], - base_type, + copy_constant_to_storage(& storage->storage[idx], + val->array_elements[i], + base_type, elements, boolean_true); - idx += elements * dmul; + idx += elements * dmul; } } else { copy_constant_to_storage(storage->storage, - val, - val->type->base_type, + val, + val->type->base_type, val->type->components(), boolean_true); @@ -258,17 +258,17 @@ link_set_uniform_initializers(struct gl_shader_program *prog, struct gl_linked_shader *shader = prog->_LinkedShaders[i]; if (shader == NULL) - continue; + continue; foreach_in_list(ir_instruction, node, shader->ir) { - ir_variable *const var = node->as_variable(); + ir_variable *const var = node->as_variable(); - if (!var || (var->data.mode != ir_var_uniform && - var->data.mode != ir_var_shader_storage)) - continue; + if (!var || (var->data.mode != ir_var_uniform && + var->data.mode != ir_var_shader_storage)) + continue; - if (!mem_ctx) - mem_ctx = ralloc_context(NULL); + if (!mem_ctx) + mem_ctx = ralloc_context(NULL); if (var->data.explicit_binding) { const glsl_type *const type = var->type; |