MCPcopy Create free account
hub / github.com/PixarAnimationStudios/OpenUSD / _GetFallbackScalarSwizzleString

Method _GetFallbackScalarSwizzleString

pxr/imaging/hdSt/codeGen.cpp:7030–7054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7028}
7029
7030std::string
7031HdSt_CodeGen::_GetFallbackScalarSwizzleString(TfToken const &returnType,
7032 TfToken const &paramName)
7033{
7034 if (!_IsScalarType(returnType)) {
7035 return "";
7036 }
7037
7038 // TODO: More efficient way of either specifying this at a higher level
7039 // or calculating it in codeGen
7040 TfToken fallbackParamName(paramName.GetString() +
7041 HdSt_ResourceBindingSuffixTokens->fallback.GetString());
7042 TF_FOR_ALL (it, _metaData->shaderData) {
7043 TF_FOR_ALL (dbIt, it->second.entries) {
7044 if (dbIt->name == fallbackParamName) {
7045 if (!_IsScalarType(dbIt->dataType)) {
7046 return ".x";
7047 }
7048 return "";
7049 }
7050 }
7051 }
7052
7053 return "";
7054}
7055
7056PXR_NAMESPACE_CLOSE_SCOPE
7057

Callers

nothing calls this directly

Calls 3

_IsScalarTypeFunction · 0.85
TF_FOR_ALLFunction · 0.70
GetStringMethod · 0.45

Tested by

no test coverage detected