llvmpipe: Check when a shader does not satisfy 0 < imm < 1.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
James Benton
2012-04-25 11:19:06 +01:00
committed by José Fonseca
parent c426e63aa0
commit 9bc58d941a
2 changed files with 11 additions and 2 deletions
@@ -121,6 +121,11 @@ struct lp_tgsi_info
*/
unsigned indirect_textures:1;
/*
* Whether any immediate values are outside the range of 0 and 1
*/
unsigned unclamped_immediates:1;
/*
* Texture opcode description. Aimed at detecting and described direct
* texture opcodes.
@@ -442,8 +442,12 @@ lp_build_tgsi_info(const struct tgsi_token *tokens,
assert(size <= 4);
if (ctx.num_imms < Elements(ctx.imm)) {
for (chan = 0; chan < size; ++chan) {
ctx.imm[ctx.num_imms][chan] =
parse.FullToken.FullImmediate.u[chan].Float;
float value = parse.FullToken.FullImmediate.u[chan].Float;
ctx.imm[ctx.num_imms][chan] = value;
if (value < 0.0f || value > 1.0f) {
info->unclamped_immediates = TRUE;
}
}
++ctx.num_imms;
}