Fix build errors/warnings.

This commit is contained in:
castano
2011-09-28 22:02:46 +00:00
parent f0d9497e1f
commit 9de43e7757
3 changed files with 16 additions and 14 deletions

View File

@ -238,15 +238,17 @@ namespace nv
// I'm always confused about which quantizer to use. I think we should choose a quantizer based on how the values are expanded later and this is generally using the 'exact endpoints' rule.
// Quantize a [0, 1] full precision float, using exact endpoints.
inline float quantizeFloat(float f, int bits) {
float scale = (1 << bits) - 1;
inline float quantizeFloat(float f, uint bits) {
nvDebugCheck(bits <= 16);
float scale = float((1 << bits) - 1);
float offset = 0.0f;
return floor(saturate(f) * scale + offset) / scale;
}
// Quantize a [0, 1] full precision float, using uniform bins.
/*inline float quantizeFloat(float f, int bits) {
float scale = (1 << bits);
/*inline float quantizeFloat(float f, uint bits) {
nvDebugCheck(bits <= 16);
float scale = float(1 << bits);
float offset = 0.5f;
return floor(saturate(f) * scale + offset) / scale;
}*/