From 7e04227f3967fd4c4dd7a088cb42197d916925a5 Mon Sep 17 00:00:00 2001 From: Vadim Girlin Date: Tue, 2 Apr 2013 19:32:26 +0400 Subject: [PATCH] r600g: fix range handling for tgsi input declarations v2 Signed-off-by: Vadim Girlin --- src/gallium/drivers/r600/r600_shader.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 57cf17b1734..e74ed54443d 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -893,12 +893,12 @@ static int select_twoside_color(struct r600_shader_ctx *ctx, int front, int back static int tgsi_declaration(struct r600_shader_ctx *ctx) { struct tgsi_full_declaration *d = &ctx->parse.FullToken.FullDeclaration; - unsigned i; - int r; + int r, i, j, count = d->Range.Last - d->Range.First + 1; switch (d->Declaration.File) { case TGSI_FILE_INPUT: - i = ctx->shader->ninput++; + i = ctx->shader->ninput; + ctx->shader->ninput += count; ctx->shader->input[i].name = d->Semantic.Name; ctx->shader->input[i].sid = d->Semantic.Index; ctx->shader->input[i].interpolate = d->Interp.Interpolate; @@ -922,6 +922,10 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx) return r; } } + for (j = 1; j < count; ++j) { + ctx->shader->input[i + j] = ctx->shader->input[i]; + ctx->shader->input[i + j].gpr += j; + } break; case TGSI_FILE_OUTPUT: i = ctx->shader->noutput++; -- 2.30.2