From 447bb9029f7e03b03e507053b9f63536d8fc74ac Mon Sep 17 00:00:00 2001 From: Tapani Pälli Date: Thu, 12 Dec 2013 15:08:59 +0200 Subject: glsl: move variables in to ir_variable::data, part II MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch moves following bitfields and variables to the data structure: explicit_location, explicit_index, explicit_binding, has_initializer, is_unmatched_generic_inout, location_frac, from_named_ifc_block_nonarray, from_named_ifc_block_array, depth_layout, location, index, binding, max_array_access, atomic Signed-off-by: Tapani Pälli Reviewed-by: Paul Berry --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- src/mesa/drivers/dri/i965/brw_fs_fp.cpp | 2 +- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 28 +++++++++++------------ src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 16 ++++++------- src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 281920324aa..63b005e33c0 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1049,7 +1049,7 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) glsl_interp_qualifier interpolation_mode = ir->determine_interpolation_mode(c->key.flat_shade); - int location = ir->location; + int location = ir->data.location; for (unsigned int i = 0; i < array_elements; i++) { for (unsigned int j = 0; j < type->matrix_columns; j++) { if (c->prog_data.urb_setup[location] == -1) { diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp index dbf201756a4..f8577c1f444 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp @@ -608,7 +608,7 @@ fs_visitor::setup_fp_regs() ir_variable *ir = new(mem_ctx) ir_variable(glsl_type::vec4_type, "fp_input", ir_var_shader_in); - ir->location = i; + ir->data.location = i; this->current_annotation = ralloc_asprintf(ctx, "interpolate input %d", i); diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 763c0ae2eea..47cf71e3c53 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -70,24 +70,24 @@ fs_visitor::visit(ir_variable *ir) } else if (ir->data.mode == ir_var_shader_out) { reg = new(this->mem_ctx) fs_reg(this, ir->type); - if (ir->index > 0) { - assert(ir->location == FRAG_RESULT_DATA0); - assert(ir->index == 1); + if (ir->data.index > 0) { + assert(ir->data.location == FRAG_RESULT_DATA0); + assert(ir->data.index == 1); this->dual_src_output = *reg; - } else if (ir->location == FRAG_RESULT_COLOR) { + } else if (ir->data.location == FRAG_RESULT_COLOR) { /* Writing gl_FragColor outputs to all color regions. */ for (unsigned int i = 0; i < MAX2(c->key.nr_color_regions, 1); i++) { this->outputs[i] = *reg; this->output_components[i] = 4; } - } else if (ir->location == FRAG_RESULT_DEPTH) { + } else if (ir->data.location == FRAG_RESULT_DEPTH) { this->frag_depth = *reg; - } else if (ir->location == FRAG_RESULT_SAMPLE_MASK) { + } else if (ir->data.location == FRAG_RESULT_SAMPLE_MASK) { this->sample_mask = *reg; } else { /* gl_FragData or a user-defined FS output */ - assert(ir->location >= FRAG_RESULT_DATA0 && - ir->location < FRAG_RESULT_DATA0 + BRW_MAX_DRAW_BUFFERS); + assert(ir->data.location >= FRAG_RESULT_DATA0 && + ir->data.location < FRAG_RESULT_DATA0 + BRW_MAX_DRAW_BUFFERS); int vector_elements = ir->type->is_array() ? ir->type->fields.array->vector_elements @@ -95,7 +95,7 @@ fs_visitor::visit(ir_variable *ir) /* General color output. */ for (unsigned int i = 0; i < MAX2(1, ir->type->length); i++) { - int output = ir->location - FRAG_RESULT_DATA0 + i; + int output = ir->data.location - FRAG_RESULT_DATA0 + i; this->outputs[output] = *reg; this->outputs[output].reg_offset += vector_elements * i; this->output_components[output] = vector_elements; @@ -132,9 +132,9 @@ fs_visitor::visit(ir_variable *ir) reg->type = brw_type_for_base_type(ir->type); } else if (ir->data.mode == ir_var_system_value) { - if (ir->location == SYSTEM_VALUE_SAMPLE_POS) { + if (ir->data.location == SYSTEM_VALUE_SAMPLE_POS) { reg = emit_samplepos_setup(ir); - } else if (ir->location == SYSTEM_VALUE_SAMPLE_ID) { + } else if (ir->data.location == SYSTEM_VALUE_SAMPLE_ID) { reg = emit_sampleid_setup(ir); } } @@ -2219,7 +2219,7 @@ fs_visitor::visit_atomic_counter_intrinsic(ir_call *ir) ir->actual_parameters.get_head()); ir_variable *location = deref->variable_referenced(); unsigned surf_index = (c->prog_data.base.binding_table.abo_start + - location->atomic.buffer_index); + location->data.atomic.buffer_index); /* Calculate the surface offset */ fs_reg offset(this, glsl_type::uint_type); @@ -2230,9 +2230,9 @@ fs_visitor::visit_atomic_counter_intrinsic(ir_call *ir) fs_reg tmp(this, glsl_type::uint_type); emit(MUL(tmp, this->result, ATOMIC_COUNTER_SIZE)); - emit(ADD(offset, tmp, location->atomic.offset)); + emit(ADD(offset, tmp, location->data.atomic.offset)); } else { - offset = location->atomic.offset; + offset = location->data.atomic.offset; } /* Emit the appropriate machine instruction */ diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 0d8135c8d8f..3b8cef69a7e 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -947,18 +947,18 @@ vec4_visitor::visit(ir_variable *ir) switch (ir->data.mode) { case ir_var_shader_in: - reg = new(mem_ctx) dst_reg(ATTR, ir->location); + reg = new(mem_ctx) dst_reg(ATTR, ir->data.location); break; case ir_var_shader_out: reg = new(mem_ctx) dst_reg(this, ir->type); for (int i = 0; i < type_size(ir->type); i++) { - output_reg[ir->location + i] = *reg; - output_reg[ir->location + i].reg_offset = i; - output_reg[ir->location + i].type = + output_reg[ir->data.location + i] = *reg; + output_reg[ir->data.location + i].reg_offset = i; + output_reg[ir->data.location + i].type = brw_type_for_base_type(ir->type->get_scalar_type()); - output_reg_annotation[ir->location + i] = ir->name; + output_reg_annotation[ir->data.location + i] = ir->name; } break; @@ -2163,7 +2163,7 @@ vec4_visitor::visit_atomic_counter_intrinsic(ir_call *ir) ir->actual_parameters.get_head()); ir_variable *location = deref->variable_referenced(); unsigned surf_index = (prog_data->base.binding_table.abo_start + - location->atomic.buffer_index); + location->data.atomic.buffer_index); /* Calculate the surface offset */ src_reg offset(this, glsl_type::uint_type); @@ -2173,9 +2173,9 @@ vec4_visitor::visit_atomic_counter_intrinsic(ir_call *ir) src_reg tmp(this, glsl_type::uint_type); emit(MUL(dst_reg(tmp), this->result, ATOMIC_COUNTER_SIZE)); - emit(ADD(dst_reg(offset), tmp, location->atomic.offset)); + emit(ADD(dst_reg(offset), tmp, location->data.atomic.offset)); } else { - offset = location->atomic.offset; + offset = location->data.atomic.offset; } /* Emit the appropriate machine instruction */ diff --git a/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp index 31c42c49082..0146cf9beab 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp @@ -153,7 +153,7 @@ vec4_vs_visitor::make_reg_for_system_value(ir_variable *ir) dst_reg *reg = new(mem_ctx) dst_reg(ATTR, VERT_ATTRIB_MAX); vs_prog_data->uses_vertexid = true; - switch (ir->location) { + switch (ir->data.location) { case SYSTEM_VALUE_VERTEX_ID: reg->writemask = WRITEMASK_X; break; -- cgit v1.2.3