glsl: Remove pointless uses of glsl_type::get_base_type().

These are effectively doing type->get_base_type()->base_type, which is
equivalent to type->base_type.  Just use that, as it's simpler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Kenneth Graunke
2011-10-25 12:55:54 -07:00
parent 1e1a7011ee
commit 3b4d2eac60
2 changed files with 3 additions and 7 deletions

View File

@@ -368,8 +368,6 @@ void ir_print_visitor::visit(ir_assignment *ir)
void ir_print_visitor::visit(ir_constant *ir)
{
const glsl_type *const base_type = ir->type->get_base_type();
printf("(constant ");
print_type(ir->type);
printf(" (");
@@ -390,7 +388,7 @@ void ir_print_visitor::visit(ir_constant *ir)
for (unsigned i = 0; i < ir->type->components(); i++) {
if (i != 0)
printf(" ");
switch (base_type->base_type) {
switch (ir->type->base_type) {
case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break;
case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break;
case GLSL_TYPE_FLOAT: printf("%f", ir->value.f[i]); break;