emulator/opengl/emugen: Use templates to read values from stream.

The decoder didn't properly handle GLsizeiptr and GLintptr values, which
are always 32-bit on the wire, but can be 64-bit on the host. I.e. it
did something like that to read them from the stream:

  *(GLsizeiptr*)(ptr + offset)

This fixes the issue by using templates to generate host-type-specific
functions that properly read data from the stream and convert it to the
appropriate host type.

Change-Id: I75749bd715456ca143eb1713498f7cf635918801
2 files changed