On Wed, Jul 11, 2012 at 4:23 PM, Jose Fonseca <jfons...@vmware.com> wrote: > > When NativeIntegers is FALSE, Mesa generates this VS: > > DCL SV[0], INSTANCEID > ... > ARL ADDR[0].x, SV[0].xxxx > > If INSTANCEID is an integer this is wrong, as it is reading a float where > there's an integer. (e.g., for INSTANCEID =1 ARRD[0] would have > round(0.0000000001) zero). > > But, if I modify mesa statetracker to insert the U2F as necessary evertyhing > will work as expected > > DCL SV[0], INSTANCEID > ... > U2F TEMP[0].x, SV[0].xxxx > ARL ADDR[0].x, TEMP[0].xxxx > > This is essencially what Olivier patch did, but without guessing. Mesa state > tracker can known everything it needs to do the "right thing", i.e., > INSTANCEID is integer.
I see. However if PIPE_SHADER_CAP_INTEGERS is 0, I2F and U2F are unsupported instructions. The proper solution would be to add the type after the system value declaration if you want unambiguous TGSI shaders: DCL SV[0], INSTANCEID, FLOAT or Draw could use pipe->get_shader_param(PIPE_SHADER_CAP_INTEGERS) to see what the expected type is. Marek _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev