* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c,v 1.4 2002/10/30 12:52:01 alanh Exp $ */
/* New fixes:
* Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
static void tdfxRasterPrimitive( GLcontext *ctx, GLenum prim );
static void tdfxRenderPrimitive( GLcontext *ctx, GLenum prim );
+static GLenum reduced_prim[GL_POLYGON+1] = {
+ GL_POINTS,
+ GL_LINES,
+ GL_LINES,
+ GL_LINES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES,
+ GL_TRIANGLES
+};
+
/***********************************************************************
* Macros for t_dd_tritmp.h to draw basic primitives *
***********************************************************************/
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
if (fxMesa->vertexFormat == TDFX_LAYOUT_TINY) {
- dst->win[0] = src->x - fxMesa->x_offset;
- dst->win[1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset);
- dst->win[2] = src->z;
- dst->win[3] = 1.0;
+ dst->attrib[FRAG_ATTRIB_WPOS][0] = src->x - fxMesa->x_offset;
+ dst->attrib[FRAG_ATTRIB_WPOS][1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset);
+ dst->attrib[FRAG_ATTRIB_WPOS][2] = src->z;
+ dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0;
dst->color[0] = src->color[2];
dst->color[1] = src->color[1];
else {
GLfloat w = 1.0 / src->rhw;
- dst->win[0] = src->x - fxMesa->x_offset;
- dst->win[1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset);
- dst->win[2] = src->z;
- dst->win[3] = src->rhw;
+ dst->attrib[FRAG_ATTRIB_WPOS][0] = src->x - fxMesa->x_offset;
+ dst->attrib[FRAG_ATTRIB_WPOS][1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset);
+ dst->attrib[FRAG_ATTRIB_WPOS][2] = src->z;
+ dst->attrib[FRAG_ATTRIB_WPOS][3] = src->rhw;
dst->color[0] = src->color[2];
dst->color[1] = src->color[1];
dst->color[2] = src->color[0];
dst->color[3] = src->color[3];
- dst->texcoord[0][0] = 1.0 / fxMesa->sScale0 * w * src->tu0;
- dst->texcoord[0][1] = 1.0 / fxMesa->tScale0 * w * src->tv0;
+ dst->attrib[FRAG_ATTRIB_TEX0][0] = 1.0 / fxMesa->sScale0 * w * src->tu0;
+ dst->attrib[FRAG_ATTRIB_TEX0][1] = 1.0 / fxMesa->tScale0 * w * src->tv0;
if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ1 || fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
- dst->texcoord[0][3] = w * src->tq0;
+ dst->attrib[FRAG_ATTRIB_TEX0][3] = w * src->tq0;
} else {
- dst->texcoord[0][3] = 1.0;
+ dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0;
}
if (fxMesa->SetupIndex & TDFX_TEX1_BIT) {
- dst->texcoord[1][0] = 1.0 / fxMesa->sScale1 * w * src->tu1;
- dst->texcoord[1][1] = 1.0 / fxMesa->tScale1 * w * src->tv1;
+ dst->attrib[FRAG_ATTRIB_TEX1][0] = 1.0 / fxMesa->sScale1 * w * src->tu1;
+ dst->attrib[FRAG_ATTRIB_TEX1][1] = 1.0 / fxMesa->tScale1 * w * src->tv1;
if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
- dst->texcoord[1][3] = w * src->tq1;
+ dst->attrib[FRAG_ATTRIB_TEX1][3] = w * src->tq1;
} else {
- dst->texcoord[1][3] = 1.0;
+ dst->attrib[FRAG_ATTRIB_TEX1][3] = 1.0;
}
}
}
- dst->pointSize = ctx->Point._Size;
+ dst->pointSize = ctx->Point.Size;
}
* rendering. These functions are only used when mixed-mode rendering
* is occurring.
*/
-static void tdfx_draw_quad( tdfxContextPtr fxMesa,
- tdfxVertexPtr v0,
- tdfxVertexPtr v1,
- tdfxVertexPtr v2,
- tdfxVertexPtr v3 )
-{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
- BEGIN_CLIP_LOOP_LOCKED(fxMesa) {
- QUAD( v0, v1, v2, v3 );
- } END_CLIP_LOOP_LOCKED(fxMesa);
-}
-
static void tdfx_draw_triangle( tdfxContextPtr fxMesa,
tdfxVertexPtr v0,
tdfxVertexPtr v1,
* Functions to draw basic unfilled primitives *
***********************************************************************/
-#define RASTERIZE(x) if (fxMesa->raster_primitive != x) \
- tdfxRasterPrimitive( ctx, x )
+#define RASTERIZE(x) if (fxMesa->raster_primitive != reduced_prim[x]) \
+ tdfxRasterPrimitive( ctx, reduced_prim[x] )
#define RENDER_PRIMITIVE fxMesa->render_primitive
#define IND TDFX_FALLBACK_BIT
#define TAG(x) x
}
-static GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-
/* Always called between RenderStart and RenderFinish --> We already
* hold the lock.
"Texture border",
"glColorMask",
"blend mode",
- "line stipple"
+ "line stipple",
+ "Rasterization disable"
};
FLUSH_BATCH(fxMesa);
_swsetup_Wakeup( ctx );
fxMesa->RenderIndex = ~0;
- if (fxMesa->debugFallbacks) {
+ if (TDFX_DEBUG & DEBUG_VERBOSE_FALL) {
fprintf(stderr, "Tdfx begin software fallback: 0x%x %s\n",
bit, getFallbackString(bit));
}
tnl->Driver.Render.BuildVertices = tdfxBuildVertices;
fxMesa->new_gl_state |= (_TDFX_NEW_RENDERSTATE|
_TDFX_NEW_RASTERSETUP);
- if (fxMesa->debugFallbacks) {
+ if (TDFX_DEBUG & DEBUG_VERBOSE_FALL) {
fprintf(stderr, "Tdfx end software fallback: 0x%x %s\n",
bit, getFallbackString(bit));
}