MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CTS / RepeatNormalizedAddressFn

Function RepeatNormalizedAddressFn

test_common/harness/imageHelpers.cpp:671–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669// space! hence the special case here
670volatile float gFloatHome;
671float RepeatNormalizedAddressFn(float fValue, size_t maxValue)
672{
673#ifndef _MSC_VER // Use original if not the VS compiler.
674 // General computation for repeat
675 return (fValue - floorf(fValue)) * (float)maxValue; // Reduce to [0, 1.f]
676#else // Otherwise, use this instead:
677 // Home the subtraction to a float to break up the sequence of x87
678 // instructions emitted by the VS compiler.
679 gFloatHome = fValue - floorf(fValue);
680 return gFloatHome * (float)maxValue;
681#endif
682}
683
684float MirroredRepeatNormalizedAddressFn(float fValue, size_t maxValue)
685{

Callers 2

unnormalize_coordinateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected