MCPcopy Create free account
hub / github.com/alecazam/kram / RegisterVector

Function RegisterVector

hlslparser/src/HLSLParser.cpp:1355–1377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1353}
1354
1355void RegisterVector(HLSLBaseType type, uint32_t typeOffset, NumericType numericType, int binaryOpRank, const char* typeName, uint32_t dim)
1356{
1357 char buf[32];
1358 snprintf(buf, sizeof(buf), "%s%d", typeName, dim);
1359 const char* name = gStringPool.AddString(buf);
1360
1361 HLSLBaseType baseType = (HLSLBaseType)(type + typeOffset);
1362
1363 BaseTypeDescription& desc = baseTypeDescriptions[type + typeOffset];
1364 desc.typeName = name;
1365 desc.typeNameMetal = name;
1366
1367 // 4 types
1368 desc.baseType = baseType;
1369 desc.coreType = CoreType_Vector;
1370 desc.dimensionType = DimensionType(DimensionType_Vector2 + (dim - 2));
1371 desc.numericType = numericType;
1372
1373 desc.numDimensions = 1;
1374 desc.numComponents = dim;
1375 desc.height = 1;
1376 desc.binaryOpRank = binaryOpRank;
1377}
1378
1379void RegisterScalar(HLSLBaseType type, uint32_t typeOffset, NumericType numericType, int binaryOpRank, const char* typeName)
1380{

Callers 1

InitBaseTypeDescriptionsFunction · 0.85

Calls 2

DimensionTypeEnum · 0.85
AddStringMethod · 0.45

Tested by

no test coverage detected