gDPPipelineMode

gDPPipelineMode [Macro]

Function

gDPPipelineMode

Enables/disables span buffer coherency as the pipeline mode

Syntax

#include <ultra64.h>        /* gbi.h */
gDPPipelineMode(Gfx *gdl, u32 mode)
gsDPPipelineMode(         u32 mode)

Arguments

gdl
Display list pointer.
mode
RDP pipeline mode:
G_PM_1PRIMITIVE (Coherency)
G_PM_NPRIMITIVE (No coherency -- higher performance)

Description

Sets the pipeline mode for span buffer coherency. The RDP has span buffers in order to perform rendering more efficiently.

The different RDP pipeline modes are explained below:

G_PM_1PRIMITIVE
This mode provides for span buffer coherency.
When two consecutive spans are rendered in the same screen coordinates, the second span will use as its frame buffer pixel source the frame buffer values of the first span which have not been written to the frame buffer yet. When this mode is executed there will be a slight drop in performance. However, because the second span process waits for the result of the RMW (read-modify-write) operation of the first span, the second span will correctly reflect the results of the first span.

G_PM_NPRIMITIVE
In this mode there is not span buffer coherency, but you can obtain higher performance. However, in anti-alias rendering mode the drawing will look unnatural and there will be a drop in quality.
When two consecutive span buffers are rendered in the same screen coordinates, they become shared. Because the second span does not wait for the result of the first span process, it may read a value from the frame buffer that does not reflect the result of the first span buffer (and then afterward write the wrong value to the frame buffer).

For details, see Section 12.2.3 "Span Buffer Coherency" in the N64 Programming Manual.

Note

There is usually no problem with the G_PM_NPRIMITIVE setting, but if the span buffer causes problems with rendering, it is best to set the mode to G_PM_1PRIMITIVE.

Comment

Idle cycles are needed in order to maintain span buffer coherency with G_PM_1PRIMITIVE mode, and this can lead to a loss in fill rate. This loss will be no greater than 1.5M pixels per second, but because on rare occasions visual abnormalities can arise in the real game due to overlapping of primitives, higher performance can be achieved by using G_PM_NPRIMITIVE mode.

See Also

gDPSetRenderMode

Revision History

02/01/99 Completely rewritten.