X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmath%2Fm_trans_tmp.h;h=0a8bfc53848045ed952c215d70cc1f7676273019;hb=286795803c94f14bb0a11366dc1b6f8e497cd8df;hp=c1f0f76743645cfecfe1c11e5a8436b15337e953;hpb=12c037dbff3d5a812e31624645d577413cd54122;p=mesa.git diff --git a/src/mesa/math/m_trans_tmp.h b/src/mesa/math/m_trans_tmp.h index c1f0f767436..0a8bfc53848 100644 --- a/src/mesa/math/m_trans_tmp.h +++ b/src/mesa/math/m_trans_tmp.h @@ -1,8 +1,7 @@ /* * Mesa 3-D graphics library - * Version: 5.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -17,25 +16,20 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ -/* - * New (3.1) transformation code written by Keith Whitwell. +/** + * \brief Templates for vector conversions. + * \author Keith Whitwell. */ - -/* KW: This file also included by tnl/trans_elt.c to build code - * specific to the implementation of array-elements in the - * tnl module. - */ - - #ifdef DEST_4F static void DEST_4F( GLfloat (*t)[4], - CONST void *ptr, + const void *ptr, GLuint stride, ARGS ) { @@ -46,22 +40,20 @@ static void DEST_4F( GLfloat (*t)[4], (void) first; (void) start; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) t[i][0] = TRX_4F(f, 0); - if (SZ >= 2) t[i][1] = TRX_4F(f, 1); - if (SZ >= 3) t[i][2] = TRX_4F(f, 2); - if (SZ == 4) t[i][3] = TRX_4F(f, 3); else t[i][3] = 1.0; - } + NEXT_F2; + if (SZ >= 1) t[i][0] = TRX_4F(f, 0); + if (SZ >= 2) t[i][1] = TRX_4F(f, 1); + if (SZ >= 3) t[i][2] = TRX_4F(f, 2); + if (SZ == 4) t[i][3] = TRX_4F(f, 3); else t[i][3] = 1.0; } } #endif -#ifdef DEST_4FC -static void DEST_4FC( GLfloat (*t)[4], - CONST void *ptr, +#ifdef DEST_4FN +static void DEST_4FN( GLfloat (*t)[4], + const void *ptr, GLuint stride, ARGS ) { @@ -72,21 +64,19 @@ static void DEST_4FC( GLfloat (*t)[4], (void) first; (void) start; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) t[i][0] = TRX_4FC(f, 0); - if (SZ >= 2) t[i][1] = TRX_4FC(f, 1); - if (SZ >= 3) t[i][2] = TRX_4FC(f, 2); - if (SZ == 4) t[i][3] = TRX_4FC(f, 3); else t[i][3] = 1.0; - } + NEXT_F2; + if (SZ >= 1) t[i][0] = TRX_4FN(f, 0); + if (SZ >= 2) t[i][1] = TRX_4FN(f, 1); + if (SZ >= 3) t[i][2] = TRX_4FN(f, 2); + if (SZ == 4) t[i][3] = TRX_4FN(f, 3); else t[i][3] = 1.0; } } #endif -#ifdef DEST_3F -static void DEST_3F( GLfloat (*t)[3], - CONST void *ptr, +#ifdef DEST_3FN +static void DEST_3FN( GLfloat (*t)[3], + const void *ptr, GLuint stride, ARGS ) { @@ -96,19 +86,17 @@ static void DEST_3F( GLfloat (*t)[3], (void) first; (void) start; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - t[i][0] = TRX_3F(f, 0); - t[i][1] = TRX_3F(f, 1); - t[i][2] = TRX_3F(f, 2); - } + NEXT_F2; + t[i][0] = TRX_3FN(f, 0); + t[i][1] = TRX_3FN(f, 1); + t[i][2] = TRX_3FN(f, 2); } } #endif #ifdef DEST_1F static void DEST_1F( GLfloat *t, - CONST void *ptr, + const void *ptr, GLuint stride, ARGS ) { @@ -118,17 +106,15 @@ static void DEST_1F( GLfloat *t, (void) first; (void) start; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - t[i] = TRX_1F(f, 0); - } + NEXT_F2; + t[i] = TRX_1F(f, 0); } } #endif #ifdef DEST_4UB static void DEST_4UB( GLubyte (*t)[4], - CONST void *ptr, + const void *ptr, GLuint stride, ARGS ) { @@ -138,13 +124,11 @@ static void DEST_4UB( GLubyte (*t)[4], (void) start; (void) first; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) TRX_UB(t[i][0], f, 0); - if (SZ >= 2) TRX_UB(t[i][1], f, 1); - if (SZ >= 3) TRX_UB(t[i][2], f, 2); - if (SZ == 4) TRX_UB(t[i][3], f, 3); else t[i][3] = 255; - } + NEXT_F2; + if (SZ >= 1) TRX_UB(t[i][0], f, 0); + if (SZ >= 2) TRX_UB(t[i][1], f, 1); + if (SZ >= 3) TRX_UB(t[i][2], f, 2); + if (SZ == 4) TRX_UB(t[i][3], f, 3); else t[i][3] = 255; } } #endif @@ -152,7 +136,7 @@ static void DEST_4UB( GLubyte (*t)[4], #ifdef DEST_4US static void DEST_4US( GLushort (*t)[4], - CONST void *ptr, + const void *ptr, GLuint stride, ARGS ) { @@ -162,13 +146,11 @@ static void DEST_4US( GLushort (*t)[4], (void) start; (void) first; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - if (SZ >= 1) TRX_US(t[i][0], f, 0); - if (SZ >= 2) TRX_US(t[i][1], f, 1); - if (SZ >= 3) TRX_US(t[i][2], f, 2); - if (SZ == 4) TRX_US(t[i][3], f, 3); else t[i][3] = 65535; - } + NEXT_F2; + if (SZ >= 1) TRX_US(t[i][0], f, 0); + if (SZ >= 2) TRX_US(t[i][1], f, 1); + if (SZ >= 3) TRX_US(t[i][2], f, 2); + if (SZ == 4) TRX_US(t[i][3], f, 3); else t[i][3] = 65535; } } #endif @@ -176,7 +158,7 @@ static void DEST_4US( GLushort (*t)[4], #ifdef DEST_1UB static void DEST_1UB( GLubyte *t, - CONST void *ptr, + const void *ptr, GLuint stride, ARGS ) { @@ -186,10 +168,8 @@ static void DEST_1UB( GLubyte *t, (void) start; (void) first; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - TRX_UB(t[i], f, 0); - } + NEXT_F2; + TRX_UB(t[i], f, 0); } } #endif @@ -197,7 +177,7 @@ static void DEST_1UB( GLubyte *t, #ifdef DEST_1UI static void DEST_1UI( GLuint *t, - CONST void *ptr, + const void *ptr, GLuint stride, ARGS ) { @@ -208,10 +188,8 @@ static void DEST_1UI( GLuint *t, (void) first; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { - NEXT_F2; - t[i] = TRX_UI(f, 0); - } + NEXT_F2; + t[i] = TRX_UI(f, 0); } } #endif @@ -220,20 +198,20 @@ static void DEST_1UI( GLuint *t, static void INIT(void) { #ifdef DEST_1UI - ASSERT(SZ == 1); + assert(SZ == 1); TAB(_1ui)[SRC_IDX] = DEST_1UI; #endif #ifdef DEST_1UB - ASSERT(SZ == 1); + assert(SZ == 1); TAB(_1ub)[SRC_IDX] = DEST_1UB; #endif #ifdef DEST_1F - ASSERT(SZ == 1); + assert(SZ == 1); TAB(_1f)[SRC_IDX] = DEST_1F; #endif -#ifdef DEST_3F - ASSERT(SZ == 3); - TAB(_3f)[SRC_IDX] = DEST_3F; +#ifdef DEST_3FN + assert(SZ == 3); + TAB(_3fn)[SRC_IDX] = DEST_3FN; #endif #ifdef DEST_4UB TAB(_4ub)[SZ][SRC_IDX] = DEST_4UB; @@ -244,8 +222,8 @@ static void INIT(void) #ifdef DEST_4F TAB(_4f)[SZ][SRC_IDX] = DEST_4F; #endif -#ifdef DEST_4FC - TAB(_4fc)[SZ][SRC_IDX] = DEST_4FC; +#ifdef DEST_4FN + TAB(_4fn)[SZ][SRC_IDX] = DEST_4FN; #endif } @@ -266,14 +244,14 @@ static void INIT(void) #ifdef DEST_4US #undef DEST_4US #endif -#ifdef DEST_3F -#undef DEST_3F +#ifdef DEST_3FN +#undef DEST_3FN #endif #ifdef DEST_4F #undef DEST_4F #endif -#ifdef DEST_4FC -#undef DEST_4FC +#ifdef DEST_4FN +#undef DEST_4FN #endif #ifdef DEST_1F #undef DEST_1F