It would be nice if we could do bitwise logical texture lookups in a fragment shader. This would be useful for terrain. Most terrain algorithms store four terrain layers in the channels of an RGBA texture, so you're using 8 bytes per pixel. If each byte was a bitwise value, you could store 32 texture layers in an RGBA texture, instead of just 4. Each pixel would just have a "true" or "false" value for each terrain layer, but that's a tradeoff I would be happy making given the memory savings.
Code ://Check if texture contains flag '8': float alpha = textureAnd(texture0,texcoords,8);
When using linear filtering, it would return a value between 0.0 and 1.0, depending on what the results from the closest pixels were. (I tried doing this in a fragment shader with my own logic but it was too slow to be practical.)



Reply With Quote
You can already do bitwise logic in the shader and I'm with Alfonse on this, there is no guarantee that a hardware implementation will be faster. 