Skip to content

Commit

Permalink
Fix compilation error on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Huidong Chen committed Feb 5, 2020
1 parent 4dd8081 commit 94967f1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/render/vp2RenderDelegate/render_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ namespace
//! Enum class for fallback shader types
enum class FallbackShaderType
{
Common = 0,
BasisCurvesLinear,
BasisCurvesCubic,
Count
kCommon = 0,
kBasisCurvesLinear,
kBasisCurvesCubic,
kCount
};

//! Array of shader fragment names indexed by FallbackShaderType
const MString _fallbackShaderNames[FallbackShaderType::Count] =
const MString _fallbackShaderNames[] =
{
"FallbackShader",
"BasisCurvesLinearFallbackShader",
Expand Down Expand Up @@ -231,11 +231,11 @@ namespace
*/
MHWRender::MShaderInstance* GetFallbackShader(const MColor& color, FallbackShaderType type)
{
if (type >= FallbackShaderType::Count) {
if (type >= FallbackShaderType::kCount) {
return nullptr;
}

const unsigned int index = static_cast<unsigned int>(type);
const size_t index = static_cast<size_t>(type);
auto& shaderMap = _fallbackShaders[index];

// Look for it first with reader lock
Expand Down Expand Up @@ -279,7 +279,7 @@ namespace
bool _isInitialized { false }; //!< Whether the shader cache is initialized

//! Shader registry used by fallback shaders
MShaderMap _fallbackShaders[FallbackShaderType::Count];
MShaderMap _fallbackShaders[static_cast<size_t>(FallbackShaderType::kCount)];
MShaderMap _3dSolidShaders;

MHWRender::MShaderInstance* _fallbackCPVShader { nullptr }; //!< Fallback shader with CPV support
Expand Down Expand Up @@ -694,7 +694,7 @@ MString HdVP2RenderDelegate::GetLocalNodeName(const MString& name) const {
MHWRender::MShaderInstance* HdVP2RenderDelegate::GetFallbackShader(
const MColor& color) const
{
return sShaderCache.GetFallbackShader(color, FallbackShaderType::Common);
return sShaderCache.GetFallbackShader(color, FallbackShaderType::kCommon);
}

/*! \brief Returns a fallback shader instance when no material is bound.
Expand All @@ -709,7 +709,7 @@ MHWRender::MShaderInstance* HdVP2RenderDelegate::GetFallbackShader(
MHWRender::MShaderInstance*
HdVP2RenderDelegate::GetBasisCurvesLinearFallbackShader(const MColor& color) const
{
return sShaderCache.GetFallbackShader(color, FallbackShaderType::BasisCurvesLinear);
return sShaderCache.GetFallbackShader(color, FallbackShaderType::kBasisCurvesLinear);
}

/*! \brief Returns a fallback shader instance when no material is bound.
Expand All @@ -724,7 +724,7 @@ HdVP2RenderDelegate::GetBasisCurvesLinearFallbackShader(const MColor& color) con
MHWRender::MShaderInstance*
HdVP2RenderDelegate::GetBasisCurvesCubicFallbackShader(const MColor& color) const
{
return sShaderCache.GetFallbackShader(color, FallbackShaderType::BasisCurvesCubic);
return sShaderCache.GetFallbackShader(color, FallbackShaderType::kBasisCurvesCubic);
}

/*! \brief Returns a fallback CPV shader instance when no material is bound.
Expand Down

0 comments on commit 94967f1

Please sign in to comment.