diff options
author | Tapani Pälli <[email protected]> | 2013-12-12 15:08:59 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2013-12-12 17:28:11 +0200 |
commit | 447bb9029f7e03b03e507053b9f63536d8fc74ac (patch) | |
tree | cda0ab8ca2637995300aa4544e0cf733bfead1da /src/glsl/tests | |
parent | 33ee2c67c0a4e8f2fefbf37dacabd14918060af5 (diff) |
glsl: move variables in to ir_variable::data, part II
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 <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/tests')
-rw-r--r-- | src/glsl/tests/builtin_variable_test.cpp | 76 | ||||
-rw-r--r-- | src/glsl/tests/invalidate_locations_test.cpp | 96 |
2 files changed, 86 insertions, 86 deletions
diff --git a/src/glsl/tests/builtin_variable_test.cpp b/src/glsl/tests/builtin_variable_test.cpp index 6164e10a428..63949ee262e 100644 --- a/src/glsl/tests/builtin_variable_test.cpp +++ b/src/glsl/tests/builtin_variable_test.cpp @@ -113,8 +113,8 @@ common_builtin::uniforms_and_system_values_dont_have_explicit_location() if (var->data.mode != ir_var_uniform && var->data.mode != ir_var_system_value) continue; - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); } } @@ -127,8 +127,8 @@ common_builtin::constants_are_constant() if (var->data.mode != ir_var_auto) continue; - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); EXPECT_TRUE(var->data.read_only); } } @@ -179,10 +179,10 @@ TEST_F(vertex_builtin, inputs_have_explicit_location) if (var->data.mode != ir_var_shader_in) continue; - EXPECT_TRUE(var->explicit_location); - EXPECT_NE(-1, var->location); - EXPECT_GT(VERT_ATTRIB_GENERIC0, var->location); - EXPECT_EQ(0u, var->location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_NE(-1, var->data.location); + EXPECT_GT(VERT_ATTRIB_GENERIC0, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); } } @@ -194,17 +194,17 @@ TEST_F(vertex_builtin, outputs_have_explicit_location) if (var->data.mode != ir_var_shader_out) continue; - EXPECT_TRUE(var->explicit_location); - EXPECT_NE(-1, var->location); - EXPECT_GT(VARYING_SLOT_VAR0, var->location); - EXPECT_EQ(0u, var->location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_NE(-1, var->data.location); + EXPECT_GT(VARYING_SLOT_VAR0, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); /* Several varyings only exist in the fragment shader. Be sure that no * outputs with these locations exist. */ - EXPECT_NE(VARYING_SLOT_PNTC, var->location); - EXPECT_NE(VARYING_SLOT_FACE, var->location); - EXPECT_NE(VARYING_SLOT_PRIMITIVE_ID, var->location); + EXPECT_NE(VARYING_SLOT_PNTC, var->data.location); + EXPECT_NE(VARYING_SLOT_FACE, var->data.location); + EXPECT_NE(VARYING_SLOT_PRIMITIVE_ID, var->data.location); } } @@ -247,15 +247,15 @@ TEST_F(fragment_builtin, inputs_have_explicit_location) if (var->data.mode != ir_var_shader_in) continue; - EXPECT_TRUE(var->explicit_location); - EXPECT_NE(-1, var->location); - EXPECT_GT(VARYING_SLOT_VAR0, var->location); - EXPECT_EQ(0u, var->location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_NE(-1, var->data.location); + EXPECT_GT(VARYING_SLOT_VAR0, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); /* Several varyings only exist in the vertex / geometry shader. Be sure * that no inputs with these locations exist. */ - EXPECT_TRUE(_mesa_varying_slot_in_fs((gl_varying_slot) var->location)); + EXPECT_TRUE(_mesa_varying_slot_in_fs((gl_varying_slot) var->data.location)); } } @@ -267,15 +267,15 @@ TEST_F(fragment_builtin, outputs_have_explicit_location) if (var->data.mode != ir_var_shader_out) continue; - EXPECT_TRUE(var->explicit_location); - EXPECT_NE(-1, var->location); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_NE(-1, var->data.location); /* gl_FragData[] has location FRAG_RESULT_DATA0. Locations beyond that * are invalid. */ - EXPECT_GE(FRAG_RESULT_DATA0, var->location); + EXPECT_GE(FRAG_RESULT_DATA0, var->data.location); - EXPECT_EQ(0u, var->location_frac); + EXPECT_EQ(0u, var->data.location_frac); } } @@ -320,8 +320,8 @@ TEST_F(geometry_builtin, inputs_have_explicit_location) if (var->is_interface_instance()) { EXPECT_STREQ("gl_in", var->name); - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); ASSERT_TRUE(var->type->is_array()); @@ -342,17 +342,17 @@ TEST_F(geometry_builtin, inputs_have_explicit_location) EXPECT_NE(VARYING_SLOT_FACE, input->location); } } else { - EXPECT_TRUE(var->explicit_location); - EXPECT_NE(-1, var->location); - EXPECT_GT(VARYING_SLOT_VAR0, var->location); - EXPECT_EQ(0u, var->location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_NE(-1, var->data.location); + EXPECT_GT(VARYING_SLOT_VAR0, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); } /* Several varyings only exist in the fragment shader. Be sure that no * inputs with these locations exist. */ - EXPECT_NE(VARYING_SLOT_PNTC, var->location); - EXPECT_NE(VARYING_SLOT_FACE, var->location); + EXPECT_NE(VARYING_SLOT_PNTC, var->data.location); + EXPECT_NE(VARYING_SLOT_FACE, var->data.location); } } @@ -364,16 +364,16 @@ TEST_F(geometry_builtin, outputs_have_explicit_location) if (var->data.mode != ir_var_shader_out) continue; - EXPECT_TRUE(var->explicit_location); - EXPECT_NE(-1, var->location); - EXPECT_GT(VARYING_SLOT_VAR0, var->location); - EXPECT_EQ(0u, var->location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_NE(-1, var->data.location); + EXPECT_GT(VARYING_SLOT_VAR0, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); /* Several varyings only exist in the fragment shader. Be sure that no * outputs with these locations exist. */ - EXPECT_NE(VARYING_SLOT_PNTC, var->location); - EXPECT_NE(VARYING_SLOT_FACE, var->location); + EXPECT_NE(VARYING_SLOT_PNTC, var->data.location); + EXPECT_NE(VARYING_SLOT_FACE, var->data.location); } } diff --git a/src/glsl/tests/invalidate_locations_test.cpp b/src/glsl/tests/invalidate_locations_test.cpp index f70dc6f2626..997592fc940 100644 --- a/src/glsl/tests/invalidate_locations_test.cpp +++ b/src/glsl/tests/invalidate_locations_test.cpp @@ -64,20 +64,20 @@ TEST_F(invalidate_locations, simple_vertex_in_generic) "a", ir_var_shader_in); - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); - var->location = VERT_ATTRIB_GENERIC0; - var->location_frac = 2; + var->data.location = VERT_ATTRIB_GENERIC0; + var->data.location_frac = 2; ir.push_tail(var); link_invalidate_variable_locations(&ir); - EXPECT_EQ(-1, var->location); - EXPECT_EQ(0u, var->location_frac); - EXPECT_FALSE(var->explicit_location); - EXPECT_TRUE(var->is_unmatched_generic_inout); + EXPECT_EQ(-1, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_TRUE(var->data.is_unmatched_generic_inout); } TEST_F(invalidate_locations, explicit_location_vertex_in_generic) @@ -87,20 +87,20 @@ TEST_F(invalidate_locations, explicit_location_vertex_in_generic) "a", ir_var_shader_in); - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); - var->location = VERT_ATTRIB_GENERIC0; - var->explicit_location = true; + var->data.location = VERT_ATTRIB_GENERIC0; + var->data.explicit_location = true; ir.push_tail(var); link_invalidate_variable_locations(&ir); - EXPECT_EQ(VERT_ATTRIB_GENERIC0, var->location); - EXPECT_EQ(0u, var->location_frac); - EXPECT_TRUE(var->explicit_location); - EXPECT_FALSE(var->is_unmatched_generic_inout); + EXPECT_EQ(VERT_ATTRIB_GENERIC0, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_FALSE(var->data.is_unmatched_generic_inout); } TEST_F(invalidate_locations, explicit_location_frac_vertex_in_generic) @@ -110,21 +110,21 @@ TEST_F(invalidate_locations, explicit_location_frac_vertex_in_generic) "a", ir_var_shader_in); - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); - var->location = VERT_ATTRIB_GENERIC0; - var->location_frac = 2; - var->explicit_location = true; + var->data.location = VERT_ATTRIB_GENERIC0; + var->data.location_frac = 2; + var->data.explicit_location = true; ir.push_tail(var); link_invalidate_variable_locations(&ir); - EXPECT_EQ(VERT_ATTRIB_GENERIC0, var->location); - EXPECT_EQ(2u, var->location_frac); - EXPECT_TRUE(var->explicit_location); - EXPECT_FALSE(var->is_unmatched_generic_inout); + EXPECT_EQ(VERT_ATTRIB_GENERIC0, var->data.location); + EXPECT_EQ(2u, var->data.location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_FALSE(var->data.is_unmatched_generic_inout); } TEST_F(invalidate_locations, vertex_in_builtin) @@ -134,20 +134,20 @@ TEST_F(invalidate_locations, vertex_in_builtin) "gl_Vertex", ir_var_shader_in); - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); - var->location = VERT_ATTRIB_POS; - var->explicit_location = true; + var->data.location = VERT_ATTRIB_POS; + var->data.explicit_location = true; ir.push_tail(var); link_invalidate_variable_locations(&ir); - EXPECT_EQ(VERT_ATTRIB_POS, var->location); - EXPECT_EQ(0u, var->location_frac); - EXPECT_TRUE(var->explicit_location); - EXPECT_FALSE(var->is_unmatched_generic_inout); + EXPECT_EQ(VERT_ATTRIB_POS, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_FALSE(var->data.is_unmatched_generic_inout); } TEST_F(invalidate_locations, simple_vertex_out_generic) @@ -157,19 +157,19 @@ TEST_F(invalidate_locations, simple_vertex_out_generic) "a", ir_var_shader_out); - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); - var->location = VARYING_SLOT_VAR0; + var->data.location = VARYING_SLOT_VAR0; ir.push_tail(var); link_invalidate_variable_locations(&ir); - EXPECT_EQ(-1, var->location); - EXPECT_EQ(0u, var->location_frac); - EXPECT_FALSE(var->explicit_location); - EXPECT_TRUE(var->is_unmatched_generic_inout); + EXPECT_EQ(-1, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_TRUE(var->data.is_unmatched_generic_inout); } TEST_F(invalidate_locations, vertex_out_builtin) @@ -179,18 +179,18 @@ TEST_F(invalidate_locations, vertex_out_builtin) "gl_FrontColor", ir_var_shader_out); - EXPECT_FALSE(var->explicit_location); - EXPECT_EQ(-1, var->location); + EXPECT_FALSE(var->data.explicit_location); + EXPECT_EQ(-1, var->data.location); - var->location = VARYING_SLOT_COL0; - var->explicit_location = true; + var->data.location = VARYING_SLOT_COL0; + var->data.explicit_location = true; ir.push_tail(var); link_invalidate_variable_locations(&ir); - EXPECT_EQ(VARYING_SLOT_COL0, var->location); - EXPECT_EQ(0u, var->location_frac); - EXPECT_TRUE(var->explicit_location); - EXPECT_FALSE(var->is_unmatched_generic_inout); + EXPECT_EQ(VARYING_SLOT_COL0, var->data.location); + EXPECT_EQ(0u, var->data.location_frac); + EXPECT_TRUE(var->data.explicit_location); + EXPECT_FALSE(var->data.is_unmatched_generic_inout); } |