Blending colors of source and destination primitives by a graphics
processing unit is disclosed. The graphics processing unit executes a
blending program that blends the primitives. The graphics processing unit
receives the blending program from a central processing unit or a
graphics application program. For example, the graphics processing unit
draws a source primitive in a source texture map and a destination
primitive in a destination texture map. The blending program (e.g., a
pixel shader) is set to be applied to the primitives, and the graphics
processing unit applies the blend mode to each pixel of the primitives,
rendering a composite primitive in a destination render target.