Skip to content

Commit

Permalink
Merge pull request #2651 from mattyjams/pr/updates_to_support_OCIO_v2…
Browse files Browse the repository at this point in the history
…_3_0

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

(Internal change: 2306554)
  • Loading branch information
pixar-oss committed Dec 4, 2023
2 parents d3e388d + 9fe8cf6 commit 3319d3b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pxr/imaging/hdx/colorCorrectionTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,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 @@ -435,7 +443,14 @@ 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

0 comments on commit 3319d3b

Please sign in to comment.