MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / FindGridCell

Function FindGridCell

external/mikktspace/mikktspace.c:440–445  ·  view source on GitHub ↗

it is IMPORTANT that this function is called to evaluate the hash since inlining could potentially reorder instructions and generate different results for the same effective input value fVal.

Source from the content-addressed store, hash-verified

438// inlining could potentially reorder instructions and generate different
439// results for the same effective input value fVal.
440static NOINLINE int FindGridCell(const float fMin, const float fMax, const float fVal)
441{
442 const float fIndex = g_iCells * ((fVal-fMin)/(fMax-fMin));
443 const int iIndex = (int)fIndex;
444 return iIndex < g_iCells ? (iIndex >= 0 ? iIndex : 0) : (g_iCells - 1);
445}
446
447static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in);
448static void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected