You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using Glf to read input EXR files, in which each channel is encoded as a half float (tpypical use-case: environment lights), a segmentation fault occurs.
texName refers to a valid, resolved path to an EXR image with half float channels. storage is initialized properly.
Solution proposal
The problem seems to come from the method _GetOIIOBaseType(GLenum type), in the file oiioImage.cpp. The conversion between a GLenum and a TypeDesc is missing the half float case. The implementation should look something like this:
/// Converts a GL type into its OpenImageIO component type equivalent.
static TypeDesc
_GetOIIOBaseType(GLenum type)
{
switch (type) {
case GL_UNSIGNED_BYTE:
case GL_BYTE:
return TypeDesc::UINT8;
case GL_UNSIGNED_INT:
case GL_INT:
return TypeDesc::UINT;
case GL_HALF_FLOAT: // new line
return TypeDesc::HALF; // new line
case GL_FLOAT:
return TypeDesc::FLOAT;
default:
TF_CODING_ERROR("Unsupported type");
return TypeDesc::FLOAT;
}
}
It's worth noting that the reverse conversion implemented in _GLTypeFromImageData(TypeDesc typedesc) properly addresses the half float case.
Applying this modification solves the problem on my tests.
System Information (OS, Hardware)
Windows 7, but should be similar on other platforms
Package Versions
0.8.5a, not tested on dev branch but according to a git blame, the problem should be in this branch too.
Description of Issue
While using Glf to read input EXR files, in which each channel is encoded as a half float (tpypical use-case: environment lights), a segmentation fault occurs.
Steps to Reproduce
texName
refers to a valid, resolved path to an EXR image with half float channels.storage
is initialized properly.Solution proposal
The problem seems to come from the method
_GetOIIOBaseType(GLenum type)
, in the fileoiioImage.cpp
. The conversion between a GLenum and a TypeDesc is missing the half float case. The implementation should look something like this:It's worth noting that the reverse conversion implemented in
_GLTypeFromImageData(TypeDesc typedesc)
properly addresses the half float case.Applying this modification solves the problem on my tests.
System Information (OS, Hardware)
Windows 7, but should be similar on other platforms
Package Versions
0.8.5a, not tested on dev branch but according to a git blame, the problem should be in this branch too.
Build Flags
(stripped the directory-related directives)
The text was updated successfully, but these errors were encountered: