> Regardless of whether you macro-ized the emulation check for performance > of esthetics, the "what compiler wouldn't inline that" train of thought > that ensued reminds that these checks are extremely non-performant[1] > relative to what the gl function call would be un-modified. So, note to > mythical future person that inexplicably wants to use these glIndex > functions in a performance-sensitive context: A TLS-based > __vgl_isContextOverlay and __vgl_isContextColorIndex set at MakeCurrent > time would be a path to avoid that. Meanwhile in the real world nobody > cares.
I come from the old school, so I tend to program in ways that don't rely on compilers doing the right thing, because it's been my experience that some don't. :) My first forays into C++ programming were in the Borland C++/TurboC days on 16-bit PC's (I won't even mention my first forays into C programming using SAS/C on AmigaOS. Oops. I guess I just did.) C++ function calls were not cheap back then, and automatic inlining was either non-existent or rare, so I have a natural distrust of optimization algorithms in modern compilers. I would rather make sure the compiler knows what I want. All of the performance problems I've run into lately with clang have proven that my distrust is not misplaced ... Long story, but basically compiling libjpeg-turbo with clang makes it instantly 20% slower than compiling it with GCC, even though I've gone to great lengths in that code to manually inline the performance-critical inner loops. Kids today and their yaya music... Get off my lawn. > [1] Bearing in mind that when used millions of times a frame merely > adding a few clock cycles significantly impacts performance. I agree with you, but the hell of it is, I can't actually put my finger on a single commercial application that has ever used color index rendering in VirtualGL. I'd love it if someone would write me and say "color index rendering in VirtualGL saved my pet hedgehog from a fate worse than death", but as far as I know, the only purpose of that feature was to make Sun's marketing department happy. In oil & gas, where this stuff all originated, color index rendering was once a useful technique for changing the colormap of seismic data without re-drawing the whole scene (which could have been expensive, because there were often horizons and other complex geometries drawn through the data.) But by the time color index support was actually implemented in VGL (2006), I'm pretty sure that even those old apps had moved or were moving to RGBA rendering. I cannot conceive of any reason why an application would want to do per-vertex color using color index rendering, and I could definitely not conceive of any reason why an application would still want to do that in 2014, but let me know if you run into one, and we'll deal with it as needed. ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ VirtualGL-Devel mailing list VirtualGL-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtualgl-devel