PowerVR Series1

Up Bilinear Filtering Hardware Clipping Performance n-gons Performance Optimisations HW-SW Overlap PowerVR Detection S3 Memory |  | Frequently Asked Questions Overlapping Hardware and Software Processing This section describes the single most important performance optimisation for PowerVR applications. Many other optimisations are listed in the next chapter. In rendering systems based on display lists the hardware begins the render once the entire scene has been processed in software. Applications must be careful to avoid operations that force the CPU does to wait for the hardware to complete the render before starting software processing for the next frame. This is how software and hardware should ‘overlap’ so they operate in parallel: (software for frame 1) then (hardware for frame 1) and (software for frame 2) in parallel then (hardware for frame 2) and (software for frame 3) in parallel etc The blit or flip that causes the rendered image to be displayed on the screen needs to be done after the hardware has finished that frame, which would be during (or after) the software processing for the next frame. Another important consideration for this process is writing to texture memory. As this cannot be done while the hardware is rendering, functions that create or change textures, such as sgl_create_texture, sgl_set_texture and sgl_direct_set_texture wait in a delay loop until the hardware has finished the current render. In most well designed 3D scenes the software processing will take longer than hardware. This allows performance to scale linearly with CPU speed. Any regular calls to texture writing functions should therefore be done just before starting the next hardware render, minimising the CPU time for the frame. Optimal game loop for SGL Direct: start hardware render (sgltri_render) for frame n-1 do game processing (including game input devices) for frame n done2d = FALSE sgltri_startofframe for frame n while (more triangle sets to do) { sgltri_triangles for frame n if ((!done2D) && sgltri_isrendercomplete) { 2D, e.g. score or HUD* for frame n-1 blit/flip for frame n-1 done2d = TRUE } } sgl_set_texture for frame n *Head Up Display Optimal game loop for Direct3D: EndScene (starts hardware render) for frame n-1 do game processing for frame n BeginScene for frame n process execute buffer for frame n 2D, e.g. score or HUD for frame n-1 blit/flip for frame n-1 It is not possible in Direct3D to determine whether the hardware has finished the render so 2D operations for a given frame need to be done after all of the software activity for the next frame. Video memory to video memory blits and flips, and texture memory writes (usually using blits) are automatically deferred until the last moment by the PowerVR Direct3D driver, but blits from system memory and locks to the render surface are not.

Confidential / provided under Non-Disclosure Agreement Copyright © 1999-2000, PowerVR Technologies and partners. PowerVR Technologies is a division of Imagination Technologies Limited.