PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Intel Graphics Performance Primitives library

I attended an Intel 3D Graphics for XScale talk today at the Game Developer Conference in San Jose. Intel released a beta of their Graphics Performance Primitives on their website this week. Although they state that this is for their two new XScale chips, it will work on a StrongARM.

http://developer.intel.com/design/pca/applicationsprocessors/swsup/gppv1b1.htm
Does this definately work on arm pocketpc?
What is the performance like on arm pc?

not asking anyone specifically, just would be interesting to find out even if I have to look at it myself(v.busy though).

Jim.
Conan · 22 Mar 2002, 10:50 UTC — Intel's 3d primatives for XScale
I read through the PDF docs & no mention of the code running on existing ARM. Says that it works with the current embedded VC++ 3 though & is optimised for the new XScale processors. I've downloaded the code ( just under a meg ) to have a look see.

I've saved up for my next pda so hopefully with the first XScale machines expected in a few months I will be able to dabble even if the routines don't work. If they do run then existing 3D engine developers will have a head start in getting their engines ready for the future.

Same error as Jim below. I need to read the release notes
hmmm doesn't seem to install, command prompt pops up then disapears, run from command prompt and says 'Program too big to fit in memory' which is a lie. I'm running a bad ass machine with win2000!

Jim
The Intel engineer assured me it would work on StrongARM, and he showed a few demos running on an iPaq 3650.

I haven't tried to install it myself as I'm out of town with only a 33K modem connection in my hotel. If no one can install this, I'll track down the Intel engineer and ask him if he's aware of any problems.
Conan · 22 Mar 2002, 18:45 UTC — Can't install yet
That's good news Digby. I did try playing with the DOS memory settings ( the install looks DOSsey ) but it still wont go. I will put it off my W2k laptop onto my XP machine after dinner & see what happens.

I did note that there are some sample apps included so they may give us a start.
OK, I've downloaded the software and I have the same problem on my XP notebook here (Program too large to fit in memory). Just on a hunch, I renamed the executable file as .zip and opened the file as if it were a zip archive. Works like a champ. Run the exe in the zip archive and let me know if you continue to have problems. I'll let the Intel guys know they have a problem with the naming of the file.
simonjacobs · 23 Mar 2002, 00:04 UTC
Hmmm. Sort of interesting, but having read the description pdf I am unsure of how the texture mapping function works. Does it use perspective correction (vital for some circumstances)?

In the end I would probably rather write my own ARM assembler and get the full speed possible from my own algorithms (or rather my versions of other peoples well known algortihms :lol:)

The XScale is REALLY exciting though, as well as the MHz increase the 8x cache should make really great 3d possible.

Simon.
The library is a collection of primitive routines that you would use to write your own 3D API. As far as the texture mapping goes, it only supports RGB565 textures, texture coordinates are 16.16 fixed-point, and it supports additive, modulate, and decal style blending. As far as I can tell it only does point-nearest texture sampling and does not support perspective-correction. The rasterization APIs are implemented not as polygon or triangle based routines, but scanline based.
Conan · 23 Mar 2002, 06:10 UTC — so it's a ZIP
Thanks Digby, good lateral thinking skills on show there. It's working fine now.

I don't see any sample code. I assume they thought there would be when the release notes were created.
The url has changed, and for some reason the website wouldn't redirect me when it said it would. So after some digging:

http://www.intel.com/design/pca/applica ... /gppv1.htm

Dan East
Well, it's been 8 months. So has anyone made use of this library? How about some benchmarks? How is the performance on StrongARM compared to XScale?

