shader: remove dump_ctx arg from allocate_temp_range

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Ryan Neph 4 years ago
parent b9a78c61da
commit 13d755f146
  1. 18
      src/vrend_shader.c

@ -684,19 +684,19 @@ static void emit_ver_extf(struct vrend_glsl_strbufs *glsl_strbufs, const char *f
va_end(va); va_end(va);
} }
static bool allocate_temp_range(struct dump_ctx *ctx, int first, int last, static bool allocate_temp_range(struct vrend_temp_range **temp_ranges, uint32_t *num_temp_ranges, int first, int last,
int array_id) int array_id)
{ {
int idx = ctx->num_temp_ranges; int idx = *num_temp_ranges;
ctx->temp_ranges = realloc(ctx->temp_ranges, sizeof(struct vrend_temp_range) * (idx + 1)); *temp_ranges = realloc(*temp_ranges, sizeof(struct vrend_temp_range) * (idx + 1));
if (!ctx->temp_ranges) if (!*temp_ranges)
return false; return false;
ctx->temp_ranges[idx].first = first; (*temp_ranges)[idx].first = first;
ctx->temp_ranges[idx].last = last; (*temp_ranges)[idx].last = last;
ctx->temp_ranges[idx].array_id = array_id; (*temp_ranges)[idx].array_id = array_id;
ctx->num_temp_ranges++; (*num_temp_ranges)++;
return true; return true;
} }
@ -1470,7 +1470,7 @@ iter_declaration(struct tgsi_iterate_context *iter,
} }
break; break;
case TGSI_FILE_TEMPORARY: case TGSI_FILE_TEMPORARY:
if (!allocate_temp_range(ctx, decl->Range.First, decl->Range.Last, if (!allocate_temp_range(&ctx->temp_ranges, &ctx->num_temp_ranges, decl->Range.First, decl->Range.Last,
decl->Array.ArrayID)) decl->Array.ArrayID))
return false; return false;
break; break;

Loading…
Cancel
Save