Added support for the remaining floating point textures.
TRAC #23048
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Geoff Lang
git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2378 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/loadimage.cpp b/src/libGLESv2/renderer/loadimage.cpp
index b5ca39f..a0dbb56 100644
--- a/src/libGLESv2/renderer/loadimage.cpp
+++ b/src/libGLESv2/renderer/loadimage.cpp
@@ -828,4 +828,29 @@
}
}
+void loadFloatRGBDataToHalfFloatRGBA(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 short *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 short>(output, y, z, outputRowPitch, outputDepthPitch);
+
+ for (int x = 0; x < width; x++)
+ {
+ dest[x * 4 + 0] = gl::float32ToFloat16(source[x * 3 + 0]);
+ dest[x * 4 + 1] = gl::float32ToFloat16(source[x * 3 + 1]);
+ dest[x * 4 + 2] = gl::float32ToFloat16(source[x * 3 + 2]);
+ dest[x * 4 + 3] = gl::Float16One;
+ }
+ }
+ }
+}
+
}