Dan East
I am trying to evaluate the IGPP library. However I have found that the documentation is terrible. The library contains no samples, and the internet appears to be void of any technical discussion of the library. The documentation does not indicate the precision to be used for any of the struct members used by the rasterizers (they appear to be 16.16 for the x values). Another example is GPP_RASTER_PARAMS::m_rgba. The docs simply state "denotes the object color (used for flat shading)". The actual format by trial and error is an rgb 565 followed by a short for the alpha (is the alpha fixed point 8.8, or is it integer? what's the range, etc). The docs do not specify the acceptable ranges for values, or what clipping is performed.

Has anyone had any success in using this library? I have gotten it to render flatshaded polys, but it appears to be rendering very far past the end of the line in some cases, overflowing my buffer.

I'm just really surprised that Intel would invest money to have someone create such a library, and release poor documentation and not a single shred of source code or actual usage information.

Dan East
The docs do say that the functions act on color values in 5-6-5 format. Which of their functions actually perform alpha test/blending? I looked over the Rasterization section of their docs and none of them mentioned alpha blending.

Think about this... In most 3D APIs, a value of zero for the alpha channel denotes transparency. There is no method (as least not in the docs) to enable/disable alpha blending, so you're assuming it's always on. OK, so if you only set the 5-6-5 values of that U32 color value for your polygon, the alpha would be zero (transparent). If alpha ere always on, then all of your scanlines would not show up in the frame buffer. But they do! I'm willing to bet that alpha blending isn't supported in the current version of this library.

You could try sending e-mail to the guy who was in charge of the team that wrote it:

gopi.k.kolli@intel.com
The vertex struct (GPP_TLVERTEX_V2F_C4F_T2F) allows you to specify the alpha. I thought I read that it supported it, but after checking I don't see any raster routines that mention it.

I was able to get IGPP rendering in texture mode, but never got the UV right. However the performance should be the same whether or not the UV was 100% correct. I saw marginal, if any, performance improvement over my existing software routines. I was going to have to use my own routines anyway for polys requiring perspective correction.

BTW, check your email.

Dan East
Most likely this was another project that fell victim to the Intel layoffs of the last few years and as such has become unsupported. I do know that the industry response was less then whole-hearted when this was first released. Basically everyone went "Oh, and..."
hi,

i use the fixed-point library which is included in the IGPP. i have to say that it is really well done. it works fast and just as specified.

the documentation of the IGPP is just as all the intel performance libs: very sparse and assumes that you're a pro on the subject.

i will soon start using the texturing part too.
if i find out something interesting about it i'll post it here. unfortunatelly the IGPP code does not run on the emulator nor under real windows. so i'll have to write additional texturing code for those platforms too... :(

does anybody know if the development on the IGPP was really dropped? intel often just doesn't release updates for quite some time...

btw: if you need performance try the intel xscale compiler. i can not tell any details because of NDA but it should soon be released and will change a lot on the performance side of PocketPC devices. :)

bye,
DANIEL
drgoldie wrote:
i use the fixed-point library which is included in the IGPP. i have to say that it is really well done. it works fast and just as specified.


It requires almost trivial programming to create a fixed point library. Literally only a couple dozen lines of code are required. All of the IGPP routines to convert to and from float to fixed point are just macros. Even then they basically just shift or divide.

Dan East
Sergey Chaban · 21 Apr 2003, 02:25 UTC
Straightforward lib is trivial, optimized lib is quite complex (e.g. optimized for XScale like in this case or optimized for general FPU-less RISC machine).
For example, compare their gppDivHP_n_32s routine to naive (32-n).n division implementation [that is (__int32)(((__int64)x << n) / y)].
Intel version is approx. 3 times faster.
However Intel's Inv/Div routines are XScale-only.

SC
I thought IGPP was for both ARM and XScale. So it contains two different sets of routines that are selected at run-time, in order to use XScale-specific optimizations?

Dan East
Sergey Chaban · 21 Apr 2003, 04:35 UTC
If I recall correctly all routines work fine on StrongARM except for Inv/Div (4 routines in total, 2 LowPrecision and 2 HiPrecision).
They throw invalid opcode exception @ CLZ.
i don't think it is trivial to write a really usable fixed point math.

one can see a bad implementation in PocketGL, which uses only 16-bits to be able to do multiplications without leaving the 32-bits range. but 16-bits is just not enough for a lot of applications.

the IGPP allows to use all bits of a 32-bit integer which gives quite some good precision and value range.

i also think it's far from trivial to implement trigonometrical functions quick and accurate...

i was able to speed up a complex and floating point intensive code (image recognition) by a factor of 3.5 by using intel's fixed-point stuff.

i think intel did a good job on this.
i don't know about the rasterization code of the IGPP yet but the math code is really worth trying out.

bye,
DANIEL
rotating about the y axis screws up the rotation-matrix, use this piece of code to solve the problem:
Code:
static void gppMatrix4X4Roty_16_32s(GPP_MATRIX4X4 matrix, I32 angle)
{
I32 s, c;

gppSinHP_16_32s(angle, &s;);
gppCosHP_16_32s(angle, &c;);

matrix[0] = c;
matrix[2] = s;
matrix[8] = -s;
matrix[10] = c;
}
drgoldie wrote:
one can see a bad implementation in PocketGL, which uses only 16-bits to be able to do multiplications without leaving the 32-bits range. but 16-bits is just not enough for a lot of applications.


I wouldn't call that bad, and I certainly wouldn't call it slow. If the reduction in precision during multiplication is good enough for the application then your argument is moot, and it is trivial to produce a fast fixed point library.

drgoldie wrote:
also think it's far from trivial to implement trigonometrical functions quick and accurate...


I have found precision from 0 to 2PI of 4096 units to be more than adequate. It is trivial to create a LUT for most trig routines.

My evaulation of the Intel Graphics Performance Primitives is in regards to using it graphically, not as a simple fixed point math library. Sure, it's a wonderful thing for them to provide such a library for free, but their primary purpose was the rastizers, which are far too limited in their capability.

Finally, many developers (myself included) do the majority of the development using x86 builds. Testing and benchmarking is done on Pocket PCs regularly, but the actual development and "alpha" testing occurs with x86. You would have thought Intel could have at least provided an Intel x86 build of the lib as well. :)

