OpenGL float support (#1717)
This commit is contained in:
@@ -398,6 +398,14 @@ platform::GLenum Enum<gfx::TexturePixelType>::sizedFor<>(const gfx::TexturePixel
|
||||
break;
|
||||
}
|
||||
}
|
||||
case gfx::TextureChannelDataType::Float: {
|
||||
switch (value) {
|
||||
case gfx::TexturePixelType::RGBA:
|
||||
return GL_RGBA32F;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return GL_INVALID_ENUM;
|
||||
@@ -410,6 +418,8 @@ gfx::TextureChannelDataType Enum<gfx::TextureChannelDataType>::from(const platfo
|
||||
return gfx::TextureChannelDataType::UnsignedByte;
|
||||
case GL_HALF_FLOAT:
|
||||
return gfx::TextureChannelDataType::HalfFloat;
|
||||
case GL_FLOAT:
|
||||
return gfx::TextureChannelDataType::Float;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
@@ -421,6 +431,8 @@ platform::GLenum Enum<gfx::TextureChannelDataType>::to(const gfx::TextureChannel
|
||||
return GL_UNSIGNED_BYTE;
|
||||
case gfx::TextureChannelDataType::HalfFloat:
|
||||
return GL_HALF_FLOAT;
|
||||
case gfx::TextureChannelDataType::Float:
|
||||
return GL_FLOAT;
|
||||
}
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user