Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[glf] Support uint16 type for GL tetxures and OpenImageIO. #1212

Merged
merged 1 commit into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pxr/imaging/glf/baseTextureData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ GlfBaseTextureData::_GLInternalFormatFromImageData(
{
int numElements = GlfGetNumElements(format);
switch (type) {
case GL_UNSIGNED_SHORT:
case GL_UNSIGNED_INT:
switch (numElements) {
case 1:
Expand Down
14 changes: 11 additions & 3 deletions pxr/imaging/glf/oiioImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ static GLenum
_GLTypeFromImageData(TypeDesc typedesc)
{
switch (typedesc.basetype) {
case TypeDesc::UINT:
case TypeDesc::UINT32:
return GL_UNSIGNED_INT;
case TypeDesc::UINT16:
return GL_UNSIGNED_SHORT;
case TypeDesc::HALF:
return GL_HALF_FLOAT;
case TypeDesc::FLOAT:
Expand All @@ -153,11 +155,17 @@ _GetOIIOBaseType(GLenum type)
{
switch (type) {
case GL_UNSIGNED_BYTE:
case GL_BYTE:
return TypeDesc::UINT8;
case GL_BYTE:
return TypeDesc::INT8;
case GL_UNSIGNED_SHORT:
return TypeDesc::UINT16;
case GL_SHORT:
return TypeDesc::INT16;
case GL_UNSIGNED_INT:
return TypeDesc::UINT32;
case GL_INT:
return TypeDesc::UINT;
return TypeDesc::INT32;
case GL_HALF_FLOAT:
return TypeDesc::HALF;
case GL_FLOAT:
Expand Down