summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2013-12-12 13:51:01 +0200
committerTapani Pälli <[email protected]>2013-12-12 17:28:08 +0200
commit33ee2c67c0a4e8f2fefbf37dacabd14918060af5 (patch)
tree4432c7acd7722bb635e1f34074278d669a0b74da /src/mesa/drivers
parentc1d3080ee86cd3d914712ffe0bb533c5d6a6b271 (diff)
glsl: move variables in to ir_variable::data, part I
This patch moves following bitfields in to the data structure: used, assigned, how_declared, mode, interpolation, origin_upper_left, pixel_center_integer Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp8
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_fp.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp8
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp4
7 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 374801fab20..281920324aa 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -952,10 +952,10 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)
{
fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type);
fs_reg wpos = *reg;
- bool flip = !ir->origin_upper_left ^ c->key.render_to_fbo;
+ bool flip = !ir->data.origin_upper_left ^ c->key.render_to_fbo;
/* gl_FragCoord.x */
- if (ir->pixel_center_integer) {
+ if (ir->data.pixel_center_integer) {
emit(MOV(wpos, this->pixel_x));
} else {
emit(ADD(wpos, this->pixel_x, fs_reg(0.5f)));
@@ -963,11 +963,11 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)
wpos.reg_offset++;
/* gl_FragCoord.y */
- if (!flip && ir->pixel_center_integer) {
+ if (!flip && ir->data.pixel_center_integer) {
emit(MOV(wpos, this->pixel_y));
} else {
fs_reg pixel_y = this->pixel_y;
- float offset = (ir->pixel_center_integer ? 0.0 : 0.5);
+ float offset = (ir->data.pixel_center_integer ? 0.0 : 0.5);
if (flip) {
pixel_y.negate = true;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
index 5aec757a9b1..dbf201756a4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
@@ -615,8 +615,8 @@ fs_visitor::setup_fp_regs()
switch (i) {
case VARYING_SLOT_POS:
- ir->pixel_center_integer = fp->PixelCenterInteger;
- ir->origin_upper_left = fp->OriginUpperLeft;
+ ir->data.pixel_center_integer = fp->PixelCenterInteger;
+ ir->data.origin_upper_left = fp->OriginUpperLeft;
fp_input_regs[i] = *emit_fragcoord_interpolation(ir);
break;
case VARYING_SLOT_FACE:
diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
index 6284b590234..ff7aa805512 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
@@ -107,7 +107,7 @@ ir_vector_reference_visitor::get_variable_entry(ir_variable *var)
if (!var->type->is_vector())
return NULL;
- switch (var->mode) {
+ switch (var->data.mode) {
case ir_var_uniform:
case ir_var_shader_in:
case ir_var_shader_out:
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 64ff8998f7e..763c0ae2eea 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -56,7 +56,7 @@ fs_visitor::visit(ir_variable *ir)
if (variable_storage(ir))
return;
- if (ir->mode == ir_var_shader_in) {
+ if (ir->data.mode == ir_var_shader_in) {
if (!strcmp(ir->name, "gl_FragCoord")) {
reg = emit_fragcoord_interpolation(ir);
} else if (!strcmp(ir->name, "gl_FrontFacing")) {
@@ -67,7 +67,7 @@ fs_visitor::visit(ir_variable *ir)
assert(reg);
hash_table_insert(this->variable_ht, reg, ir);
return;
- } else if (ir->mode == ir_var_shader_out) {
+ } else if (ir->data.mode == ir_var_shader_out) {
reg = new(this->mem_ctx) fs_reg(this, ir->type);
if (ir->index > 0) {
@@ -101,7 +101,7 @@ fs_visitor::visit(ir_variable *ir)
this->output_components[output] = vector_elements;
}
}
- } else if (ir->mode == ir_var_uniform) {
+ } else if (ir->data.mode == ir_var_uniform) {
int param_index = c->prog_data.nr_params;
/* Thanks to the lower_ubo_reference pass, we will see only
@@ -131,7 +131,7 @@ fs_visitor::visit(ir_variable *ir)
reg = new(this->mem_ctx) fs_reg(UNIFORM, param_index);
reg->type = brw_type_for_base_type(ir->type);
- } else if (ir->mode == ir_var_system_value) {
+ } else if (ir->data.mode == ir_var_system_value) {
if (ir->location == SYSTEM_VALUE_SAMPLE_POS) {
reg = emit_samplepos_setup(ir);
} else if (ir->location == SYSTEM_VALUE_SAMPLE_ID) {
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 88aa169fc1f..6f0ace8932c 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -223,7 +223,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
foreach_list(node, shader->ir) {
ir_variable *var = ((ir_instruction *) node)->as_variable();
- if ((var == NULL) || (var->mode != ir_var_uniform)
+ if ((var == NULL) || (var->data.mode != ir_var_uniform)
|| (strncmp(var->name, "gl_", 3) != 0))
continue;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
index adbb1cf0945..c93459d28a7 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
@@ -283,7 +283,7 @@ vec4_gs_visitor::compute_array_stride(ir_dereference_array *ir)
* setup_attributes() will remap our accesses to the actual input array.
*/
ir_dereference_variable *deref_var = ir->array->as_dereference_variable();
- if (deref_var && deref_var->var->mode == ir_var_shader_in)
+ if (deref_var && deref_var->var->data.mode == ir_var_shader_in)
return BRW_VARYING_SLOT_COUNT;
else
return vec4_visitor::compute_array_stride(ir);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 81039ab0bc2..0d8135c8d8f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -945,7 +945,7 @@ vec4_visitor::visit(ir_variable *ir)
if (variable_storage(ir))
return;
- switch (ir->mode) {
+ switch (ir->data.mode) {
case ir_var_shader_in:
reg = new(mem_ctx) dst_reg(ATTR, ir->location);
break;
@@ -1752,7 +1752,7 @@ vec4_visitor::visit(ir_dereference_variable *ir)
this->result = src_reg(*reg);
/* System values get their swizzle from the dst_reg writemask */
- if (ir->var->mode == ir_var_system_value)
+ if (ir->var->data.mode == ir_var_system_value)
return;
if (type->is_scalar() || type->is_vector() || type->is_matrix())