MCPcopy Create free account
hub / github.com/GPUOpen-Tools/compressonator / lerp

Function lerp

cmp_core/shaders/bc6_encode_kernel.cpp:4118–4143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4116}
4117
4118static int lerp(int a, int b, int i, int denom)
4119{
4120 assert(denom == 3 || denom == 7 || denom == 15);
4121 assert(i >= 0 && i <= denom);
4122
4123 int shift = 6, *weights = NULL;
4124
4125 switch (denom)
4126 {
4127 case 3:
4128 denom *= 5;
4129 i *= 5; // fall through to case 15
4130 case 15:
4131 weights = g_aWeights4;
4132 break;
4133 case 7:
4134 weights = g_aWeights3;
4135 break;
4136 default:
4137 assert(0);
4138 }
4139
4140#pragma warning(disable : 4244)
4141 // no need to round these as this is an exact division
4142 return (int)(a * weights[denom - i] + b * weights[i]) / float(1 << shift);
4143}
4144
4145static int finish_unquantize(AMD_BC6H_Format bc6h_format, int q)
4146{

Callers 15

ALerpF1Function · 0.70
ALerpF2Function · 0.70
ALerpF3Function · 0.70
ALerpF4Function · 0.70
ALerpH1Function · 0.70
ALerpH2Function · 0.70
ALerpH3Function · 0.70
ALerpH4Function · 0.70
ALerpD1Function · 0.70
ALerpD2Function · 0.70
ALerpD3Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected