Standardized use of GL_HALF_FLOAT_NV and GL_HALF_FLOAT_ARB to GL_HALF_FLOAT

This commit is contained in:
Robert Osfield
2013-01-31 16:26:06 +00:00
parent 9bc3b3316a
commit 6ec15736cd
5 changed files with 12 additions and 20 deletions

View File

@@ -90,8 +90,8 @@
#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
#endif
#ifndef GL_ARB_PIXEL_DATA
#define GL_HALF_FLOAT_ARB 0x140B
#ifndef GL_HALF_FLOAT
#define GL_HALF_FLOAT 0x140B
#endif
#ifndef GL_NV_texture_shader
@@ -136,10 +136,6 @@
#define GL_FLOAT_RGBA32_NV 0x888B
#endif
#ifndef GL_NV_half_float
#define GL_HALF_FLOAT_NV 0x140B
#endif
#ifndef GL_ATI_texture_float
#define GL_RGBA_FLOAT32_ATI 0x8814
#define GL_RGB_FLOAT32_ATI 0x8815
@@ -394,10 +390,6 @@
#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
#endif
#ifndef GL_ARB_half_float_pixel
#define GL_HALF_FLOAT 0x140B
#endif
namespace osg {

View File

@@ -653,7 +653,7 @@ unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
case(GL_BYTE):
case(GL_UNSIGNED_BYTE): return 8*computeNumComponents(format);
case(GL_HALF_FLOAT_NV):
case(GL_HALF_FLOAT):
case(GL_SHORT):
case(GL_UNSIGNED_SHORT): return 16*computeNumComponents(format);
@@ -1651,7 +1651,7 @@ bool Image::isImageTranslucent() const
0xc0000000u, 1))
return true;
break;
case(GL_HALF_FLOAT_NV):
case(GL_HALF_FLOAT):
if (_findLowerAlphaValueInRow(s(), (unsigned short*)d + offset,
(unsigned short)0x3c00, delta))
return true;

View File

@@ -690,7 +690,7 @@ osg::Image* ReadDDSFile(std::istream& _istream)
OSG_INFO << "ReadDDSFile info : format = A16B16G16R16F" << std::endl;
internalFormat = GL_RGBA; // why no transparency?
pixelFormat = GL_RGBA;
dataType = GL_HALF_FLOAT_NV;
dataType = GL_HALF_FLOAT;
break;
case 0x0000006E: // Q16W16V16U16
OSG_INFO << "ReadDDSFile info : format = Q16W16V16U16" << std::endl;
@@ -704,7 +704,7 @@ osg::Image* ReadDDSFile(std::istream& _istream)
return NULL;
// internalFormat = GL_RGB;
// pixelFormat = must be GL_RED and GL_GREEN
// dataType = GL_HALF_FLOAT_NV;
// dataType = GL_HALF_FLOAT;
break;
case 0x00000073: // G32R32F
OSG_INFO << "ReadDDSFile info : G32R32F format is not supported"
@@ -724,7 +724,7 @@ osg::Image* ReadDDSFile(std::istream& _istream)
OSG_INFO << "ReadDDSFile info : format = R16F" << std::endl;
internalFormat = GL_RGB;
pixelFormat = GL_RED;
dataType = GL_HALF_FLOAT_NV;
dataType = GL_HALF_FLOAT;
break;
case 0x00000074: // A32B32G32R32F
OSG_INFO << "ReadDDSFile info : format = A32B32G32R32F" << std::endl;

View File

@@ -103,7 +103,7 @@ unsigned char *exr_load(std::istream& fin,
/*RgbaChannels channels =*/ rgbafile.channels();
(*width_ret) = width = dw.max.x - dw.min.x + 1;
(*height_ret)=height = dw.max.y - dw.min.y + 1;
(*dataType_ret) = GL_HALF_FLOAT_ARB;
(*dataType_ret) = GL_HALF_FLOAT;
pixels.resizeErase (height, width);
@@ -261,7 +261,7 @@ protected:
writeOK = false;
return false;
}
if (!( dataType == GL_HALF_FLOAT_ARB ||
if (!( dataType == GL_HALF_FLOAT ||
dataType == GL_FLOAT))
{
writeOK = false;
@@ -274,7 +274,7 @@ protected:
//Copy data from texture to rgba pixel format
Array2D<Rgba> outPixels(height,width);
//If texture is half format
if (dataType == GL_HALF_FLOAT_ARB)
if (dataType == GL_HALF_FLOAT)
{
for (long i = height-1; i >= 0; i--)
{
@@ -361,7 +361,7 @@ protected:
int t = height_ret;
int r = 1;
if (dataType_ret == GL_HALF_FLOAT_ARB)
if (dataType_ret == GL_HALF_FLOAT)
{
interNalTextureFormat =
numComponents_ret == 1 ? GL_LUMINANCE16F_ARB :

View File

@@ -324,7 +324,7 @@ bool ConvertImageFormat(unsigned int vtfFormat, int& internalFormat,
case VTF_FORMAT_RGBA16161616F:
internalFormat = GL_RGBA;
pixelFormat = GL_RGBA;
dataType = GL_HALF_FLOAT_NV;
dataType = GL_HALF_FLOAT;
break;
case VTF_FORMAT_RGBA16161616: