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

hdx: update color correction task to support building against OpenColorIO 2.3.0 #2651

Merged
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
19 changes: 18 additions & 1 deletion pxr/imaging/hdx/colorCorrectionTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,16 @@ HdxColorCorrectionTask::_CreateOpenColorIOResourcesImpl(
uint32_t width, height;
OCIO::GpuShaderCreator::TextureType channel;
OCIO::Interpolation interpolation;

#if OCIO_VERSION_HEX >= 0x02030000
OCIO::GpuShaderCreator::TextureDimensions dimensions;
shaderDesc->getTexture(i, textureName, samplerName, width, height,
channel, dimensions, interpolation);
#else
shaderDesc->getTexture(i, textureName, samplerName, width, height,
channel, interpolation);
#endif // OCIO_VERSION_HEX >= 0x02030000

shaderDesc->getTextureValues(i, lutValues);

int channelPerPix =
Expand All @@ -432,7 +440,16 @@ HdxColorCorrectionTask::_CreateOpenColorIOResourcesImpl(
// Texture description
HgiTextureDesc texDesc;
texDesc.debugName = textureName;
texDesc.type = height == 1 ? HgiTextureType1D : HgiTextureType2D;

texDesc.type =
#if OCIO_VERSION_HEX >= 0x02030000
dimensions == OCIO::GpuShaderCreator::TextureDimensions::TEXTURE_1D ?
HgiTextureType1D :
HgiTextureType2D;
#else
height == 1 ? HgiTextureType1D : HgiTextureType2D;
#endif // OCIO_VERSION_HEX >= 0x02030000

texDesc.dimensions = GfVec3i(width, height, 1);
texDesc.format = fmt;
texDesc.layerCount = 1;
Expand Down
Loading