Commit 33ee2c67 authored by Tapani Pälli's avatar Tapani Pälli

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: default avatarTapani Pälli <tapani.palli@intel.com>
Reviewed-by: default avatarPaul Berry <stereotype441@gmail.com>
parent c1d3080e
......@@ -168,7 +168,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
if (array->type->is_unsized_array()) {
_mesa_glsl_error(&loc, state, "unsized array index must be constant");
} else if (array->type->fields.array->is_interface()
&& array->variable_referenced()->mode == ir_var_uniform) {
&& array->variable_referenced()->data.mode == ir_var_uniform) {
/* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says:
*
* "All indexes used to index a uniform block array must be
......
......@@ -123,7 +123,7 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
YYLTYPE loc = actual_ast->get_location();
/* Verify that 'const_in' parameters are ir_constants. */
if (formal->mode == ir_var_const_in &&
if (formal->data.mode == ir_var_const_in &&
actual->ir_type != ir_type_constant) {
_mesa_glsl_error(&loc, state,
"parameter `in %s' must be a constant expression",
......@@ -132,10 +132,10 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
}
/* Verify that 'out' and 'inout' actual parameters are lvalues. */
if (formal->mode == ir_var_function_out
|| formal->mode == ir_var_function_inout) {
if (formal->data.mode == ir_var_function_out
|| formal->data.mode == ir_var_function_inout) {
const char *mode = NULL;
switch (formal->mode) {
switch (formal->data.mode) {
case ir_var_function_out: mode = "out"; break;
case ir_var_function_inout: mode = "inout"; break;
default: assert(false); break;
......@@ -155,7 +155,7 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
ir_variable *var = actual->variable_referenced();
if (var)
var->assigned = true;
var->data.assigned = true;
if (var && var->data.read_only) {
_mesa_glsl_error(&loc, state,
......@@ -304,7 +304,7 @@ generate_call(exec_list *instructions, ir_function_signature *sig,
assert(formal != NULL);
if (formal->type->is_numeric() || formal->type->is_boolean()) {
switch (formal->mode) {
switch (formal->data.mode) {
case ir_var_const_in:
case ir_var_function_in: {
ir_rvalue *converted
......@@ -316,7 +316,7 @@ generate_call(exec_list *instructions, ir_function_signature *sig,
case ir_var_function_inout:
fix_parameter(ctx, actual, formal->type,
instructions, &post_call_conversions,
formal->mode == ir_var_function_inout);
formal->data.mode == ir_var_function_inout);
break;
default:
assert (!"Illegal formal parameter mode");
......
This diff is collapsed.
......@@ -435,9 +435,9 @@ builtin_variable_generator::add_variable(const char *name,
enum ir_variable_mode mode, int slot)
{
ir_variable *var = new(symtab) ir_variable(type, name, mode);
var->how_declared = ir_var_declared_implicitly;
var->data.how_declared = ir_var_declared_implicitly;
switch (var->mode) {
switch (var->data.mode) {
case ir_var_auto:
case ir_var_shader_in:
case ir_var_uniform:
......@@ -793,9 +793,9 @@ builtin_variable_generator::generate_gs_special_vars()
*/
ir_variable *var;
var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveIDIn");
var->interpolation = INTERP_QUALIFIER_FLAT;
var->data.interpolation = INTERP_QUALIFIER_FLAT;
var = add_output(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
var->interpolation = INTERP_QUALIFIER_FLAT;
var->data.interpolation = INTERP_QUALIFIER_FLAT;
}
......@@ -813,7 +813,7 @@ builtin_variable_generator::generate_fs_special_vars()
if (state->is_version(150, 0)) {
ir_variable *var =
add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
var->interpolation = INTERP_QUALIFIER_FLAT;
var->data.interpolation = INTERP_QUALIFIER_FLAT;
}
/* gl_FragColor and gl_FragData were deprecated starting in desktop GLSL
......@@ -936,7 +936,7 @@ builtin_variable_generator::generate_varyings()
ir_variable *var =
add_variable(fields[i].name, fields[i].type, ir_var_shader_out,
fields[i].location);
var->interpolation = fields[i].interpolation;
var->data.interpolation = fields[i].interpolation;
var->data.centroid = fields[i].centroid;
var->data.sample = fields[i].sample;
var->init_interface_type(per_vertex_out_type);
......
......@@ -1579,9 +1579,7 @@ ir_swizzle::variable_referenced() const
ir_variable::ir_variable(const struct glsl_type *type, const char *name,
ir_variable_mode mode)
: max_array_access(0), max_ifc_array_access(NULL),
how_declared(ir_var_declared_normally), mode(mode),
interpolation(INTERP_QUALIFIER_NONE), atomic()
: max_array_access(0), max_ifc_array_access(NULL), atomic()
{
this->ir_type = ir_type_variable;
this->type = type;
......@@ -1593,14 +1591,17 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
this->warn_extension = NULL;
this->constant_value = NULL;
this->constant_initializer = NULL;
this->origin_upper_left = false;
this->pixel_center_integer = false;
this->data.origin_upper_left = false;
this->data.pixel_center_integer = false;
this->depth_layout = ir_depth_layout_none;
this->used = false;
this->data.used = false;
this->data.read_only = false;
this->data.centroid = false;
this->data.sample = false;
this->data.invariant = false;
this->data.how_declared = ir_var_declared_normally;
this->data.mode = mode;
this->data.interpolation = INTERP_QUALIFIER_NONE;
if (type != NULL) {
if (type->base_type == GLSL_TYPE_SAMPLER)
......@@ -1632,8 +1633,8 @@ interpolation_string(unsigned interpolation)
glsl_interp_qualifier
ir_variable::determine_interpolation_mode(bool flat_shade)
{
if (this->interpolation != INTERP_QUALIFIER_NONE)
return (glsl_interp_qualifier) this->interpolation;
if (this->data.interpolation != INTERP_QUALIFIER_NONE)
return (glsl_interp_qualifier) this->data.interpolation;
int location = this->location;
bool is_gl_Color =
location == VARYING_SLOT_COL0 || location == VARYING_SLOT_COL1;
......@@ -1705,8 +1706,8 @@ ir_function_signature::qualifiers_match(exec_list *params)
ir_variable *b = (ir_variable *)iter_b.get();
if (a->data.read_only != b->data.read_only ||
!modes_match(a->mode, b->mode) ||
a->interpolation != b->interpolation ||
!modes_match(a->data.mode, b->data.mode) ||
a->data.interpolation != b->data.interpolation ||
a->data.centroid != b->data.centroid ||
a->data.sample != b->data.sample) {
......@@ -1892,7 +1893,7 @@ vertices_per_prim(GLenum prim)
const char *
mode_string(const ir_variable *var)
{
switch (var->mode) {
switch (var->data.mode) {
case ir_var_auto:
return (var->data.read_only) ? "global constant" : "global variable";
......
......@@ -403,7 +403,7 @@ public:
*/
inline bool is_in_uniform_block() const
{
return this->mode == ir_var_uniform && this->interface_type != NULL;
return this->data.mode == ir_var_uniform && this->interface_type != NULL;
}
/**
......@@ -535,59 +535,59 @@ public:
unsigned sample:1;
unsigned invariant:1;
} data;
/**
* Has this variable been used for reading or writing?
*
* Several GLSL semantic checks require knowledge of whether or not a
* variable has been used. For example, it is an error to redeclare a
* variable as invariant after it has been used.
*
* This is only maintained in the ast_to_hir.cpp path, not in
* Mesa's fixed function or ARB program paths.
*/
unsigned used:1;
/**
* Has this variable been used for reading or writing?
*
* Several GLSL semantic checks require knowledge of whether or not a
* variable has been used. For example, it is an error to redeclare a
* variable as invariant after it has been used.
*
* This is only maintained in the ast_to_hir.cpp path, not in
* Mesa's fixed function or ARB program paths.
*/
unsigned used:1;
/**
* Has this variable been statically assigned?
*
* This answers whether the variable was assigned in any path of
* the shader during ast_to_hir. This doesn't answer whether it is
* still written after dead code removal, nor is it maintained in
* non-ast_to_hir.cpp (GLSL parsing) paths.
*/
unsigned assigned:1;
/**
* Has this variable been statically assigned?
*
* This answers whether the variable was assigned in any path of
* the shader during ast_to_hir. This doesn't answer whether it is
* still written after dead code removal, nor is it maintained in
* non-ast_to_hir.cpp (GLSL parsing) paths.
*/
unsigned assigned:1;
/**
* Enum indicating how the variable was declared. See
* ir_var_declaration_type.
*
* This is used to detect certain kinds of illegal variable redeclarations.
*/
unsigned how_declared:2;
/**
* Enum indicating how the variable was declared. See
* ir_var_declaration_type.
*
* This is used to detect certain kinds of illegal variable redeclarations.
*/
unsigned how_declared:2;
/**
* Storage class of the variable.
*
* \sa ir_variable_mode
*/
unsigned mode:4;
/**
* Storage class of the variable.
*
* \sa ir_variable_mode
*/
unsigned mode:4;
/**
* Interpolation mode for shader inputs / outputs
*
* \sa ir_variable_interpolation
*/
unsigned interpolation:2;
/**
* Interpolation mode for shader inputs / outputs
*
* \sa ir_variable_interpolation
*/
unsigned interpolation:2;
/**
* \name ARB_fragment_coord_conventions
* @{
*/
unsigned origin_upper_left:1;
unsigned pixel_center_integer:1;
/*@}*/
/**
* \name ARB_fragment_coord_conventions
* @{
*/
unsigned origin_upper_left:1;
unsigned pixel_center_integer:1;
/*@}*/
} data;
/**
* Was the location explicitly set in the shader?
......
......@@ -41,7 +41,7 @@ ir_variable *
ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_variable *var = new(mem_ctx) ir_variable(this->type, this->name,
(ir_variable_mode) this->mode);
(ir_variable_mode) this->data.mode);
var->max_array_access = this->max_array_access;
if (this->is_interface_instance()) {
......@@ -54,23 +54,23 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
var->data.centroid = this->data.centroid;
var->data.sample = this->data.sample;
var->data.invariant = this->data.invariant;
var->interpolation = this->interpolation;
var->data.interpolation = this->data.interpolation;
var->location = this->location;
var->index = this->index;
var->binding = this->binding;
var->atomic.buffer_index = this->atomic.buffer_index;
var->atomic.offset = this->atomic.offset;
var->warn_extension = this->warn_extension;
var->origin_upper_left = this->origin_upper_left;
var->pixel_center_integer = this->pixel_center_integer;
var->data.origin_upper_left = this->data.origin_upper_left;
var->data.pixel_center_integer = this->data.pixel_center_integer;
var->explicit_location = this->explicit_location;
var->explicit_index = this->explicit_index;
var->explicit_binding = this->explicit_binding;
var->has_initializer = this->has_initializer;
var->depth_layout = this->depth_layout;
var->assigned = this->assigned;
var->how_declared = this->how_declared;
var->used = this->used;
var->data.assigned = this->data.assigned;
var->data.how_declared = this->data.how_declared;
var->data.used = this->data.used;
var->num_state_slots = this->num_state_slots;
if (this->state_slots) {
......
......@@ -1583,7 +1583,7 @@ ir_dereference_variable::constant_expression_value(struct hash_table *variable_c
/* The constant_value of a uniform variable is its initializer,
* not the lifetime constant value of the uniform.
*/
if (var->mode == ir_var_uniform)
if (var->data.mode == ir_var_uniform)
return NULL;
if (!var->constant_value)
......
......@@ -66,7 +66,7 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b)
/* Try to find an implicit conversion from actual to param. */
inexact_match = true;
switch ((enum ir_variable_mode)(param->mode)) {
switch ((enum ir_variable_mode)(param->data.mode)) {
case ir_var_auto:
case ir_var_uniform:
case ir_var_temporary:
......
......@@ -159,7 +159,7 @@ void ir_print_visitor::visit(ir_variable *ir)
STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT);
printf("(%s%s%s%s%s) ",
cent, samp, inv, mode[ir->mode], interp[ir->interpolation]);
cent, samp, inv, mode[ir->data.mode], interp[ir->data.interpolation]);
print_type(ir->type);
printf(" %s)", unique_name(ir));
......
......@@ -418,29 +418,29 @@ ir_reader::read_declaration(s_expression *expr)
} else if (strcmp(qualifier->value(), "invariant") == 0) {
var->data.invariant = 1;
} else if (strcmp(qualifier->value(), "uniform") == 0) {
var->mode = ir_var_uniform;
var->data.mode = ir_var_uniform;
} else if (strcmp(qualifier->value(), "auto") == 0) {
var->mode = ir_var_auto;
var->data.mode = ir_var_auto;
} else if (strcmp(qualifier->value(), "in") == 0) {
var->mode = ir_var_function_in;
var->data.mode = ir_var_function_in;
} else if (strcmp(qualifier->value(), "shader_in") == 0) {
var->mode = ir_var_shader_in;
var->data.mode = ir_var_shader_in;
} else if (strcmp(qualifier->value(), "const_in") == 0) {
var->mode = ir_var_const_in;
var->data.mode = ir_var_const_in;
} else if (strcmp(qualifier->value(), "out") == 0) {
var->mode = ir_var_function_out;
var->data.mode = ir_var_function_out;
} else if (strcmp(qualifier->value(), "shader_out") == 0) {
var->mode = ir_var_shader_out;
var->data.mode = ir_var_shader_out;
} else if (strcmp(qualifier->value(), "inout") == 0) {
var->mode = ir_var_function_inout;
var->data.mode = ir_var_function_inout;
} else if (strcmp(qualifier->value(), "temporary") == 0) {
var->mode = ir_var_temporary;
var->data.mode = ir_var_temporary;
} else if (strcmp(qualifier->value(), "smooth") == 0) {
var->interpolation = INTERP_QUALIFIER_SMOOTH;
var->data.interpolation = INTERP_QUALIFIER_SMOOTH;
} else if (strcmp(qualifier->value(), "flat") == 0) {
var->interpolation = INTERP_QUALIFIER_FLAT;
var->data.interpolation = INTERP_QUALIFIER_FLAT;
} else if (strcmp(qualifier->value(), "noperspective") == 0) {
var->interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
var->data.interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
} else {
ir_read_error(expr, "unknown qualifier: %s", qualifier->value());
return NULL;
......
......@@ -75,9 +75,9 @@ private:
static inline bool
is_shader_inout(ir_variable *var)
{
return var->mode == ir_var_shader_in ||
var->mode == ir_var_shader_out ||
var->mode == ir_var_system_value;
return var->data.mode == ir_var_shader_in ||
var->data.mode == ir_var_shader_out ||
var->data.mode == ir_var_system_value;
}
static void
......@@ -94,21 +94,21 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
for (int i = 0; i < len; i++) {
GLbitfield64 bitfield = BITFIELD64_BIT(var->location + var->index + offset + i);
if (var->mode == ir_var_shader_in) {
if (var->data.mode == ir_var_shader_in) {
prog->InputsRead |= bitfield;
if (is_fragment_shader) {
gl_fragment_program *fprog = (gl_fragment_program *) prog;
fprog->InterpQualifier[var->location + var->index + offset + i] =
(glsl_interp_qualifier) var->interpolation;
(glsl_interp_qualifier) var->data.interpolation;
if (var->data.centroid)
fprog->IsCentroid |= bitfield;
if (var->data.sample)
fprog->IsSample |= bitfield;
}
} else if (var->mode == ir_var_system_value) {
} else if (var->data.mode == ir_var_system_value) {
prog->SystemValuesRead |= bitfield;
} else {
assert(var->mode == ir_var_shader_out);
assert(var->data.mode == ir_var_shader_out);
prog->OutputsWritten |= bitfield;
}
}
......@@ -123,7 +123,7 @@ ir_set_program_inouts_visitor::mark_whole_variable(ir_variable *var)
{
const glsl_type *type = var->type;
if (this->shader_type == GL_GEOMETRY_SHADER &&
var->mode == ir_var_shader_in && type->is_array()) {
var->data.mode == ir_var_shader_in && type->is_array()) {
type = type->fields.array;
}
......@@ -162,7 +162,7 @@ ir_set_program_inouts_visitor::try_mark_partial_variable(ir_variable *var,
const glsl_type *type = var->type;
if (this->shader_type == GL_GEOMETRY_SHADER &&
var->mode == ir_var_shader_in) {
var->data.mode == ir_var_shader_in) {
/* The only geometry shader input that is not an array is
* gl_PrimitiveIDIn, and in that case, this code will never be reached,
* because gl_PrimitiveIDIn can't be indexed into in array fashion.
......@@ -244,7 +244,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir)
if (ir_dereference_variable * const deref_var =
inner_array->array->as_dereference_variable()) {
if (this->shader_type == GL_GEOMETRY_SHADER &&
deref_var->var->mode == ir_var_shader_in) {
deref_var->var->data.mode == ir_var_shader_in) {
/* foo is a geometry shader input, so i is the vertex, and j the
* part of the input we're accessing.
*/
......@@ -263,7 +263,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir)
ir->array->as_dereference_variable()) {
/* ir => foo[i], where foo is a variable. */
if (this->shader_type == GL_GEOMETRY_SHADER &&
deref_var->var->mode == ir_var_shader_in) {
deref_var->var->data.mode == ir_var_shader_in) {
/* foo is a geometry shader input, so i is the vertex, and we're
* accessing the entire input.
*/
......
......@@ -752,8 +752,8 @@ ir_validate::visit_enter(ir_call *ir)
printf("ir_call parameter type mismatch:\n");
goto dump_ir;
}
if (formal_param->mode == ir_var_function_out
|| formal_param->mode == ir_var_function_inout) {
if (formal_param->data.mode == ir_var_function_out
|| formal_param->data.mode == ir_var_function_inout) {
if (!actual_param->is_lvalue()) {
printf("ir_call out/inout parameters must be lvalues:\n");
goto dump_ir;
......
......@@ -60,7 +60,7 @@ struct interface_block_definition
if (var->type->is_array())
array_size = var->type->length;
}
explicitly_declared = (var->how_declared != ir_var_declared_implicitly);
explicitly_declared = (var->data.how_declared != ir_var_declared_implicitly);
}
/**
......@@ -270,7 +270,7 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog,
continue;
interface_block_definitions *definitions;
switch (var->mode) {
switch (var->data.mode) {
case ir_var_shader_in:
definitions = &in_interfaces;
break;
......@@ -298,7 +298,7 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog,
*/
definitions->store(def);
} else if (!intrastage_match(prev_def, &def,
(ir_variable_mode) var->mode)) {
(ir_variable_mode) var->data.mode)) {
linker_error(prog, "definitions of interface block `%s' do not"
" match\n", iface_type->name);
return;
......@@ -318,7 +318,7 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog,
/* Add input interfaces from the consumer to the symbol table. */
foreach_list(node, consumer->ir) {
ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var || !var->get_interface_type() || var->mode != ir_var_shader_in)
if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_in)
continue;
definitions.store(interface_block_definition(var));
......@@ -327,7 +327,7 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog,
/* Verify that the producer's output interfaces match. */
foreach_list(node, producer->ir) {
ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var || !var->get_interface_type() || var->mode != ir_var_shader_out)
if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_out)
continue;
interface_block_definition *consumer_def =
......@@ -361,7 +361,7 @@ validate_interstage_uniform_blocks(struct gl_shader_program *prog,
const gl_shader *stage = stages[i];
foreach_list(node, stage->ir) {
ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var || !var->get_interface_type() || var->mode != ir_var_uniform)
if (!var || !var->get_interface_type() || var->data.mode != ir_var_uniform)
continue;
interface_block_definition *old_def =
......
......@@ -224,7 +224,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog)
foreach_list(node, shader->ir) {
ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (!var || var->mode != ir_var_uniform)
if (!var || var->data.mode != ir_var_uniform)
continue;
if (!mem_ctx)
......
......@@ -637,7 +637,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader)
if ((var == NULL) || !var->is_in_uniform_block())
continue;
assert(var->mode == ir_var_uniform);
assert(var->data.mode == ir_var_uniform);
if (var->is_interface_instance()) {
var->location = 0;
......@@ -767,7 +767,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog)
foreach_list(node, sh->ir) {
ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->mode != ir_var_uniform))
if ((var == NULL) || (var->data.mode != ir_var_uniform))
continue;
/* FINISHME: Update code to process built-in uniforms!
......@@ -818,7 +818,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog)
foreach_list(node, prog->_LinkedShaders[i]->ir) {
ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->mode != ir_var_uniform))
if ((var == NULL) || (var->data.mode != ir_var_uniform))
continue;
/* FINISHME: Update code to process built-in uniforms!
......
......@@ -129,7 +129,7 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
return;
}
if (input->interpolation != output->interpolation) {
if (input->data.interpolation != output->data.interpolation) {
linker_error(prog,
"%s shader output `%s' specifies %s "
"interpolation qualifier, "
......@@ -137,9 +137,9 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
"interpolation qualifier\n",
_mesa_glsl_shader_target_name(producer_type),
output->name,
interpolation_string(output->interpolation),
interpolation_string(output->data.interpolation),
_mesa_glsl_shader_target_name(consumer_type),
interpolation_string(input->interpolation));
interpolation_string(input->data.interpolation));
return;
}
}
......@@ -155,11 +155,11 @@ cross_validate_front_and_back_color(struct gl_shader_program *prog,
GLenum consumer_type,
GLenum producer_type)
{
if (front_color != NULL && front_color->assigned)
if (front_color != NULL && front_color->data.assigned)
cross_validate_types_and_qualifiers(prog, input, front_color,
consumer_type, producer_type);
if (back_color != NULL && back_color->assigned)
if (back_color != NULL && back_color->data.assigned)
cross_validate_types_and_qualifiers(prog, input, back_color,
consumer_type, producer_type);
}
......@@ -178,7 +178,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
foreach_list(node, producer->ir) {
ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->mode != ir_var_shader_out))
if ((var == NULL) || (var->data.mode != ir_var_shader_out))
continue;
parameters.add_variable(var);
......@@ -196,10 +196,10 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
foreach_list(node, consumer->ir) {
ir_variable *const input = ((ir_instruction *) node)->as_variable();
if ((input == NULL) || (input->mode != ir_var_shader_in))
if ((input == NULL) || (input->data.mode != ir_var_shader_in))
continue;
if (strcmp(input->name, "gl_Color") == 0 && input->used) {
if (strcmp(input->name, "gl_Color") == 0 && input->data.used) {
const ir_variable *const front_color =
parameters.get_variable("gl_FrontColor");
......@@ -209,7 +209,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
cross_validate_front_and_back_color(prog, input,
front_color, back_color,
consumer->Type, producer->Type);
} else if (strcmp(input->name, "gl_SecondaryColor") == 0 && input->used) {
} else if (strcmp(input->name, "gl_SecondaryColor") == 0 && input->data.used) {
const ir_variable *const front_color =
parameters.get_variable("gl_FrontSecondaryColor");
......@@ -766,12 +766,12 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
*/
producer_var->data.centroid = false;
producer_var->data.sample = false;
producer_var->interpolation = INTERP_QUALIFIER_FLAT;
producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
if (consumer_var) {
consumer_var->data.centroid = false;
consumer_var->data.sample = false;
consumer_var->interpolation = INTERP_QUALIFIER_FLAT;
consumer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
}
}
......@@ -889,7 +889,7 @@ varying_matches::compute_packing_class(ir_variable *var)
*/
unsigned packing_class = var->data.centroid | (var->data.sample << 1);
packing_class *= 4;
packing_class += var->interpolation;
packing_class += var->data.interpolation;
return packing_class;
}
......@@ -947,7 +947,7 @@ is_varying_var(GLenum shaderType, const ir_variable *var)
{
/* Only fragment shaders will take a varying variable as an input */
if (shaderType == GL_FRAGMENT_SHADER &&
var->mode == ir_var_shader_in) {
var->data.mode == ir_var_shader_in) {
switch (var->location) {