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
parent 49ec992d
......@@ -208,7 +208,7 @@ D3D11LoadFunctionMap buildD3D11LoadFunctionMap()
insertLoadFunction(&map, GL_RGB5_A1, GL_UNSIGNED_INT_2_10_10_10_REV, loadRGBA2101010ToRGBA );
insertLoadFunction(&map, GL_RGBA16F, GL_HALF_FLOAT, loadToNative<GLhalf, 4> );
insertLoadFunction(&map, GL_RGBA32F, GL_FLOAT, loadToNative<GLfloat, 4> );
insertLoadFunction(&map, GL_RGBA16F, GL_FLOAT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA16F, GL_FLOAT, loadFloatDataToHalfFloat<4> );
insertLoadFunction(&map, GL_RGBA8UI, GL_UNSIGNED_BYTE, loadToNative<GLubyte, 4> );
insertLoadFunction(&map, GL_RGBA8I, GL_BYTE, loadToNative<GLbyte, 4> );
insertLoadFunction(&map, GL_RGBA16UI, GL_UNSIGNED_SHORT, loadToNative<GLushort, 4> );
......@@ -223,11 +223,11 @@ D3D11LoadFunctionMap buildD3D11LoadFunctionMap()
insertLoadFunction(&map, GL_RGB565, GL_UNSIGNED_SHORT_5_6_5, loadRGB565DataToRGBA );
insertLoadFunction(&map, GL_R11F_G11F_B10F, GL_UNSIGNED_INT_10F_11F_11F_REV, loadToNative<GLuint, 1> );
insertLoadFunction(&map, GL_RGB9_E5, GL_UNSIGNED_INT_5_9_9_9_REV, loadToNative<GLuint, 1> );
insertLoadFunction(&map, GL_RGB16F, GL_HALF_FLOAT, loadRGBHalfFloatDataToRGBA );
insertLoadFunction(&map, GL_RGB16F, GL_HALF_FLOAT, loadToNative3To4<GLhalf, gl::Float16One>);
insertLoadFunction(&map, GL_R11F_G11F_B10F, GL_HALF_FLOAT, loadRGBHalfFloatDataTo111110Float );
insertLoadFunction(&map, GL_RGB9_E5, GL_HALF_FLOAT, loadRGBHalfFloatDataTo999E5 );
insertLoadFunction(&map, GL_RGB32F, GL_FLOAT, loadToNative<GLfloat, 3> );
insertLoadFunction(&map, GL_RGB16F, GL_FLOAT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB16F, GL_FLOAT, loadFloatRGBDataToHalfFloatRGBA );
insertLoadFunction(&map, GL_R11F_G11F_B10F, GL_FLOAT, loadRGBFloatDataTo111110Float );
insertLoadFunction(&map, GL_RGB9_E5, GL_FLOAT, loadRGBFloatDataTo999E5 );
insertLoadFunction(&map, GL_RGB8UI, GL_UNSIGNED_BYTE, loadToNative3To4<GLubyte, 0x0> );
......
......@@ -828,4 +828,29 @@ void loadRGBFloatDataTo111110Float(int width, int height, int depth,
}
}
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;
}
}
}
}
}
......@@ -270,6 +270,10 @@ void loadFloatDataToHalfFloat(int width, int height, int depth,
}
}
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);
template <unsigned int blockWidth, unsigned int blockHeight, unsigned int blockSize>
void loadCompressedBlockDataToNative(int width, int height, int depth,
const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment