Scalar or Vector Processing#
Modern processing architectures can either operate on a single value per processing unit (scalar) or multiple values per processing unit (vector).
Vector#
Vector processing can be very efficient, especially for colour and vertex manipulation, as it can work on multiple values at the same time, rather than just one. Traditional rendering operations are therefore well suited to this type of architecture, as calculations often operate on three or four elements at once.
The main drawback of vector architectures is that if scalar values or vectors smaller than what the processor expects are used, the additional processing element width is wasted. The most common vector width is four, which means that a shader or kernel operating on three component vectors will operate these instructions with 75% efficiency. Having a shader that does work on scalars in the worst case may take this number down to as low as 25%. This wastes energy, as parts of the processor are doing useless work. It is possible to optimise for this by vectorising code, but this introduces additional programmer burden.
Scalar#
Scalar processors tend to be more flexible in terms of what operations can be performed per hardware cycle, as there is no need to fill the additional processing width with data. Whilst vector architectures could potentially work on more values in the same silicon area, the actual number of useful results per clock will usually be higher in scalar architectures for non-vectorised code. Therefore, for compute tasks, it is a lot easier to work with scalar architectures, as there is no need to vectorise. Scalar architectures tend to be better suited to general purpose processing and more advanced rendering techniques. PowerVR Graphics cores are all scalar architectures.