diff --git a/pxr/imaging/hdSt/codeGen.cpp b/pxr/imaging/hdSt/codeGen.cpp index db3329b625..a8e1455a5f 100644 --- a/pxr/imaging/hdSt/codeGen.cpp +++ b/pxr/imaging/hdSt/codeGen.cpp @@ -3462,12 +3462,16 @@ static void _EmitTextureAccessors( // Forward declare texture scale and bias if (hasTextureScaleAndBias) { accessors - << "#ifdef HD_HAS_" << name << "_" << HdStTokens->scale << "\n" - << "FORWARD_DECL(vec4 HdGet_" << name << "_" << HdStTokens->scale + << "#ifdef HD_HAS_" << name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" + << "FORWARD_DECL(vec4 HdGet_" << name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "());\n" << "#endif\n" - << "#ifdef HD_HAS_" << name << "_" << HdStTokens->bias << "\n" - << "FORWARD_DECL(vec4 HdGet_" << name << "_" << HdStTokens->bias + << "#ifdef HD_HAS_" << name << "_" << HdStTokens->storm + << "_" << HdStTokens->bias << "\n" + << "FORWARD_DECL(vec4 HdGet_" << name << "_" << HdStTokens->storm + << "_" << HdStTokens->bias << "());\n" << "#endif\n"; } @@ -3624,11 +3628,15 @@ static void _EmitTextureAccessors( } } accessors - << "#ifdef HD_HAS_" << name << "_" << HdStTokens->scale << "\n" - << " * HdGet_" << name << "_" << HdStTokens->scale << "()\n" + << "#ifdef HD_HAS_" << name << "_" << HdStTokens->storm << "_" + << HdStTokens->scale << "\n" + << " * HdGet_" << name << "_" << HdStTokens->storm << "_" + << HdStTokens->scale << "()\n" << "#endif\n" - << "#ifdef HD_HAS_" << name << "_" << HdStTokens->bias << "\n" - << " + HdGet_" << name << "_" << HdStTokens->bias << "()\n" + << "#ifdef HD_HAS_" << name << "_" << HdStTokens->storm << "_" + << HdStTokens->bias << "\n" + << " + HdGet_" << name << "_" << HdStTokens->storm << "_" + << HdStTokens->bias << "()\n" << "#endif\n" << ")" << swizzle << ");\n"; } else { @@ -3684,12 +3692,16 @@ static void _EmitTextureAccessors( << name << HdSt_ResourceBindingSuffixTokens->fallback << fallbackSwizzle << ")\n" - << "#ifdef HD_HAS_" << name << "_" << HdStTokens->scale << "\n" - << " * HdGet_" << name << "_" << HdStTokens->scale + << "#ifdef HD_HAS_" << name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" + << " * HdGet_" << name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "()" << swizzle << "\n" << "#endif\n" - << "#ifdef HD_HAS_" << name << "_" << HdStTokens->bias << "\n" - << " + HdGet_" << name << "_" << HdStTokens->bias + << "#ifdef HD_HAS_" << name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "\n" + << " + HdGet_" << name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "()" << swizzle << "\n" << "#endif\n" << ");\n" @@ -5966,13 +5978,17 @@ HdSt_CodeGen::_GenerateShaderParameters(bool bindlessTextureEnabled) accessors << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" << "vec4 HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "();\n" << "#endif\n" << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "\n" << "vec4 HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "();\n" << "#endif\n"; @@ -6014,13 +6030,17 @@ HdSt_CodeGen::_GenerateShaderParameters(bool bindlessTextureEnabled) << HdSt_ResourceBindingSuffixTokens->fallback << fallbackSwizzle << ")\n" << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" << " * HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "()" << swizzle << "\n" << "#endif\n" << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "\n" << " + HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "()" << swizzle << "\n" << "#endif\n" << " );\n }\n"; @@ -6029,13 +6049,17 @@ HdSt_CodeGen::_GenerateShaderParameters(bool bindlessTextureEnabled) accessors << " return (ret\n" << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" << " * HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "()\n" << "#endif\n" << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "\n" << " + HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "()\n" << "#endif\n" << " )" << swizzle << ";\n}\n"; @@ -6086,13 +6110,17 @@ HdSt_CodeGen::_GenerateShaderParameters(bool bindlessTextureEnabled) accessors << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" << "FORWARD_DECL(vec4 HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->scale << "());\n" << "#endif\n" << "#ifdef HD_HAS_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "\n" << "FORWARD_DECL(vec4 HdGet_" << it->second.name << "_" + << HdStTokens->storm << "_" << HdStTokens->bias << "());\n" << "#endif\n"; @@ -6136,14 +6164,16 @@ HdSt_CodeGen::_GenerateShaderParameters(bool bindlessTextureEnabled) << HdSt_ResourceBindingSuffixTokens->fallback << fallbackSwizzle << ")\n" << "#ifdef HD_HAS_" << it->second.name << "_" - << HdStTokens->scale << "\n" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" << " * HdGet_" << it->second.name << "_" - << HdStTokens->scale << "()" << swizzle << "\n" + << HdStTokens->storm << "_" << HdStTokens->scale << "()" + << swizzle << "\n" << "#endif\n" << "#ifdef HD_HAS_" << it->second.name << "_" - << HdStTokens->bias << "\n" + << HdStTokens->storm << "_" << HdStTokens->bias << "\n" << " + HdGet_" << it->second.name << "_" - << HdStTokens->bias << "()" << swizzle << "\n" + << HdStTokens->storm << "_" << HdStTokens->bias << "()" + << swizzle << "\n" << "#endif\n" << " );\n }\n"; } @@ -6151,14 +6181,14 @@ HdSt_CodeGen::_GenerateShaderParameters(bool bindlessTextureEnabled) accessors << " return (ret\n" << "#ifdef HD_HAS_" << it->second.name << "_" - << HdStTokens->scale << "\n" + << HdStTokens->storm << "_" << HdStTokens->scale << "\n" << " * HdGet_" << it->second.name << "_" - << HdStTokens->scale << "()\n" + << HdStTokens->storm << "_" << HdStTokens->scale << "()\n" << "#endif\n" << "#ifdef HD_HAS_" << it->second.name << "_" - << HdStTokens->bias << "\n" + << HdStTokens->storm << "_" << HdStTokens->bias << "\n" << " + HdGet_" << it->second.name << "_" - << HdStTokens->bias << "()\n" + << HdStTokens->storm << "_" << HdStTokens->bias << "()\n" << "#endif\n" << " )" << swizzle << ";\n}\n"; diff --git a/pxr/imaging/hdSt/materialNetwork.cpp b/pxr/imaging/hdSt/materialNetwork.cpp index fdb806a804..3f5796ef5f 100644 --- a/pxr/imaging/hdSt/materialNetwork.cpp +++ b/pxr/imaging/hdSt/materialNetwork.cpp @@ -830,7 +830,8 @@ _MakeMaterialParamsForTexture( // Handle texture scale and bias HdSt_MaterialParam texScaleParam; texScaleParam.paramType = HdSt_MaterialParam::ParamTypeFallback; - texScaleParam.name = TfToken(paramName.GetString() + "_" + + texScaleParam.name = TfToken(paramName.GetString() + "_" + + HdStTokens->storm.GetString() + "_" + HdStTokens->scale.GetString()); texScaleParam.fallbackValue = VtValue(_ResolveParameter(node, sdrNode, @@ -840,7 +841,8 @@ _MakeMaterialParamsForTexture( HdSt_MaterialParam texBiasParam; texBiasParam.paramType = HdSt_MaterialParam::ParamTypeFallback; - texBiasParam.name = TfToken(paramName.GetString() + "_" + + texBiasParam.name = TfToken(paramName.GetString() + "_" + + HdStTokens->storm.GetString() + "_" + HdStTokens->bias.GetString()); texBiasParam.fallbackValue = VtValue(_ResolveParameter(node, sdrNode, diff --git a/pxr/imaging/hdSt/tokens.h b/pxr/imaging/hdSt/tokens.h index ac36c7daff..b5323a6f5a 100644 --- a/pxr/imaging/hdSt/tokens.h +++ b/pxr/imaging/hdSt/tokens.h @@ -75,7 +75,8 @@ PXR_NAMESPACE_OPEN_SCOPE (pointSizeScale) \ (screenSpaceWidths) \ (minScreenSpaceWidths) \ - (shadowCompareTextures) + (shadowCompareTextures) \ + (storm) #define HDST_TEXTURE_TOKENS \ (wrapS) \