#endif /* FEATURE_EXT_texture_sRGB */
+
+/**
+ * Can the given type represent negative values?
+ */
static INLINE GLboolean
type_with_negative_values(GLenum type)
{
- switch (type) {
- case GL_BYTE:
- case GL_SHORT:
- case GL_INT:
- case GL_FLOAT:
- case GL_HALF_FLOAT_ARB:
- return GL_TRUE;
+ switch (type) {
+ case GL_BYTE:
+ case GL_SHORT:
+ case GL_INT:
+ case GL_FLOAT:
+ case GL_HALF_FLOAT_ARB:
+ return GL_TRUE;
default:
return GL_FALSE;
- }
+ }
}
+
/**
* This is the software fallback for Driver.GetTexImage().
* All error checking will have been done before this routine is called.
GLbitfield transferOps = 0x0;
/* clamp does not apply to GetTexImage (final conversion)?
- Looks like we need clamp though when going from format containing
- negative values to unsigned format */
-
+ * Looks like we need clamp though when going from format
+ * containing negative values to unsigned format.
+ */
if (!type_with_negative_values(type) &&
(texImage->TexFormat->DataType == GL_FLOAT ||
texImage->TexFormat->DataType == GL_SIGNED_NORMALIZED))