summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJulien Isorce <[email protected]>2017-03-16 14:25:24 +0000
committerJulien Isorce <[email protected]>2017-03-21 18:14:26 +0000
commitad13bd2e51a5dc01b0f8a0eb927022f0deac0a0c (patch)
tree1f8f0ad557b5e26d7edf960678e15f91bf297df7 /src/gallium/drivers
parent020b3f0c4696af198af2b058ec1800723544a2ec (diff)
r600_shader.c: check returned value of eg_get_interpolator_index
Like done in another place in that same file. CID 1250588 Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r600/r600_shader.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index e97aa65141b..844650220b4 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1113,7 +1113,8 @@ static int allocate_system_value_inputs(struct r600_shader_ctx *ctx, int gpr_off
interpolate = ctx->info.input_interpolate[inst->Src[0].Register.Index];
k = eg_get_interpolator_index(interpolate, location);
- ctx->eg_interpolators[k].enabled = true;
+ if (k >= 0)
+ ctx->eg_interpolators[k].enabled = true;
}
} else if (parse.FullToken.Token.Type == TGSI_TOKEN_TYPE_DECLARATION) {
struct tgsi_full_declaration *d = &parse.FullToken.FullDeclaration;
@@ -1209,7 +1210,8 @@ static int evergreen_gpr_count(struct r600_shader_ctx *ctx)
interpolate = ctx->info.input_interpolate[inst->Src[0].Register.Index];
k = eg_get_interpolator_index(interpolate, location);
- ctx->eg_interpolators[k].enabled = true;
+ if (k >= 0)
+ ctx->eg_interpolators[k].enabled = true;
}
}
}