Added support for the GL_RGB9_E5 format.

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2363 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/loadimage.cpp b/src/libGLESv2/renderer/loadimage.cpp
index cfb352f..10debe8 100644
--- a/src/libGLESv2/renderer/loadimage.cpp
+++ b/src/libGLESv2/renderer/loadimage.cpp
@@ -710,4 +710,50 @@
     }
 }
 
+void loadRGBHalfFloatDataTo999E5(int width, int height, int depth,
+                                 const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch,
+                                 void *output, unsigned int outputRowPitch, unsigned int outputDepthPitch)
+{
+    const unsigned short *source = NULL;
+    unsigned int *dest = NULL;
+
+    for (int z = 0; z < depth; z++)
+    {
+        for (int y = 0; y < height; y++)
+        {
+            source = offsetDataPointer<unsigned short>(input, y, z, inputRowPitch, inputDepthPitch);
+            dest = offsetDataPointer<unsigned int>(output, y, z, outputRowPitch, outputDepthPitch);
+
+            for (int x = 0; x < width; x++)
+            {
+                dest[x] = gl::convertRGBFloatsTo999E5(gl::float16ToFloat32(source[x * 3 + 0]),
+                                                      gl::float16ToFloat32(source[x * 3 + 1]),
+                                                      gl::float16ToFloat32(source[x * 3 + 2]));
+            }
+        }
+    }
+}
+
+void loadRGBFloatDataTo999E5(int width, int height, int depth,
+                             const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch,
+                             void *output, unsigned int outputRowPitch, unsigned int outputDepthPitch)
+{
+    const float *source = NULL;
+    unsigned int *dest = NULL;
+
+    for (int z = 0; z < depth; z++)
+    {
+        for (int y = 0; y < height; y++)
+        {
+            source = offsetDataPointer<float>(input, y, z, inputRowPitch, inputDepthPitch);
+            dest = offsetDataPointer<unsigned int>(output, y, z, outputRowPitch, outputDepthPitch);
+
+            for (int x = 0; x < width; x++)
+            {
+                dest[x] = gl::convertRGBFloatsTo999E5(source[x * 3 + 0], source[x * 3 + 1], source[x * 3 + 2]);
+            }
+        }
+    }
+}
+
 }