Rune Petersen wrote:
> I hit a problem constructing this:
> 
> - In order to do range mapping in the vertex shader (if I so choose)
> I will need a constant (0.5), but how to add it?
I think this might work similar to what is used for position invariant 
programs, instead of using _mesa_add_state_reference you could try 
_mesa_add_named_parameter. Otherwise, you could always "construct" 0.5 
in the shader itself, since you always have the constants 0 and 1 
available thanks to the powerful swizzling capabilities, though 
surprsingly it seems somewhat complicated. Either use 2 instructions 
(ADD 1+1, RCP). Or try EX2/EXP though I'm not sure about performance of 
these, but I guess the approximated EXP should do (2^-1).

Roland

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to