+/**
+ * Return a new index buffer which contains a translation of the original
+ * index buffer. An example of a translation is converting from QUAD
+ * primitives to TRIANGLE primitives. Each set of four indexes for a quad
+ * will be converted to six indices for two triangles.
+ *
+ * Before generating the new index buffer we'll check if the incoming
+ * buffer already has a translated buffer that can be re-used.
+ * This benefits demos like Cinebench R15 which has many
+ * glDrawElements(GL_QUADS) commands (we can't draw quads natively).
+ *
+ * \param offset offset in bytes to first index to translate in src buffer
+ * \param orig_prim original primitive type (like PIPE_PRIM_QUADS)
+ * \param gen_prim new/generated primitive type (like PIPE_PRIM_TRIANGLES)
+ * \param orig_nr number of indexes to translate in source buffer
+ * \param gen_nr number of indexes to write into new/dest buffer
+ * \param index_size bytes per index (2 or 4)
+ * \param translate the translation function from the u_translate module
+ * \param out_buf returns the new/translated index buffer
+ * \return error code to indicate success failure
+ */