summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkeithw <keithw>2000-08-17 23:11:33 +0000
committerkeithw <keithw>2000-08-17 23:11:33 +0000
commite876bc89c7939ab189fc37e6d55157b1eb967195 (patch)
treeb73418d45ffc3df8ab850e5df584b75c69d31a48
parent06051943e0540097b49f72597e821db8c76f474d (diff)
- Performance tuning for non-fastpath pipelines.
- Use variable vertex sizes. - Correct logicop handling. - Workaround for blender bug.
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/Imakefile21
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h16
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c9
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810context.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810fastpath.c9
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810ioctl.c26
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810ioctl.h31
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810state.c65
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tris.c139
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tris.h221
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810tritmp.h198
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810vb.c17
-rw-r--r--xc/lib/GL/mesa/src/drv/i810/i810vb.h1
13 files changed, 425 insertions, 330 deletions
diff --git a/xc/lib/GL/mesa/src/drv/i810/Imakefile b/xc/lib/GL/mesa/src/drv/i810/Imakefile
index abf1e5960..8f4ee0f3d 100644
--- a/xc/lib/GL/mesa/src/drv/i810/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/i810/Imakefile
@@ -52,6 +52,13 @@ MESA_INCLUDES = -I. -I.. -I../../include
../../../../dri/drm/xf86drmRandom.o \
../../../../dri/drm/xf86drmSL.o
+#ifdef GlxSoProf
+ HIOBJS = ../../../../highpc.o
+ LOOBJS = ../../../../lowpc.o
+#else
+ HIOBJS =
+ LOOBJS =
+#endif
I810SRCS = i810_xmesa.c \
i810dd.c \
@@ -263,8 +270,10 @@ XCOMM Disabling 3Dnow code for the time being.
COMMONSRCS = ../common/mm.c ../common/hwlog.c
COMMONOBJS = ../common/mm.o ../common/hwlog.o
- SRCS = $(DRISRCS) $(DRMSRCS) $(MESASRCS) $(ASMSRCS) $(COMMONSRCS) $(I810SRCS)
- OBJS = $(DRIOBJS) $(DRMOBJS) $(MESAOBJS) $(ASMOBJS) $(COMMONOBJS) $(I810OBJS)
+ SRCS = $(LOSRCS) $(DRISRCS) $(DRMSRCS) $(MESASRCS) $(ASMSRCS) \
+ $(COMMONSRCS) $(I810SRCS) $(HISRCS)
+ OBJS = $(LOOBJS) $(DRIOBJS) $(DRMOBJS) $(MESAOBJS) $(ASMOBJS) \
+ $(COMMONOBJS) $(I810OBJS) $(HIOBJS)
REQUIREDLIBS += -lm
#if !GlxBuiltInI810
@@ -292,6 +301,14 @@ ALL_OBJS = $(OBJS)
ALL_DEPS = DONE
SharedDepModuleTarget($(LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri)
+
+#ifdef GlxSoProf
+SOPROF_LIBNAME = _i810_dri_p
+NormalDepLibraryTarget($(SOPROF_LIBNAME),$(ALL_DEPS),$(ALL_OBJS))
+InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri)
+#endif
#endif
+
+
DependTarget()
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h b/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h
index 5c2548280..bb19196ce 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h
@@ -110,6 +110,8 @@
#define LCS_LINEWIDTH_SHIFT 12
#define LCS_LINEWIDTH_0_5 (0x1<<12)
#define LCS_LINEWIDTH_1_0 (0x2<<12)
+#define LCS_LINEWIDTH_2_0 (0x4<<12)
+#define LCS_LINEWIDTH_3_0 (0x6<<12)
#define LCS_UPDATE_ALPHA_INTERP (0x1<<11)
#define LCS_ALPHA_FLAT (0x0<<10)
#define LCS_ALPHA_INTERP (0x1<<10)
@@ -653,4 +655,18 @@ typedef struct {
#define I810PACKCOLOR565(r,g,b) \
((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
+
+#define I810_VFMT_T0 (GFX_OP_VERTEX_FMT | \
+ VF_TEXCOORD_COUNT_1 | \
+ VF_SPEC_FOG_ENABLE | \
+ VF_RGBA_ENABLE | \
+ VF_XYZW)
+
+#define I810_VFMT_T0T1 (GFX_OP_VERTEX_FMT | \
+ VF_TEXCOORD_COUNT_2 | \
+ VF_SPEC_FOG_ENABLE | \
+ VF_RGBA_ENABLE | \
+ VF_XYZW)
+
+
#endif
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c b/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c
index 63d8f5826..fbc35c1c4 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c
@@ -339,6 +339,12 @@ GLboolean XMesaCreateContext( Display *dpy, GLvisual *mesaVis,
ctx->Const.MaxTextureSize = 1<<10;
}
+ ctx->Const.MinLineWidth = 1.0;
+ ctx->Const.MinLineWidthAA = 1.0;
+ ctx->Const.MaxLineWidth = 3.0;
+ ctx->Const.MaxLineWidthAA = 3.0;
+ ctx->Const.LineWidthGranularity = 1.0;
+
/* Dri stuff
*/
@@ -381,6 +387,7 @@ GLboolean XMesaCreateContext( Display *dpy, GLvisual *mesaVis,
ctx->Driver.TriangleCaps = (DD_TRI_CULL|
DD_TRI_LIGHT_TWOSIDE|
+ DD_LIGHTING_CULL|
DD_TRI_STIPPLE|
DD_TRI_OFFSET);
@@ -480,7 +487,6 @@ void i810XMesaSetFrontClipRects( i810ContextPtr imesa )
imesa->drawX = dPriv->x;
imesa->drawY = dPriv->y;
- imesa->drawMap = (char *)imesa->driScreen->pFB;
i810EmitDrawingRectangle( imesa );
}
@@ -511,7 +517,6 @@ void i810XMesaSetBackClipRects( i810ContextPtr imesa )
imesa->drawY = dPriv->backY;
}
- imesa->drawMap = imesa->i810Screen->back.map;
i810EmitDrawingRectangle( imesa );
imesa->dirty |= I810_UPLOAD_CLIPRECTS;
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810context.h b/xc/lib/GL/mesa/src/drv/i810/i810context.h
index 1e0bc560f..d716e0e7c 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810context.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810context.h
@@ -54,6 +54,7 @@ typedef struct i810_texture_object_t *i810TextureObjectPtr;
#define I810_FALLBACK_COLORMASK 0x8
#define I810_FALLBACK_STIPPLE 0x10
#define I810_FALLBACK_SPECULAR 0x20
+#define I810_FALLBACK_LOGICOP 0x40
@@ -96,6 +97,7 @@ struct i810_context_t {
*/
GLuint Setup[I810_CTX_SETUP_SIZE];
GLuint BufferSetup[I810_DEST_SETUP_SIZE];
+ int vertsize;
/* Support for CVA and the fast paths.
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c b/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c
index 3e4887619..abffcb737 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810fastpath.c
@@ -50,9 +50,9 @@ struct i810_fast_tab {
-#define POINT(x) i810_draw_point(imesa, &ivert[x].v, psize)
-#define LINE(x,y) i810_draw_line(imesa, &ivert[x].v, &ivert[y].v, lwidth)
-#define TRI(x,y,z) i810_draw_triangle(imesa, &ivert[x].v, &ivert[y].v, &ivert[z].v)
+#define POINT(x) i810_draw_point(imesa, &ivert[x], psize)
+#define LINE(x,y) i810_draw_line(imesa, &ivert[x], &ivert[y] )
+#define TRI(x,y,z) i810_draw_triangle(imesa, &ivert[x], &ivert[y], &ivert[z])
@@ -94,9 +94,8 @@ do { \
const GLuint *elt = VB->EltPtr->data; \
GLcontext *ctx = VB->ctx; \
i810ContextPtr imesa = I810_CONTEXT(ctx); \
- const GLfloat lwidth = ctx->Line.Width; \
const GLfloat psize = ctx->Point.Size; \
- (void) lwidth; (void)psize; (void) ivert;
+ (void)psize; (void) ivert;
#define TAG(x) x##_i810_smooth_indirect
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
index 8a31c94ff..5826485bd 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.c
@@ -14,7 +14,7 @@
#include "drm.h"
#include <sys/ioctl.h>
-static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa )
+drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa )
{
drm_i810_dma_t dma;
drmBufPtr buf;
@@ -43,7 +43,7 @@ static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa )
buf = &(imesa->i810Screen->bufs->list[dma.request_idx]);
buf->idx = dma.request_idx;
- buf->used = 0;
+ buf->used = 4; /* leave room for instruction header */
buf->total = dma.request_size;
if(imesa->i810Screen->use_copy_buf != 1)
@@ -428,45 +428,29 @@ void i810FlushVerticesLocked( i810ContextPtr imesa )
}
-GLuint *i810AllocDwords( i810ContextPtr imesa, int dwords, GLuint prim )
+GLuint *i810AllocDwords( i810ContextPtr imesa, int dwords )
{
GLuint *start;
if (!imesa->vertex_dma_buffer)
{
- if (I810_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "i810AllocPrimitiveVerts -- get buf\n");
LOCK_HARDWARE(imesa);
imesa->vertex_dma_buffer = i810_get_buffer_ioctl( imesa );
- imesa->vertex_dma_buffer->used = 4;
- imesa->vertex_prim = prim;
UNLOCK_HARDWARE(imesa);
}
- else if (imesa->vertex_prim != prim ||
- imesa->vertex_dma_buffer->used + dwords * 4 >
+ else if (imesa->vertex_dma_buffer->used + dwords * 4 >
imesa->vertex_dma_buffer->total)
{
- if (I810_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "i810AllocPrimitiveVerts -- flush\n");
- i810FlushVertices( imesa );
LOCK_HARDWARE(imesa);
+ i810FlushVerticesLocked( imesa );
imesa->vertex_dma_buffer = i810_get_buffer_ioctl( imesa );
- imesa->vertex_dma_buffer->used = 4;
- imesa->vertex_prim = prim;
UNLOCK_HARDWARE(imesa);
}
-
- if (0)
- fprintf(stderr, "i810AllocPrimitiveVerts %d, buf %d, used %d\n",
- dwords, imesa->vertex_dma_buffer->idx,
- imesa->vertex_dma_buffer->used);
-
start = (GLuint *)((char *)imesa->vertex_dma_buffer->address +
imesa->vertex_dma_buffer->used);
imesa->vertex_dma_buffer->used += dwords * 4;
-
return start;
}
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h
index 6e698dd61..f44dc60fe 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810ioctl.h
@@ -4,7 +4,7 @@
#include "i810context.h"
-GLuint *i810AllocDwords( i810ContextPtr imesa, int dwords, GLuint prim );
+GLuint *i810AllocDwords( i810ContextPtr imesa, int dwords );
void i810GetGeneralDmaBufferLocked( i810ContextPtr mmesa );
@@ -34,5 +34,34 @@ GLbitfield i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
if (imesa->vertex_dma_buffer) i810FlushVertices(imesa); \
} while (0)
+extern drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa );
+
+static __inline
+GLuint *i810AllocDwordsInline( i810ContextPtr imesa, int dwords )
+{
+ int bytes = dwords * 4;
+ GLuint *start;
+
+ if (!imesa->vertex_dma_buffer)
+ {
+ LOCK_HARDWARE(imesa);
+ imesa->vertex_dma_buffer = i810_get_buffer_ioctl( imesa );
+ UNLOCK_HARDWARE(imesa);
+ }
+ else if (imesa->vertex_dma_buffer->used + bytes >
+ imesa->vertex_dma_buffer->total)
+ {
+ LOCK_HARDWARE(imesa);
+ i810FlushVerticesLocked( imesa );
+ imesa->vertex_dma_buffer = i810_get_buffer_ioctl( imesa );
+ UNLOCK_HARDWARE(imesa);
+ }
+
+ start = (GLuint *)((char *)imesa->vertex_dma_buffer->address +
+ imesa->vertex_dma_buffer->used);
+
+ imesa->vertex_dma_buffer->used += bytes;
+ return start;
+}
#endif
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810state.c b/xc/lib/GL/mesa/src/drv/i810/i810state.c
index 3103c326c..0607edfea 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810state.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810state.c
@@ -65,8 +65,8 @@ static void i810DDBlendEquation(GLcontext *ctx, GLenum mode)
{
if (mode != GL_FUNC_ADD_EXT) {
ctx->Color.BlendEquation = GL_FUNC_ADD_EXT;
- i810Error("Unsupported blend equation");
- exit(1);
+ if (0) fprintf(stderr, "Unsupported blend equation: %s\n",
+ gl_lookup_enum_by_nr(mode));
}
}
@@ -242,6 +242,20 @@ static void i810DDDither(GLcontext *ctx, GLboolean enable)
{
}
+static void i810DDLogicOp( GLcontext *ctx, GLenum opcode )
+{
+ if (ctx->Color.ColorLogicOpEnabled)
+ {
+ i810ContextPtr imesa = I810_CONTEXT(ctx);
+
+ FLUSH_BATCH( imesa );
+
+ if (opcode == GL_COPY)
+ imesa->Fallback &= ~I810_FALLBACK_LOGICOP;
+ else
+ imesa->Fallback |= I810_FALLBACK_LOGICOP;
+ }
+}
static GLboolean i810DDSetDrawBuffer(GLcontext *ctx, GLenum mode )
{
@@ -254,6 +268,7 @@ static GLboolean i810DDSetDrawBuffer(GLcontext *ctx, GLenum mode )
if (mode == GL_FRONT_LEFT)
{
imesa->drawMap = (char *)imesa->driScreen->pFB;
+ imesa->readMap = (char *)imesa->driScreen->pFB;
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->fbOffset |
imesa->i810Screen->backPitchBits);
imesa->dirty |= I810_UPLOAD_BUFFERS;
@@ -263,6 +278,7 @@ static GLboolean i810DDSetDrawBuffer(GLcontext *ctx, GLenum mode )
else if (mode == GL_BACK_LEFT)
{
imesa->drawMap = imesa->i810Screen->back.map;
+ imesa->readMap = imesa->i810Screen->back.map;
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->backOffset |
imesa->i810Screen->backPitchBits);
imesa->dirty |= I810_UPLOAD_BUFFERS;
@@ -352,6 +368,7 @@ static void i810DDReducedPrimitiveChange( GLcontext *ctx, GLenum prim )
imesa->Setup[I810_CTXREG_LCS] &= ~LCS_CULL_MASK;
imesa->Setup[I810_CTXREG_ST1] &= ~ST1_ENABLE;
imesa->Setup[I810_CTXREG_AA] &= ~AA_ENABLE;
+ imesa->vertex_prim = PR_TRIANGLES;
switch (ctx->PB->primitive) {
case GL_POLYGON:
@@ -366,12 +383,10 @@ static void i810DDReducedPrimitiveChange( GLcontext *ctx, GLenum prim )
imesa->Setup[I810_CTXREG_AA] |= AA_ENABLE;
break;
case GL_LINES:
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_LINEWIDTH_0_5;
- if (ctx->Line.SmoothFlag) {
+ if (ctx->Line.SmoothFlag)
imesa->Setup[I810_CTXREG_AA] |= AA_ENABLE;
- imesa->Setup[I810_CTXREG_LCS] |= LCS_LINEWIDTH_0_5;
- }
imesa->Setup[I810_CTXREG_LCS] |= LCS_CULL_DISABLE;
+ imesa->vertex_prim = PR_LINES;
break;
case GL_POINTS:
if (ctx->Point.SmoothFlag)
@@ -385,6 +400,21 @@ static void i810DDReducedPrimitiveChange( GLcontext *ctx, GLenum prim )
}
+static void i810DDLineWidth( GLcontext *ctx, GLfloat widthf )
+{
+ i810ContextPtr imesa = I810_CONTEXT( ctx );
+ int width = (int)widthf;
+
+ if (width > 3) width = 3;
+ if (width < 1) width = 1;
+
+ imesa->Setup[I810_CTXREG_LCS] &= ~LCS_LINEWIDTH_3_0;
+
+ if (width & 1) imesa->Setup[I810_CTXREG_LCS] |= LCS_LINEWIDTH_1_0;
+ if (width & 2) imesa->Setup[I810_CTXREG_LCS] |= LCS_LINEWIDTH_2_0;
+
+ imesa->dirty |= I810_UPLOAD_CTX;
+}
/* =============================================================
* Color masks
@@ -590,6 +620,13 @@ static void i810DDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
imesa->Setup[I810_CTXREG_MT] |= MT_TEXEL1_ENABLE;
}
break;
+ case GL_COLOR_LOGIC_OP:
+ case GL_INDEX_LOGIC_OP:
+ FLUSH_BATCH( imesa );
+ imesa->Fallback &= ~I810_FALLBACK_LOGICOP;
+ if (state && ctx->Color.LogicOp != GL_COPY)
+ imesa->Fallback |= I810_FALLBACK_LOGICOP;
+ break;
default:
;
}
@@ -713,11 +750,7 @@ void i810DDInitState( i810ContextPtr imesa )
memset(imesa->Setup, 0, sizeof(imesa->Setup));
- imesa->Setup[I810_CTXREG_VF] = (GFX_OP_VERTEX_FMT |
- VF_TEXCOORD_COUNT_2 |
- VF_SPEC_FOG_ENABLE |
- VF_RGBA_ENABLE |
- VF_XYZW);
+ imesa->Setup[I810_CTXREG_VF] = I810_VFMT_T0;
imesa->Setup[I810_CTXREG_MT] = (GFX_OP_MAP_TEXELS |
MT_UPDATE_TEXEL1_STATE |
@@ -925,20 +958,16 @@ void i810DDInitState( i810ContextPtr imesa )
if (imesa->glCtx->Color.DriverDrawBuffer == GL_BACK_LEFT) {
imesa->drawMap = i810Screen->back.map;
+ imesa->readMap = i810Screen->back.map;
imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->backOffset |
i810Screen->backPitchBits);
} else {
imesa->drawMap = (char *)imesa->driScreen->pFB;
+ imesa->readMap = (char *)imesa->driScreen->pFB;
imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->fbOffset |
i810Screen->backPitchBits);
}
- if (imesa->glCtx->Color.DriverDrawBuffer == GL_BACK_LEFT) {
- imesa->readMap = i810Screen->back.map;
- } else {
- imesa->readMap = (char *)imesa->driScreen->pFB;
- }
-
imesa->BufferSetup[I810_DESTREG_DV0] = GFX_OP_DESTBUFFER_VARS;
imesa->BufferSetup[I810_DESTREG_DV1] = (DV_HORG_BIAS_OGL |
DV_VORG_BIAS_OGL |
@@ -1006,6 +1035,8 @@ void i810DDInitStateFuncs(GLcontext *ctx)
ctx->Driver.RenderFinish = 0;
ctx->Driver.PolygonStipple = i810DDPolygonStipple;
ctx->Driver.LineStipple = 0;
+ ctx->Driver.LineWidth = i810DDLineWidth;
+ ctx->Driver.LogicOpcode = i810DDLogicOp;
ctx->Driver.SetReadBuffer = i810DDSetReadBuffer;
ctx->Driver.SetDrawBuffer = i810DDSetDrawBuffer;
ctx->Driver.Color = i810DDSetColor;
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tris.c b/xc/lib/GL/mesa/src/drv/i810/i810tris.c
index c601ca492..dab57e8d9 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tris.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tris.c
@@ -44,13 +44,10 @@
(to)[3] = (from)[3]; \
}
-
-
-static triangle_func tri_tab[0x20];
-static quad_func quad_tab[0x20];
-static line_func line_tab[0x20];
-static points_func points_tab[0x20];
-
+static triangle_func tri_tab[0x10];
+static quad_func quad_tab[0x10];
+static line_func line_tab[0x10];
+static points_func points_tab[0x10];
#define IND (0)
#define TAG(x) x
@@ -60,30 +57,32 @@ static points_func points_tab[0x20];
#define TAG(x) x##_flat
#include "i810tritmp.h"
-#define IND (I810_OFFSET_BIT) /* wide */
+#define IND (I810_OFFSET_BIT)
#define TAG(x) x##_offset
#include "i810tritmp.h"
-#define IND (I810_OFFSET_BIT|I810_FLAT_BIT) /* wide|flat */
+#define IND (I810_OFFSET_BIT|I810_FLAT_BIT)
#define TAG(x) x##_offset_flat
#include "i810tritmp.h"
-#define IND (I810_TWOSIDE_BIT) /* stipple */
+#define IND (I810_TWOSIDE_BIT)
#define TAG(x) x##_twoside
#include "i810tritmp.h"
-#define IND (I810_TWOSIDE_BIT|I810_FLAT_BIT) /* stipple|flat */
+#define IND (I810_TWOSIDE_BIT|I810_FLAT_BIT)
#define TAG(x) x##_twoside_flat
#include "i810tritmp.h"
-#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT) /* stipple|wide */
+#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT)
#define TAG(x) x##_twoside_offset
#include "i810tritmp.h"
-#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT|I810_FLAT_BIT) /* stip|wide|flat*/
+#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT|I810_FLAT_BIT)
#define TAG(x) x##_twoside_offset_flat
#include "i810tritmp.h"
+
+
void i810DDTrifuncInit()
{
init();
@@ -98,62 +97,68 @@ void i810DDTrifuncInit()
+#define ALL_FALLBACK (DD_MULTIDRAW | DD_SELECT | DD_FEEDBACK)
+#define POINT_FALLBACK (ALL_FALLBACK)
+#define LINE_FALLBACK (ALL_FALLBACK | DD_LINE_STIPPLE)
+#define TRI_FALLBACK (ALL_FALLBACK | DD_TRI_UNFILLED)
+#define ANY_FALLBACK (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK|DD_TRI_STIPPLE)
+#define ANY_RASTER_FLAGS (DD_FLATSHADE|DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET)
-void i810DDChooseRenderState( GLcontext *ctx )
+void i810DDChooseRenderState(GLcontext *ctx)
{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLuint flags = ctx->TriangleCaps;
-
- imesa->IndirectTriangles = 0;
-
- if (flags) {
- GLuint ind = 0;
- GLuint shared = 0;
-
- if (flags & DD_FLATSHADE) shared |= I810_FLAT_BIT;
- if (flags & DD_MULTIDRAW) shared |= I810_FALLBACK_BIT;
- if (flags & DD_SELECT) shared |= I810_FALLBACK_BIT;
- if (flags & DD_FEEDBACK) shared |= I810_FALLBACK_BIT;
- if (flags & DD_STENCIL) shared |= I810_FALLBACK_BIT;
-
- imesa->renderindex = shared;
- imesa->PointsFunc = points_tab[shared];
-
- ind = shared;
- if (flags & DD_LINE_WIDTH) ind |= I810_WIDE_LINE_BIT;
- if (flags & DD_LINE_STIPPLE) ind |= I810_FALLBACK_BIT;
-
- imesa->renderindex |= ind;
- imesa->LineFunc = line_tab[ind];
- if (ind & I810_FALLBACK_BIT)
- imesa->IndirectTriangles |= DD_LINE_SW_RASTERIZE;
-
- ind = shared;
- if (flags & DD_TRI_OFFSET) ind |= I810_OFFSET_BIT;
- if (flags & DD_TRI_LIGHT_TWOSIDE) ind |= I810_TWOSIDE_BIT;
- if (flags & DD_TRI_UNFILLED) ind |= I810_FALLBACK_BIT;
- if ((flags & DD_TRI_STIPPLE) &&
- (ctx->IndirectTriangles & DD_TRI_STIPPLE)) ind |= I810_FALLBACK_BIT;
-
- imesa->renderindex |= ind;
- imesa->TriangleFunc = tri_tab[ind];
- imesa->QuadFunc = quad_tab[ind];
- if (ind & I810_FALLBACK_BIT)
- imesa->IndirectTriangles |= (DD_TRI_SW_RASTERIZE|DD_QUAD_SW_RASTERIZE);
- }
- else if (imesa->renderindex)
- {
- imesa->renderindex = 0;
- imesa->PointsFunc = points_tab[0];
- imesa->LineFunc = line_tab[0];
- imesa->TriangleFunc = tri_tab[0];
- imesa->QuadFunc = quad_tab[0];
- }
-
-
- if (I810_DEBUG&DEBUG_VERBOSE_API) {
- gl_print_tri_caps("tricaps", ctx->TriangleCaps);
- }
+ i810ContextPtr imesa = I810_CONTEXT(ctx);
+ GLuint flags = ctx->TriangleCaps;
+ CARD32 index = 0;
+
+ if (imesa->Fallback) {
+ imesa->renderindex = I810_FALLBACK_BIT;
+ return;
+ }
+
+ if (flags & ANY_RASTER_FLAGS) {
+ if (flags & DD_FLATSHADE) index |= I810_FLAT_BIT;
+ if (flags & DD_TRI_LIGHT_TWOSIDE) index |= I810_TWOSIDE_BIT;
+ if (flags & DD_TRI_OFFSET) index |= I810_OFFSET_BIT;
+ }
+
+ imesa->PointsFunc = points_tab[index];
+ imesa->LineFunc = line_tab[index];
+ imesa->TriangleFunc = tri_tab[index];
+ imesa->QuadFunc = quad_tab[index];
+ imesa->renderindex = index;
+ imesa->IndirectTriangles = 0;
+
+ if (flags & ANY_FALLBACK) {
+ if (flags & POINT_FALLBACK) {
+ imesa->renderindex |= I810_FALLBACK_BIT;
+ imesa->PointsFunc = 0;
+ imesa->IndirectTriangles |= DD_POINT_SW_RASTERIZE;
+ }
+
+ if (flags & LINE_FALLBACK) {
+ imesa->renderindex |= I810_FALLBACK_BIT;
+ imesa->LineFunc = 0;
+ imesa->IndirectTriangles |= DD_LINE_SW_RASTERIZE;
+ }
+
+ if (flags & TRI_FALLBACK) {
+ imesa->renderindex |= I810_FALLBACK_BIT;
+ imesa->TriangleFunc = 0;
+ imesa->QuadFunc = 0;
+ imesa->IndirectTriangles |= (DD_TRI_SW_RASTERIZE |
+ DD_QUAD_SW_RASTERIZE);
+ }
+ /* Special cases:
+ */
+ if ((flags & DD_TRI_STIPPLE) &&
+ (ctx->IndirectTriangles & DD_TRI_STIPPLE)) {
+ imesa->renderindex |= I810_FALLBACK_BIT;
+ imesa->TriangleFunc = 0;
+ imesa->QuadFunc = 0;
+ imesa->IndirectTriangles |= (DD_TRI_SW_RASTERIZE |
+ DD_QUAD_SW_RASTERIZE);
+ }
+ }
}
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tris.h b/xc/lib/GL/mesa/src/drv/i810/i810tris.h
index 3b3843683..8a17b4112 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tris.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tris.h
@@ -28,152 +28,131 @@
#include "types.h"
#include "i810ioctl.h"
+#include "i810vb.h"
extern void i810PrintRenderState( const char *msg, GLuint state );
extern void i810DDChooseRenderState(GLcontext *ctx);
extern void i810DDTrifuncInit( void );
-/* shared */
#define I810_FLAT_BIT 0x1
-
-/* triangle */
#define I810_OFFSET_BIT 0x2
#define I810_TWOSIDE_BIT 0x4
+#define I810_FALLBACK_BIT 0x8
-/* line */
-#define I810_WIDE_LINE_BIT 0x2
-#define I810_STIPPLE_LINE_BIT 0x4
-
-/* shared */
-#define I810_FALLBACK_BIT 0x8
-
-
-
-
-
-static i810_vertex __inline__ *i810AllocTriangles( i810ContextPtr imesa, int nr)
-{
- GLuint *start = i810AllocDwords( imesa, 30*nr, PR_TRIANGLES );
- return (i810_vertex *)start;
-}
-
-static i810_vertex __inline__ *i810AllocLine( i810ContextPtr imesa )
-{
- GLuint *start = i810AllocDwords( imesa, 20, PR_LINES );
- return (i810_vertex *)start;
-}
-
-static i810_vertex __inline__ *i810AllocRect( i810ContextPtr imesa )
-{
- GLuint *start = i810AllocDwords( imesa, 30, PR_RECTS );
- return (i810_vertex *)start;
-}
static void __inline__ i810_draw_triangle( i810ContextPtr imesa,
- i810_vertex *v0,
- i810_vertex *v1,
- i810_vertex *v2 )
+ i810VertexPtr v0,
+ i810VertexPtr v1,
+ i810VertexPtr v2 )
{
- i810_vertex *wv = i810AllocTriangles( imesa, 1 );
- wv[0] = *v0;
- wv[1] = *v1;
- wv[2] = *v2;
+ GLuint vertsize = imesa->vertsize;
+ GLuint *vb = i810AllocDwordsInline( imesa, 3 * vertsize );
+ int j;
+
+#if 1
+ __asm__ __volatile__( "rep ; movsl"
+ : "=%c" (j)
+ : "0" (vertsize), "D" ((long)vb), "S" ((long)v0)
+ : "memory" );
+ __asm__ __volatile__( "rep ; movsl"
+ : "=%c" (j)
+ : "0" (vertsize), "S" ((long)v1)
+ : "memory" );
+ __asm__ __volatile__( "rep ; movsl"
+ : "=%c" (j)
+ : "0" (vertsize), "S" ((long)v2)
+ : "memory" );
+#else
+
+ for (j = 0 ; j < vertsize ; j++)
+ vb[j] = v0->ui[j];
+
+ vb += vertsize;
+ for (j = 0 ; j < vertsize ; j++)
+ vb[j] = v1->ui[j];
+
+ vb += vertsize;
+ for (j = 0 ; j < vertsize ; j++)
+ vb[j] = v2->ui[j];
+#endif
}
static __inline__ void i810_draw_point( i810ContextPtr imesa,
- i810_vertex *tmp, float sz )
+ i810VertexPtr tmp,
+ float sz )
{
- i810_vertex *wv = i810AllocTriangles( imesa, 2 );
-
- wv[0] = *tmp;
- wv[0].x = tmp->x - sz;
- wv[0].y = tmp->y - sz;
-
- wv[1] = *tmp;
- wv[1].x = tmp->x + sz;
- wv[1].y = tmp->y - sz;
-
- wv[2] = *tmp;
- wv[2].x = tmp->x + sz;
- wv[2].y = tmp->y + sz;
-
- wv[3] = *tmp;
- wv[3].x = tmp->x + sz;
- wv[3].y = tmp->y + sz;
-
- wv[4] = *tmp;
- wv[4].x = tmp->x - sz;
- wv[4].y = tmp->y + sz;
-
- wv[5] = *tmp;
- wv[5].x = tmp->x - sz;
- wv[5].y = tmp->y - sz;
-
-}
-
-
-static __inline__ void i810_draw_line_line( i810ContextPtr imesa,
- i810_vertex *tmp0,
- i810_vertex *tmp1 )
-{
- i810_vertex *wv = i810AllocLine( imesa );
- wv[0] = *tmp0;
- wv[1] = *tmp1;
-}
-
-static __inline__ void i810_draw_tri_line( i810ContextPtr imesa,
- i810_vertex *tmp0,
- i810_vertex *tmp1,
- float width )
-{
- i810_vertex *wv = i810AllocTriangles( imesa, 2 );
-
- float dx, dy, ix, iy;
-
- dx = tmp0->x - tmp1->x;
- dy = tmp0->y - tmp1->y;
-
- ix = width * .5; iy = 0;
- if (dx * dx > dy * dy) {
- iy = ix; ix = 0;
- }
-
- wv[0] = *tmp0;
- wv[0].x = tmp0->x - ix;
- wv[0].y = tmp0->y - iy;
-
- wv[1] = *tmp1;
- wv[1].x = tmp1->x + ix;
- wv[1].y = tmp1->y + iy;
-
- wv[2] = *tmp0;
- wv[2].x = tmp0->x + ix;
- wv[2].y = tmp0->y + iy;
-
- wv[3] = *tmp0;
- wv[3].x = tmp0->x - ix;
- wv[3].y = tmp0->y - iy;
-
- wv[4] = *tmp1;
- wv[4].x = tmp1->x - ix;
- wv[4].y = tmp1->y - iy;
-
- wv[5] = *tmp1;
- wv[5].x = tmp1->x + ix;
- wv[5].y = tmp1->y + iy;
+ int vertsize = imesa->vertsize;
+ GLuint *vb = i810AllocDwordsInline( imesa, 6 * vertsize );
+ int j;
+
+ *(float *)&vb[0] = tmp->v.x - sz;
+ *(float *)&vb[1] = tmp->v.y - sz;
+ for (j = 2 ; j < vertsize ; j++)
+ vb[j] = tmp->ui[j];
+ vb += vertsize;
+
+ *(float *)&vb[0] = tmp->v.x + sz;
+ *(float *)&vb[1] = tmp->v.y - sz;
+ for (j = 2 ; j < vertsize ; j++)
+ vb[j] = tmp->ui[j];
+ vb += vertsize;
+
+ *(float *)&vb[0] = tmp->v.x + sz;
+ *(float *)&vb[1] = tmp->v.y + sz;
+ for (j = 2 ; j < vertsize ; j++)
+ vb[j] = tmp->ui[j];
+ vb += vertsize;
+
+ *(float *)&vb[0] = tmp->v.x + sz;
+ *(float *)&vb[1] = tmp->v.y + sz;
+ for (j = 2 ; j < vertsize ; j++)
+ vb[j] = tmp->ui[j];
+ vb += vertsize;
+
+ *(float *)&vb[0] = tmp->v.x - sz;
+ *(float *)&vb[1] = tmp->v.y + sz;
+ for (j = 2 ; j < vertsize ; j++)
+ vb[j] = tmp->ui[j];
+ vb += vertsize;
+
+ *(float *)&vb[0] = tmp->v.x - sz;
+ *(float *)&vb[1] = tmp->v.y - sz;
+ for (j = 2 ; j < vertsize ; j++)
+ vb[j] = tmp->ui[j];
}
static __inline__ void i810_draw_line( i810ContextPtr imesa,
- i810_vertex *tmp0,
- i810_vertex *tmp1,
- float width )
+ i810VertexPtr v0,
+ i810VertexPtr v1 )
{
- i810_draw_line_line( imesa, tmp0, tmp1 );
+ GLuint vertsize = imesa->vertsize;
+ GLuint *vb = i810AllocDwordsInline( imesa, 2 * vertsize );
+
+#if defined(USE_X86_ASM)
+ __asm__ __volatile__( "rep ; movsl"
+ : "=%c" (j)
+ : "0" (vertsize), "D" ((long)vb), "S" ((long)v0)
+ : "memory" );
+ __asm__ __volatile__( "rep ; movsl"
+ : "=%c" (j)
+ : "0" (vertsize), "S" ((long)v1)
+ : "memory" );
+#else
+ int j;
+
+ for (j = 0 ; j < vertsize ; j++)
+ vb[j] = v0->ui[j];
+
+ vb += vertsize;
+ for (j = 0 ; j < vertsize ; j++)
+ vb[j] = v1->ui[j];
+#endif
}
+
#endif
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h b/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h
index 9d6b43d93..7eea0038d 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810tritmp.h
@@ -1,96 +1,103 @@
-static __inline__ void TAG(triangle)( GLcontext *ctx, GLuint e0,
- GLuint e1, GLuint e2, GLuint pv )
+static __inline void TAG(triangle)(GLcontext *ctx,
+ GLuint e0, GLuint e1, GLuint e2,
+ GLuint pv)
{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- struct vertex_buffer *VB = ctx->VB;
- i810VertexPtr i810VB = I810_DRIVER_DATA(VB)->verts;
- const i810_vertex *v0 = &i810VB[e0].v;
- const i810_vertex *v1 = &i810VB[e1].v;
- const i810_vertex *v2 = &i810VB[e2].v;
+ i810ContextPtr i810ctx = I810_CONTEXT(ctx);
+ struct vertex_buffer *VB = ctx->VB;
+ i810VertexPtr i810verts = I810_DRIVER_DATA(VB)->verts;
+ i810Vertex *v[3];
#if (IND & I810_OFFSET_BIT)
- GLfloat offset = ctx->Polygon.OffsetUnits * 1.0/0x10000;
+ GLfloat offset;
+ GLfloat z[3];
#endif
-#if (IND & (I810_FLAT_BIT|I810_TWOSIDE_BIT))
- int c0 = *(int *)&i810VB[pv].v.color;
- int c1 = c0;
- int c2 = c0;
+#if (IND & (I810_TWOSIDE_BIT | I810_FLAT_BIT))
+ GLuint c[3];
#endif
+ v[0] = &i810verts[e0];
+ v[1] = &i810verts[e1];
+ v[2] = &i810verts[e2];
+
+#if (IND & (I810_TWOSIDE_BIT | I810_FLAT_BIT))
+ c[0] = v[0]->ui[4];
+ c[1] = v[1]->ui[4];
+ c[2] = v[2]->ui[4];
+#endif
-#if (IND & (I810_TWOSIDE_BIT|I810_OFFSET_BIT))
+
+#if (IND & (I810_TWOSIDE_BIT | I810_OFFSET_BIT))
{
- GLfloat ex = v0->x - v2->x;
- GLfloat ey = v0->y - v2->y;
- GLfloat fx = v1->x - v2->x;
- GLfloat fy = v1->y - v2->y;
- GLfloat c = ex*fy-ey*fx;
-
-#if (IND & I810_TWOSIDE_BIT)
+ GLfloat ex = v[0]->v.x - v[2]->v.x;
+ GLfloat ey = v[0]->v.y - v[2]->v.y;
+ GLfloat fx = v[1]->v.x - v[2]->v.x;
+ GLfloat fy = v[1]->v.y - v[2]->v.y;
+ GLfloat cc = ex*fy - ey*fx;
+
+#if (IND & I810_TWOSIDE_BIT)
{
- GLuint facing = (c>0.0) ^ ctx->Polygon.FrontBit;
+ GLuint facing = (cc > 0.0) ^ ctx->Polygon.FrontBit;
GLubyte (*vbcolor)[4] = VB->Color[facing]->data;
if (IND & I810_FLAT_BIT) {
- I810_COLOR((char *)&c0,vbcolor[pv]);
- c2 = c1 = c0;
+ I810_COLOR((char *)&v[0]->ui[4], vbcolor[pv]);
+ v[2]->ui[4] = v[1]->ui[4] = v[0]->ui[4];
} else {
- I810_COLOR((char *)&c0,vbcolor[e0]);
- I810_COLOR((char *)&c1,vbcolor[e1]);
- I810_COLOR((char *)&c2,vbcolor[e2]);
+ I810_COLOR((char *)&v[0]->ui[4], vbcolor[e0]);
+ I810_COLOR((char *)&v[1]->ui[4], vbcolor[e1]);
+ I810_COLOR((char *)&v[2]->ui[4], vbcolor[e2]);
}
}
#endif
-
-#if (IND & I810_OFFSET_BIT)
+
+#if (IND & I810_OFFSET_BIT)
{
- if (c * c > 1e-16) {
- GLfloat factor = ctx->Polygon.OffsetFactor;
- GLfloat ez = v0->z - v2->z;
- GLfloat fz = v1->z - v2->z;
- GLfloat a = ey*fz-ez*fy;
- GLfloat b = ez*fx-ex*fz;
- GLfloat ic = 1.0 / c;
- GLfloat ac = a * ic;
- GLfloat bc = b * ic;
- if (ac<0.0F) ac = -ac;
- if (bc<0.0F) bc = -bc;
- offset += MAX2( ac, bc ) * factor;
+ offset = ctx->Polygon.OffsetUnits * 1.0/0x10000;
+ z[0] = v[0]->v.z;
+ z[1] = v[1]->v.z;
+ z[2] = v[2]->v.z;
+ if (cc * cc > 1e-16) {
+ GLfloat ez = z[0] - z[2];
+ GLfloat fz = z[1] - z[2];
+ GLfloat a = ey*fz - ez*fy;
+ GLfloat b = ez*fx - ex*fz;
+ GLfloat ic = 1.0 / cc;
+ GLfloat ac = a * ic;
+ GLfloat bc = b * ic;
+ if (ac < 0.0f) ac = -ac;
+ if (bc < 0.0f) bc = -bc;
+ offset += MAX2(ac, bc) * ctx->Polygon.OffsetFactor;
}
+ v[0]->v.z += offset;
+ v[1]->v.z += offset;
+ v[2]->v.z += offset;
}
#endif
}
-#endif
-
-
+#elif (IND & I810_FLAT_BIT)
{
- i810_vertex *wv = i810AllocTriangles( imesa, 1 );
- wv[0] = *v0;
-#if (IND & (I810_FLAT_BIT|I810_TWOSIDE_BIT))
- *((int *)(&wv[0].color)) = c0;
-#endif
-#if (IND & I810_OFFSET_BIT)
- wv[0].z = v0->z + offset;
+ GLuint color = i810verts[pv].ui[4];
+ v[0]->ui[4] = color;
+ v[1]->ui[4] = color;
+ v[2]->ui[4] = color;
+ }
#endif
+ i810_draw_triangle( i810ctx, v[0], v[1], v[2] );
- wv[1] = *v1;
-#if (IND & (I810_FLAT_BIT|I810_TWOSIDE_BIT))
- *((int *)(&wv[1].color)) = c1;
-#endif
#if (IND & I810_OFFSET_BIT)
- wv[1].z = v1->z + offset;
+ v[0]->v.z = z[0];
+ v[1]->v.z = z[1];
+ v[2]->v.z = z[2];
#endif
- wv[2] = *v2;
-#if (IND & (I810_FLAT_BIT|I810_TWOSIDE_BIT))
- *((int *)(&wv[2].color)) = c2;
+#if (IND & (I810_FLAT_BIT | I810_TWOSIDE_BIT))
+ v[0]->ui[4] = c[0];
+ v[1]->ui[4] = c[1];
+ v[2]->ui[4] = c[2];
#endif
-#if (IND & I810_OFFSET_BIT)
- wv[2].z = v2->z + offset;
-#endif
- }
+
}
@@ -106,31 +113,39 @@ static void TAG(line)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint pv )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
i810VertexPtr i810VB = I810_DRIVER_DATA(ctx->VB)->verts;
- int tmp0, tmp1;
- (void) tmp0; (void) tmp1;
+#if (IND & (I810_TWOSIDE_BIT|I810_FLAT_BIT|I810_OFFSET_BIT))
+ i810Vertex tmp0 = i810VB[v0];
+ i810Vertex tmp1 = i810VB[v1];
- if (IND & I810_FLAT_BIT) {
- tmp0 = *(int *)&i810VB[v0].v.color;
- tmp1 = *(int *)&i810VB[v1].v.color;
- i810VB[v0].v.color = i810VB[pv].v.color;
- i810VB[v1].v.color = i810VB[pv].v.color;
- }
+ if (IND & I810_TWOSIDE_BIT) {
+ GLubyte (*vbcolor)[4] = ctx->VB->ColorPtr->data;
- if (IND & I810_WIDE_LINE_BIT)
- {
- i810_draw_tri_line( imesa, &i810VB[v0].v, &i810VB[v1].v,
- ctx->Line.Width );
- }
- else
- {
- i810_draw_line_line( imesa, &i810VB[v0].v, &i810VB[v1].v );
- }
+ if (IND & I810_FLAT_BIT) {
+ I810_COLOR((char *)&tmp0.v.color,vbcolor[pv]);
+ *(int *)&tmp1.v.color = *(int *)&tmp0.v.color;
+ } else {
+ I810_COLOR((char *)&tmp0.v.color,vbcolor[v0]);
+ I810_COLOR((char *)&tmp1.v.color,vbcolor[v1]);
+ }
- if (IND & I810_FLAT_BIT) {
- *(int *)&i810VB[v0].v.color = tmp0;
- *(int *)&i810VB[v1].v.color = tmp1;
- }
+ } else if (IND & I810_FLAT_BIT) {
+ *(int *)&tmp0.v.color = *(int *)&i810VB[pv].v.color;
+ *(int *)&tmp1.v.color = *(int *)&i810VB[pv].v.color;
+ }
+
+ /* Relies on precomputed LineZoffset from vbrender.c
+ */
+ if (IND & I810_OFFSET_BIT) {
+ GLfloat offset = ctx->LineZoffset * (1.0 / 0x10000);
+ tmp0.v.z += offset;
+ tmp1.v.z += offset;
+ }
+
+ i810_draw_line( imesa, &tmp0, &tmp1 );
+#else
+ i810_draw_line( imesa, &i810VB[v0], &i810VB[v1] );
+#endif
}
@@ -148,8 +163,19 @@ static void TAG(points)( GLcontext *ctx, GLuint first, GLuint last )
for(i=first;i<=last;i++) {
if(VB->ClipMask[i]==0) {
- i810_vertex *tmp = &i810VB[i].v;
- i810_draw_point( imesa, tmp, sz );
+ if (IND & I810_TWOSIDE_BIT) {
+ i810Vertex tmp0 = i810VB[i];
+ if (IND & I810_TWOSIDE_BIT) {
+ GLubyte (*vbcolor)[4] = VB->ColorPtr->data;
+ I810_COLOR((char *)&tmp0.v.color, vbcolor[i]);
+ }
+ if (IND & I810_OFFSET_BIT) {
+ GLfloat offset = ctx->PointZoffset * (1.0 / 0x10000);
+ tmp0.v.z += offset;
+ }
+ i810_draw_point( imesa, &tmp0, sz );
+ } else
+ i810_draw_point( imesa, &i810VB[i], sz );
}
}
}
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810vb.c b/xc/lib/GL/mesa/src/drv/i810/i810vb.c
index 59b1d5ef8..075063489 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810vb.c
+++ b/xc/lib/GL/mesa/src/drv/i810/i810vb.c
@@ -261,16 +261,17 @@ void i810ChooseRasterSetupFunc(GLcontext *ctx)
i810ContextPtr imesa = I810_CONTEXT( ctx );
int funcindex = (I810_WIN_BIT | I810_RGBA_BIT);
- if (ctx->Texture.Enabled & 0xf) {
- /* This doesn't work for non-RGBA textures
- if (ctx->Texture.Unit[0].EnvMode == GL_REPLACE)
- funcindex &= ~I810_RGBA_BIT;
- */
- funcindex |= I810_TEX0_BIT;
- }
+ imesa->vertsize = 8;
+ imesa->Setup[I810_CTXREG_VF] = I810_VFMT_T0;
- if (ctx->Texture.Enabled & 0xf0)
+ if (ctx->Texture.Enabled & 0xf)
+ funcindex |= I810_TEX0_BIT;
+
+ if (ctx->Texture.Enabled & 0xf0) {
funcindex |= I810_TEX1_BIT;
+ imesa->vertsize = 10;
+ imesa->Setup[I810_CTXREG_VF] = I810_VFMT_T0T1;
+ }
if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
funcindex |= I810_SPEC_BIT;
diff --git a/xc/lib/GL/mesa/src/drv/i810/i810vb.h b/xc/lib/GL/mesa/src/drv/i810/i810vb.h
index 23685f106..b5553d791 100644
--- a/xc/lib/GL/mesa/src/drv/i810/i810vb.h
+++ b/xc/lib/GL/mesa/src/drv/i810/i810vb.h
@@ -60,6 +60,7 @@ typedef struct {
union i810_vertex_t {
i810_vertex v;
float f[16];
+ GLuint ui[16];
};
typedef union i810_vertex_t i810Vertex;