Speedig up OpenGL with Assembler...

I’ve heard from a friend that there are some kind of assembler code that could speed up the drawing. In other words speeding up the FPS!
PLEASE HELP!!!
(There is no problems with running the app on my PIII -700 with a GeForce2 GTS, but I want to be able to run in on a “not so hot” graphic card)

Well, afaik, you won’t be able to override parts of OpenGL with your own assembler routines… Anyway, most of the implementation goes through you gfx card drivers and I am pretty sure driver writers do their best to ensure speed…

The thing your friend might have meant could be the fact that you can use assembler to speed up the other parts of your program: I remember seeing someone posting a routine to calculate fast square roots using MMX. Much much much faster than sqrt…

I don’t think you can optimize the rendering with assembler though…

Regards.

Eric

Of course you can not optimize OpenGL,but you
can optimize your critical code,transformations,culling,standart math lib,your matrix/vector lib etc using Intel’s SSE(2), Amd’s 3dnow! or even standart
FPU instruction set,but MMX… I’m not sure
but I think MMX is totaly obsolete.

You should benchmark, which parts of your app needs the most processor time. If you have many calculations in your code, then assembler could be faster. If you have many triangles to display, then it relies to the gfx-driver.

I think that the best optimisation today should be the use of T&L, no more CPU heavy transformations,heavy shading (attenuations etc…) , heavy vertice alimentation through the Bus and finally no more headaches with “Disco” SSE & 3DNOw implementations which cost a lot of workin time and just speed up a little bit software transformations (if your code is already nice optimised with classic FPU… So what? only clipping should be done with CPU today so that’s my point of view do your GPU work 100% of the rastertime and let your CPU compute other ‘more’ interesting things
Of course, it’s only true for latest T&L based boards but it’s the future architecture for all 3D boards!

Do you have any experience programming assembler? If you don’t you probably won’t beat the compiler anyway, so you might as well go for algorithmic optimizations instead.

Visit AMD’s and Intel’s homepages and download their optimized examples and add-ons. Why start messing with assembler again, when the code is already out there.

> I’m not sure but I think MMX is totaly obsolete.

Actually, it’s alive and kicking. It’s very useful for things that need to work on 8, 16 or 32 bit integer quantities, such as sound code. Also, if you’re planning on sending OpenGL 16-bit GLshort vertex coordinates, but need to operate on them ahead of time, MMX fits the bill.

MMX is also good for texture manipulation. Stuff like box filtering images for mip-mapping can really be sped up through MMX.

j