On Thu, Nov 22, 2012 at 5:44 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
static inline float conv_i2_to_norm_float(struct gl_context *ctx, int i2)<br>
{<br>
struct attr_bits_2 val;<br>
val.x = i2;<br>
- return (2.0F * (float)val.x + 1.0F) * (1.0F / 3.0F);<br>
+<br>
+ if (_mesa_is_gles3(ctx) ||<br>
+ (ctx->API == API_OPENGL_CORE && ctx->Version >= 42)) {<br>
+ /* Equation 2.3 above. */<br>
+ return (float) val.x;<br></blockquote><div><br>This needs to be MAX2((float)val.x, -1.0) -- otherwise 0b10 maps to -2.<br><br>-- Chris<br></div></div></div>