PocketMatrix forums

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

Scan-line level preloading

I'm just skimming through my newly arrived copy of Intel's "Programming with Intel Wireless MMX Technology". Nice reading, by the way...

Anyway, so there is this chapter on "Accelerating Graphics Applications", which has a section on triangle rasterization for 3D applications. In there, there are a bunch of paragraphs discussing the (well-known) problem of memory latency during rasterization, which could be overcome by issueing appropriate prefetching instructions (PLD) to bring data from main memory into cache before it would be used lateron. And that's about where the discussion ends... well, they finish by saying: "However, the biggest challenge is [the] computation of the address to be pre-fetched."

So, my question: Has anybody tried this type of prefetching as part of an ARM/XScale based 3D-engine? How much do you gain? Where would you typically determine and issue the prefetch? How would you determine what to prefetch? Is there a tradeoff?

Thanks,
HM
Is there any way to use WMMX using the Microsoft compiler or do you need the Intel tools?

Tala
Tala wrote:Is there any way to use WMMX using the Microsoft compiler or do you need the Intel tools?

The Intel Compiler has WMMX support. However, PLD does not require WMMX.

- HM
Not got an XScale device, but I can throw some (obviously untested) opinions around...

Firstly, the easiest pre-fetching can be performed when you're traversing memory linearly. For example, if you're going through a vertex buffer performing transformations, then it should be worthwhile to ask the cache to fetch the next cache-line of vertices while you process the current cache-line.

I'd hazard a guess that pre-fetching at the rasterisation stage itself wouldn't be a good idea - generally by the time you have the address of the data you require, you want the data already (especially textures, etc).