Sgx Floating Point?


lulzfish

Pandora Defense Squad
Joined
Jan 14, 2009
Messages
3,502
Website
troyanonymous.homelinux.com
I see from the OpenGL ES specification that there's a fixed-point type defined, whereas most desktop OGL stuff uses either integers or floats.

I've also heard that the Pandora's CPU doesn't have a great floating-point unit, and has to use the NEON which is a bit more complicated and probably much slower, compared to fixed-point math, than on a desktop platform.

So I'm asking whether the Pandora's GPU will be able to handle floating-point math? [for matrices, etc.] It appears that for a lot of shading stuff, you can use 16.16 fixed or floating point, but desktop GLSL mostly uses floats, and I want to know now whether I should try to set up matrices, etc. as fixed- or floating-point.

It seems OGLES requires the application to handle matrices, and I'm trying to figure out how exactly to do that.

edit: Or if somebody could just link to the SGX's specifications, that would help. I saw them on here somewhere once, but I can't remember where and it's much simpler to just ask the forum. >_>
 
Last edited by a moderator:
lulzfish said:
I've also heard that the Pandora's CPU doesn't have a great floating-point unit, and has to use the NEON which is a bit more complicated and probably much slower, compared to fixed-point math, than on a desktop platform.
... no, NEON will not be slower than fixed point. It'll be a lot faster if you do it right.

Shaders have nothing to do with the CPU. SGX uses floats.
 
Last edited by a moderator:
Well, I knew it was unrelated, but I wondered for some reason whether there would be any performance difference between floats and fixed on the GPU.

So floating-point on NEON will be faster than fixed-point? I hope it's easy to use, it sounds cool.
 
semantically, GLSL shaders currently do single-precision floats, and up-to-16-bit ints (singed). OTOH, gpu fauna support single, double (cant think of any particular gpu that does that right now, but soon they will) and half precision floats, and 8- and 16-bit ints. some of them do fixed-point too.. actually some of them do _only_ fixed point *shakes fist at intel*

SGX, on its turn, does sp fp, 8 and 16bit ints (signed), and bools (natively). a quick glance a the supported data types could show you that for most spatial arithmetics (matrices in particular) tou will likely need to stick with sp floats, even though you could, in theory, try do something with ints, but you need to have some rare luxury re your spatial ranges.
 
'lulzfish' said:
Well, I knew it was unrelated, but I wondered for some reason whether there would be any performance difference between floats and fixed on the GPU.

So floating-point on NEON will be faster than fixed-point? I hope it's easy to use, it sounds cool.
Do you know how to properly vectorize your equations? ;)
 
Last edited by a moderator:
Archaemic said:
Do you know how to properly vectorize your equations? ;)
No, but I have a vague idea of what vector processors do, and I expect most of the vector / matrix stuff I need to do for OpenGL will involve equations OF vectors, so it shouldn't be hard to understand.
 
Last edited by a moderator:
Short: Don't use GL_FIXED.

Long: Don't use GL_FIXED unless you are using dynamically generated vertex data and you're absolutely sure the CPU can generate it faster as 16.16 fixed point than another suitable type (which may be float, half-float, or even 8/16 bit integers with scale/bias). 16.16 fixed point vertex data saves nothing in terms of vertex bandwidth over floats, and it requires a conversion step on the GPU.

Don't underestimate the precision of 16-bit shorts: Representing a model that spans 100m on one axis in real world terms, shorts have a resolution of ~1.5mm!
 
Last edited by a moderator:
Back
Top