1. A method of performing a set of shading operations and a set of non-shading operations for a graphic object in a scene displayed on a device comprising a plurality of processing units, the method comprising: executing a subset of the set of non-shading operations, wherein when a non-shading operation refers to a shading operation, the shading operation is stored without being invoked; invoking the set of shading operations only when the set of shading operations are needed to render the graphic object; after invoking the set of shading operations, determining a frequency of computation for each shading operation; allocating the shading operations to the processing units based on the frequency of computation associated with each shading operation; and rendering the graphic object based on a plurality of instructions that comprise the set of shading operations.