summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-11-09 01:17:33 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-11-09 01:17:33 +0000
commitcfca72cfb19367d824a3254b40566b3fc01723ea (patch)
treea2cfd9cc13c67bb162e12ae99ba4e87574b7ee05 /src
parent8850a7e20f77c1bd79863667b2f1c64c2d730f38 (diff)
use UNCLAMPED_FLOAT_TO_USHORT/UBYTE in clear_rgba_buffer() (bug #4992)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_buffers.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index 662a0282ce..b9f20c05c4 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/** XXX This file should be named s_clear.c */
#include "glheader.h"
#include "colormac.h"
@@ -123,17 +124,17 @@ clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
switch (rb->DataType) {
case GL_UNSIGNED_BYTE:
- clear8[0] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[0]);
- clear8[1] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[1]);
- clear8[2] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[2]);
- clear8[3] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[3]);
+ UNCLAMPED_FLOAT_TO_UBYTE(clear8[0], ctx->Color.ClearColor[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(clear8[1], ctx->Color.ClearColor[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(clear8[2], ctx->Color.ClearColor[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(clear8[3], ctx->Color.ClearColor[3]);
clearVal = clear8;
break;
case GL_UNSIGNED_SHORT:
- clear16[0] = FLOAT_TO_USHORT(ctx->Color.ClearColor[0]);
- clear16[1] = FLOAT_TO_USHORT(ctx->Color.ClearColor[1]);
- clear16[2] = FLOAT_TO_USHORT(ctx->Color.ClearColor[2]);
- clear16[3] = FLOAT_TO_USHORT(ctx->Color.ClearColor[3]);
+ UNCLAMPED_FLOAT_TO_USHORT(clear16[0], ctx->Color.ClearColor[0]);
+ UNCLAMPED_FLOAT_TO_USHORT(clear16[1], ctx->Color.ClearColor[1]);
+ UNCLAMPED_FLOAT_TO_USHORT(clear16[2], ctx->Color.ClearColor[2]);
+ UNCLAMPED_FLOAT_TO_USHORT(clear16[3], ctx->Color.ClearColor[3]);
clearVal = clear16;
break;
case GL_FLOAT: