mesa: Fix ugly indentation left from previous commit

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
This commit is contained in:
Ian Romanick 2011-03-24 18:31:05 -07:00
parent 89d81ab16c
commit a99e80d795
2 changed files with 35 additions and 38 deletions

View file

@ -402,31 +402,29 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir)
const ir_state_slot *const slots = ir->state_slots;
assert(ir->state_slots != NULL);
{
for (unsigned int i = 0; i < ir->num_state_slots; i++) {
/* This state reference has already been setup by ir_to_mesa,
* but we'll get the same index back here.
*/
int index = _mesa_add_state_reference(this->fp->Base.Parameters,
(gl_state_index *)slots[i].tokens);
for (unsigned int i = 0; i < ir->num_state_slots; i++) {
/* This state reference has already been setup by ir_to_mesa, but we'll
* get the same index back here.
*/
int index = _mesa_add_state_reference(this->fp->Base.Parameters,
(gl_state_index *)slots[i].tokens);
/* Add each of the unique swizzles of the element as a
* parameter. This'll end up matching the expected layout of
* the array/matrix/structure we're trying to fill in.
*/
int last_swiz = -1;
for (unsigned int j = 0; j < 4; j++) {
int swiz = GET_SWZ(slots[i].swizzle, j);
if (swiz == last_swiz)
break;
last_swiz = swiz;
/* Add each of the unique swizzles of the element as a parameter.
* This'll end up matching the expected layout of the
* array/matrix/structure we're trying to fill in.
*/
int last_swiz = -1;
for (unsigned int j = 0; j < 4; j++) {
int swiz = GET_SWZ(slots[i].swizzle, j);
if (swiz == last_swiz)
break;
last_swiz = swiz;
c->prog_data.param_convert[c->prog_data.nr_params] =
PARAM_NO_CONVERT;
this->param_index[c->prog_data.nr_params] = index;
this->param_offset[c->prog_data.nr_params] = swiz;
c->prog_data.nr_params++;
}
c->prog_data.param_convert[c->prog_data.nr_params] =
PARAM_NO_CONVERT;
this->param_index[c->prog_data.nr_params] = index;
this->param_offset[c->prog_data.nr_params] = swiz;
c->prog_data.nr_params++;
}
}
}

View file

@ -795,26 +795,25 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
}
{
for (unsigned int i = 0; i < ir->num_state_slots; i++) {
int index = _mesa_add_state_reference(this->prog->Parameters,
(gl_state_index *)slots[i].tokens);
for (unsigned int i = 0; i < ir->num_state_slots; i++) {
int index = _mesa_add_state_reference(this->prog->Parameters,
(gl_state_index *)slots[i].tokens);
if (storage->file == PROGRAM_STATE_VAR) {
if (storage->index == -1) {
storage->index = index;
} else {
assert(index == storage->index + (int)i);
}
if (storage->file == PROGRAM_STATE_VAR) {
if (storage->index == -1) {
storage->index = index;
} else {
ir_to_mesa_src_reg src(PROGRAM_STATE_VAR, index, NULL);
src.swizzle = slots[i].swizzle;
ir_to_mesa_emit_op1(ir, OPCODE_MOV, dst, src);
/* even a float takes up a whole vec4 reg in a struct/array. */
dst.index++;
assert(index == storage->index + (int)i);
}
} else {
ir_to_mesa_src_reg src(PROGRAM_STATE_VAR, index, NULL);
src.swizzle = slots[i].swizzle;
ir_to_mesa_emit_op1(ir, OPCODE_MOV, dst, src);
/* even a float takes up a whole vec4 reg in a struct/array. */
dst.index++;
}
}
if (storage->file == PROGRAM_TEMPORARY &&
dst.index != storage->index + ir->num_state_slots) {
fail_link(this->shader_program,