| Summary: | glReadPixels with 16 bits per channel - truncation error | ||
|---|---|---|---|
| Product: | Mesa | Reporter: | Roy Walmsley <roy.walmsley> |
| Component: | Mesa core | Assignee: | mesa-dev |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | low | ||
| Version: | git | ||
| Hardware: | x86 (IA32) | ||
| OS: | Windows (All) | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
|
Description
Roy Walmsley
2005-11-08 08:45:51 UTC
Instead of changing the FLOAT_TO_USHORT macro, would using the CLAMPED_FLOAT_TO_USHORT() macro work instead? I realize the return value is handled differently. I'm thinking that we should totally get rid of FLOAT_TO_USHORT() and use either UNCLAMPED_FLOAT_TO_USHORT() or CLAMPED_FLOAT_TO_USHORT() in all cases. Both of those do rounding to the nearest int, which is what the GL spec calls for anyway. I have undone the change in macros.h to FLOAT_TO_USHORT and instead changed the macros called in image.c from FLOAT_TO_USHORT to CLAMPED_FLOAT_TO_USHORT as you suggested and this works fine. I chose to use the CLAMPED rather than the UNCLAMPED macro purely in the interests of efficiency as, certainly in my case, values should already be clamped as they are the outputs from the rendering process. OK, I've made this change in CVS for the next release. Mass version move, cvs -> git |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.