/*
- * Copyright 2003 Tungsten Graphics, inc.
+ * Copyright 2003 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* 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 NON-INFRINGEMENT. IN NO EVENT SHALL
- * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * VMWARE AND/OR THEIR SUPPLIERS 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 <keithw@tungstengraphics.com>
+ * Keith Whitwell <keithw@vmware.com>
*/
#include "main/glheader.h"
#include "main/context.h"
#include "main/colormac.h"
#include "main/simple_list.h"
+#include "swrast/s_chan.h"
#include "t_context.h"
#include "t_vertex.h"
* NDC->Viewport mapping and store the results at 'v'.
*/
-static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = in[3];
}
-static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = 1;
}
-static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = 1;
}
-static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = 1;
}
-static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[2] = vp[10] * in[2] + vp[14];
}
-static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[2] = vp[14];
}
-static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[2] = vp[14];
}
-static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[1] = vp[5] * in[1] + vp[13];
}
-static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
* These functions do the same as above, except for the viewport mapping.
*/
-static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = in[3];
}
-static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = 1;
}
-static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = 1;
}
-static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = 1;
}
-static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[2] = in[3];
}
-static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
(void) a; (void) v; (void) in;
DEBUG_INSERT;
exit(1);
}
-static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[2] = in[2];
}
-static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[2] = 0;
}
-static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
}
-static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[1] = in[1];
}
-static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[1] = 0;
}
-static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[0] = in[0];
}
-static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
DEBUG_INSERT;
(void) a; (void) v; (void) in;
}
-static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]);
}
-static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
c[3] = CHAN_MAX;
}
-static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
c[3] = CHAN_MAX;
}
-static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
c[3] = CHAN_MAX;
}
-static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
}
-static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
}
-static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
}
-static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
}
-static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[0] = 0xff;
}
-static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
}
-static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[2] = 0;
}
-static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[2] = 0;
}
-static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
}
-static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
v[0] = 0;
}
-static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
}
-static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
a[j].extract( &a[j], fin, vin + a[j].vertoffset );
a[j].extract( &a[j], fout, vout + a[j].vertoffset );
- INTERP_F( t, fdst[3], fout[3], fin[3] );
- INTERP_F( t, fdst[2], fout[2], fin[2] );
- INTERP_F( t, fdst[1], fout[1], fin[1] );
- INTERP_F( t, fdst[0], fout[0], fin[0] );
+ INTERP_4F(t, fdst, fout, fin);
a[j].insert[4-1]( &a[j], vdst + a[j].vertoffset, fdst );
}