示例#1
0
static void interp_extras( GLcontext *ctx,
                           GLfloat t,
                           GLuint dst, GLuint out, GLuint in,
                           GLboolean force_boundary )
{
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;

    if (VB->ColorPtr[1]) {
        /* If stride is zero, ColorPtr[1] is constant across the VB, so
         * there is no point interpolating between two values as they will
         * be identical.  This case is handled in t_dd_tritmp.h
         */
        if (VB->ColorPtr[1]->stride) {
            assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
            INTERP_4F( t,
                       GET_COLOR(VB->ColorPtr[1], dst),
                       GET_COLOR(VB->ColorPtr[1], out),
                       GET_COLOR(VB->ColorPtr[1], in) );
        }

        if (VB->SecondaryColorPtr[1]) {
            INTERP_3F( t,
                       GET_COLOR(VB->SecondaryColorPtr[1], dst),
                       GET_COLOR(VB->SecondaryColorPtr[1], out),
                       GET_COLOR(VB->SecondaryColorPtr[1], in) );
        }
    }

    if (VB->EdgeFlag) {
        VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
    }

    setup_tab[FX_CONTEXT(ctx)->SetupIndex].interp(ctx, t, dst, out, in,
            force_boundary);
}
INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
					  GLfloat t,
					  GLuint dst, GLuint out, GLuint in,
					  GLboolean force_boundary )
{
   LOCALVARS
   struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;

   if (VB->ColorPtr[1]) {
      assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
      
      INTERP_4F( t,
		    GET_COLOR(VB->ColorPtr[1], dst),
		    GET_COLOR(VB->ColorPtr[1], out),
		    GET_COLOR(VB->ColorPtr[1], in) );

      if (VB->SecondaryColorPtr[1]) {
	 INTERP_3F( t,
		       GET_COLOR(VB->SecondaryColorPtr[1], dst),
		       GET_COLOR(VB->SecondaryColorPtr[1], out),
		       GET_COLOR(VB->SecondaryColorPtr[1], in) );
      }
   }

   if (VB->EdgeFlag) {
      VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
   }

   INTERP_VERTEX(ctx, t, dst, out, in, force_boundary);
}
示例#3
0
/* Helper functions for hardware which doesn't put back colors and/or
 * edgeflags into vertices.
 */
static void generic_interp_extras( GLcontext *ctx,
				   GLfloat t,
				   GLuint dst, GLuint out, GLuint in,
				   GLboolean force_boundary )
{
   struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;

   if (VB->ColorPtr[1]) {
      assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));

      INTERP_4F( t,
		 VB->ColorPtr[1]->data[dst],
		 VB->ColorPtr[1]->data[out],
		 VB->ColorPtr[1]->data[in] );

      if (VB->SecondaryColorPtr[1]) {
	 INTERP_3F( t,
		    VB->SecondaryColorPtr[1]->data[dst],
		    VB->SecondaryColorPtr[1]->data[out],
		    VB->SecondaryColorPtr[1]->data[in] );
      }
   }
   else if (VB->IndexPtr[1]) {
      VB->IndexPtr[1]->data[dst][0] = LINTERP( t,
					       VB->IndexPtr[1]->data[out][0],
					       VB->IndexPtr[1]->data[in][0] );
   }

   if (VB->EdgeFlag) {
      VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
   }

   generic_interp(ctx, t, dst, out, in, force_boundary);
}
示例#4
0
/* Helper functions for hardware which doesn't put back colors and/or
 * edgeflags into vertices.
 */
void _tnl_generic_interp_extras( struct gl_context *ctx,
                                 GLfloat t,
                                 GLuint dst, GLuint out, GLuint in,
                                 GLboolean force_boundary )
{
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;

    /* If stride is zero, BackfaceColorPtr is constant across the VB, so
     * there is no point interpolating between two values as they will
     * be identical.  In all other cases, this value is generated by
     * t_vb_lighttmp.h and has a stride of 4 dwords.
     */
    if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
        assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));

        INTERP_4F( t,
                   VB->BackfaceColorPtr->data[dst],
                   VB->BackfaceColorPtr->data[out],
                   VB->BackfaceColorPtr->data[in] );
    }

    if (VB->BackfaceSecondaryColorPtr) {
        assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat));

        INTERP_3F( t,
                   VB->BackfaceSecondaryColorPtr->data[dst],
                   VB->BackfaceSecondaryColorPtr->data[out],
                   VB->BackfaceSecondaryColorPtr->data[in] );
    }

    if (VB->BackfaceIndexPtr) {
        VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t,
                                             VB->BackfaceIndexPtr->data[out][0],
                                             VB->BackfaceIndexPtr->data[in][0] );
    }

    if (VB->EdgeFlag) {
        VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
    }

    _tnl_generic_interp(ctx, t, dst, out, in, force_boundary);
}