openfimg: compiler: Fix shader type initialization

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Work around pixel shader termination on output write

Apparently the shader ends execution as soon as a write to the output
color register happens, even if it writes only selected components. To
work this around, a temporary register is used throughout the program,
which is then stored to the output register at the end.

Possible valid cases of writing directly to the output register will be
handled later by respective pass in the optimizer.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Use predicate 1 for branches

The binary compiler does the same and the binary assembler does not
accept predicate 0 for branch instructions.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Fix CMP instruction

It has different order of sources than one expected by TGSI.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: Support PIPE_TEX_WRAP_CLAMP

According to documentation, it can behave like
PIPE_TEX_WRAP_CLAMP_TO_EDGE and this is what our hardware supports so
let's use it.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: Emit element count as attribute count of VS

If they don't match the hardware locks up.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>