vbo: pass the stream from DrawTransformFeedbackStream to drivers
[mesa.git] / src / mesa / tnl / t_vb_fog.c
index 7a240c81590bf4fb845b7f9862140cf20a69ee11..5489ed6857f6b8eff26c2ba1c0dc7fe260007092 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  * 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
- * THE AUTHORS 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.
  *
  * Authors:
- *    Keith Whitwell <keith@tungstengraphics.com>
+ *    Keith Whitwell <keithw@vmware.com>
  */
 
 
+#include "c99_math.h"
 #include "main/glheader.h"
-#include "main/colormac.h"
 #include "main/macros.h"
 #include "main/imports.h"
 #include "main/mtypes.h"
@@ -45,8 +45,8 @@ struct fog_stage_data {
 #define FOG_STAGE_DATA(stage) ((struct fog_stage_data *)stage->privatePtr)
 
 #define FOG_EXP_TABLE_SIZE 256
-#define FOG_MAX (10.0)
-#define EXP_FOG_MAX .0006595
+#define FOG_MAX (10.0F)
+#define EXP_FOG_MAX .0006595F
 #define FOG_INCR (FOG_MAX/FOG_EXP_TABLE_SIZE)
 static GLfloat exp_table[FOG_EXP_TABLE_SIZE];
 static GLfloat inited = 0;
@@ -54,7 +54,7 @@ static GLfloat inited = 0;
 #if 1
 #define NEG_EXP( result, narg )                                                \
 do {                                                                   \
-   GLfloat f = (GLfloat) (narg * (1.0/FOG_INCR));                      \
+   GLfloat f = (GLfloat) (narg * (1.0F / FOG_INCR));                   \
    GLint k = (GLint) f;                                                        \
    if (k > FOG_EXP_TABLE_SIZE-2)                                       \
       result = (GLfloat) EXP_FOG_MAX;                                  \
@@ -78,7 +78,7 @@ init_static_data( void )
    GLfloat f = 0.0F;
    GLint i = 0;
    for ( ; i < FOG_EXP_TABLE_SIZE ; i++, f += FOG_INCR) {
-      exp_table[i] = EXPF(-f);
+      exp_table[i] = expf(-f);
    }
    inited = 1;
 }
@@ -186,7 +186,7 @@ run_fog_stage(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
            NOTE should avoid going through array twice */
         coord = input->start;
         for (i = 0; i < input->count; i++) {
-           *coord = FABSF(*coord);
+           *coord = fabsf(*coord);
            STRIDE_F(coord, input->stride);
         }
       }
@@ -201,7 +201,7 @@ run_fog_stage(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
         input->count = VB->EyePtr->count;
         coord = VB->EyePtr->start;
         for (i = 0 ; i < VB->EyePtr->count; i++) {
-           input->data[i][0] = FABSF(coord[2]);
+           input->data[i][0] = fabsf(coord[2]);
            STRIDE_F(coord, VB->EyePtr->stride);
         }
       }