Dan East
just as i said. PocketGL is surely a superb lib if you can live with the limitations. for me the extremely small number range (i think two bits for the integer part) was just a problem. what i wanted to say was: if PocketGL would use the IGPP then it could use a lot larger range of numbers that would be more accurate too.

maybe it would be a little bit slower but i don't think that there is a real limitation on that side. i currently use the standard float-emulation and even this is more or less fast enough for me.
(on the other side i do not develop games...)

i fully agree to the problem that the IGPP rasterizer works only on the real device. i do almost all the work on the PC too and not having the possibility to test there would really be a problem for me...

bye,
DANIEL
considering the only accuracy limitations in fixed point math is where you place the point all one would need to do is add an additional parameter to their macros (like Intel did). I'm not seeing how this is a deciding factor for using a library that prevents testing on x86 and is very platform dependent. The latter 2 being far bigger issues for me.

Just an FYI, I developed a full features Fixed-point class in about 3 hours (mostly tracking down bugs). Very easy code to write.
it depends on what you want to be able to do.
the simple solution is to use 16-bits only at all, so you can multiply such two values without having an overflow in a 32-bits register.

but 16-bits is just to small.
but if you want to allow all 32-bits being used, you'll have to work with numbers as large as 64-bits. this is where things become more tricky.

if you want to support functions like: sin,cos,sqrt, etc. then things become a lot more difficult.

of course i'd apprechiate to have the source code of the lib. but on the other side, having carefully hand-optimized assembler code from intel is nice too...

DANIEL
Hosed wrote:
Just an FYI, I developed a full features Fixed-point class in about 3 hours (mostly tracking down bugs). Very easy code to write.

Hi,

I did that too, but we could debate the "very easy code to write" part ;) Took me several days because I had no ideas what fixed point was, and no clues how to handle sin/cos.

I was wondering if you could give me a few pointers, for the divisions and multiplications operators. What I have is working fine, but I'm using the __int64 type in these functions, and I'm not sure that's the fastest way. I'm using 16.16 fixed point by the way.

what I'm doing for a multiplication, as an example is this:

to multiply Value (already a fixed point) by a (integer):

__int64 b = Value * (a << 16);
result = (fixed) (b >> 16);

I'm not sure that's the best way. Any suggestions?

Thanks!

--Eric

PS: the type "fixed" is really a LONG.
Have a look at:

http://www.arm.com/support/567GAM/$File ... dpoint.pdf

It's on the ARM site so it's biased towards ARM processors, but it covers fixed point in C pretty well, too.
Sergey Chaban · 22 Apr 2003, 17:55 UTC
This ARM docu is very good indeed, but unfortunatelly it doesn't describe some fixed-point techniques that especially useful with ARM CPUs.
Take division for example, they still use integer division, but it's much faster to optimize it with polynomial approximation for 1/x, thus reducing division to a bunch of multiplies and adds.
Same for sqrt.
Sometimes quality also depends on the compiler, for example check out assembly generated by EVC for the code like this:
fixed z = (fixed)(((__int64)x * y) >> 16);
i.e. 16.16 multiply (GCC generates better code in this case BTW);
In fact for multiplication it's even faster to use ARM assembly routine despite the call overhead.
Another example is CPU-specific optimizations - e.g. for stuff like vector dot product it's faster to use certain ARM specific instructions. Or CLZ on XScale to speedup operand normalization for the div approximation above.
If there is no 64-bit mul instruction in the target CPU, that's another set of optimized routines.
Also float<->fixed conversion for FPU-less processors.
That's why really fast fixed-point math library is not exactly trivial ;)
That said I guess that even really simple implementation is still good enough in most cases, even for games.

SC
efortier: There's almost never any reason to use 64bit fixed point math. Most cases where one needs floats you either need lots of accuracy in the decimals, or you need to do larger numbers. The one I wrote just shifted the point around in the bit array (32-bit integer) based on the case. So for my Sin/Cos/Tan LUTs I'd have mostly decimal bits for instance.
So you would have, say, 16.16 for general fixed point operators, and 8.24 for trig functions? That's a really good idea to improve accuracy.

Thanks for the tip!

--Eric