I have since discovered that the Mobility Radeon 9000 supports GL_ATI_fragment_shader, so I added a code path for that, with the following shader:
// PASS 1
// sample texture unit 0 (the colour index buffer) with texture coordinates specified for texture unit 0,
// and store the result in r0
gl.glSampleMapATI( GL.GL_REG_0_ATI, GL.GL_TEXTURE0, GL.GL_SWIZZLE_STR_ATI ); // free
// some no-op in the first pass...
gl.glColorFragmentOp1ATI( GL.GL_MOV_ATI, GL.GL_REG_0_ATI, GL.GL_NONE, GL.GL_NONE, GL.GL_REG_0_ATI, GL.GL_NONE, GL.GL_NONE );
// PASS 2
// sample texture unit 1 (the palette 1-D texture), with texture coordinates from the previous pass
gl.glSampleMapATI( GL.GL_REG_1_ATI, GL.GL_REG_0_ATI, GL.GL_SWIZZLE_STR_ATI ); // free
// r0 = primary * r1
gl.glColorFragmentOp2ATI( GL.GL_MUL_ATI, GL.GL_REG_0_ATI, GL.GL_NONE, GL.GL_NONE, GL.GL_PRIMARY_COLOR, GL.GL_NONE, GL.GL_NONE, GL.GL_REG_1_ATI, GL.GL_NONE, GL.GL_NONE );
gl.glAlphaFragmentOp2ATI( GL.GL_MUL_ATI, GL.GL_REG_0_ATI, GL.GL_NONE, GL.GL_PRIMARY_COLOR, GL.GL_NONE, GL.GL_NONE, GL.GL_REG_1_ATI, GL.GL_NONE, GL.GL_NONE );
This works, except it shows some strange artefacts in the image. These are faint lines around certain (brighter) areas in the original image. Definitely NOT present in the software-mapper path. Does anyone know why that could be? FYI: texture unit 0 is the 2-D color index texture, internal format GL_LUMINANCE, and unit 1 is a 1-D BGRA texture containing the 256 palette entries.
Thanks,
Matt.
PS: Above is Java code (we use JOGL).