In order to support distributed textures, I made some modifications to WireGL. The idea for this came from an email conversation with Ian Buck of the WireGL team. Essentially, I added two new features to glTexImage2D to support caching of textures across the cluster.
The spec for glTexImage2D is:
void glTexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )Normally, type is one of GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, etc.
I added two more options for type that are normally invalid. The two options are GL_TRUE and GL_FALSE.
If the type is set to GL_TRUE then the pixels data is interpreted as a filename followed by the texture data. On the unpacking side, the filename is extracted and the texture data is saved to local disk.
If the type is set to GL_FALSE then the pixels data is
interpreted as only a filename. On the unpacking side, the filename is
extracted and the texture is loaded from local disk.
Note: These modifications have been added to the official WireGL distribution starting with version 1.2.1.
This functionality was put
into the "dist_texture" SPU for Chromium by David Thompson.