summaryrefslogtreecommitdiff
path: root/src/mesa/swrast_setup
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2001-01-29 20:47:39 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2001-01-29 20:47:39 +0000
commit5c1e7fa6ee72f4403d9ec9d12830dd689b966e71 (patch)
tree8cb11c26af178632b05de9c5b2f53c32331475c5 /src/mesa/swrast_setup
parent4b90e68ac6d0fe4ffca5e2cd51794bb4350cac28 (diff)
Removed knowledge of swrast Clear/Bitmap/Accum/Draw/Read/CopyPixels
functions from core mesa -- if drivers need these fallbacks they must now call them themselves. Introduced hooks for clip-vertex-interpolation and the rendering of clipped lines and polygons. Allows drivers to interpolate their hardware-format vertices directly. Used in dri drivers to replace fastpath code. Slight optimizations to pipeline build/run routines.
Diffstat (limited to 'src/mesa/swrast_setup')
-rw-r--r--src/mesa/swrast_setup/ss_context.c32
-rw-r--r--src/mesa/swrast_setup/ss_context.h7
-rw-r--r--src/mesa/swrast_setup/ss_vbtmp.h5
-rw-r--r--src/mesa/swrast_setup/swrast_setup.h18
4 files changed, 59 insertions, 3 deletions
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index a6c7aa8740a..83c7f45ffa6 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -1,4 +1,4 @@
-/* $Id: ss_context.c,v 1.8 2001/01/16 05:29:43 keithw Exp $ */
+/* $Id: ss_context.c,v 1.9 2001/01/29 20:47:39 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -32,6 +32,7 @@
#include "ss_context.h"
#include "ss_triangle.h"
#include "ss_vb.h"
+#include "ss_interp.h"
#include "swrast_setup.h"
#include "tnl/t_context.h"
@@ -107,6 +108,7 @@ _swsetup_CreateContext( GLcontext *ctx )
swsetup->NewState = ~0;
_swsetup_vb_init( ctx );
+ _swsetup_interp_init( ctx );
_swsetup_trifuncs_init( ctx );
return GL_TRUE;
@@ -134,6 +136,7 @@ void
_swsetup_RenderStart( GLcontext *ctx )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLuint new_state = swsetup->NewState;
if (new_state & _SWSETUP_NEW_RENDERINDEX) {
@@ -145,6 +148,11 @@ _swsetup_RenderStart( GLcontext *ctx )
}
swsetup->NewState = 0;
+
+ if (VB->ClipMask && VB->importable_data)
+ VB->import_data( ctx,
+ VB->importable_data,
+ VEC_NOT_WRITEABLE|VEC_BAD_STRIDE);
}
void
@@ -156,6 +164,26 @@ _swsetup_RenderFinish( GLcontext *ctx )
void
_swsetup_InvalidateState( GLcontext *ctx, GLuint new_state )
{
- SWSETUP_CONTEXT(ctx)->NewState |= new_state;
+ SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ swsetup->NewState |= new_state;
+
+ if (new_state & _SWSETUP_NEW_INTERP) {
+ swsetup->RenderInterp = _swsetup_validate_interp;
+ swsetup->RenderCopyPV = _swsetup_validate_copypv;
+ }
+}
+
+void
+_swsetup_RenderInterp( GLcontext *ctx, GLfloat t,
+ GLuint dst, GLuint out, GLuint in,
+ GLboolean force_boundary )
+{
+ SWSETUP_CONTEXT(ctx)->RenderInterp( ctx, t, dst, out, in, force_boundary );
+}
+
+void
+_swsetup_RenderCopyPV( GLcontext *ctx, GLuint dst, GLuint src )
+{
+ SWSETUP_CONTEXT(ctx)->RenderCopyPV( ctx, dst, src );
}
diff --git a/src/mesa/swrast_setup/ss_context.h b/src/mesa/swrast_setup/ss_context.h
index 957a8fc3fc5..d19b1c62e01 100644
--- a/src/mesa/swrast_setup/ss_context.h
+++ b/src/mesa/swrast_setup/ss_context.h
@@ -53,6 +53,13 @@ typedef struct {
void (*Points)( GLcontext *ctx, GLuint first, GLuint last );
+ void (*RenderCopyPV)( GLcontext *ctx, GLuint dst, GLuint src );
+
+ void (*RenderInterp)( GLcontext *ctx, GLfloat t,
+ GLuint dst, GLuint out, GLuint in,
+ GLboolean force_boundary );
+
+
SWvertex *verts;
GLenum render_prim;
diff --git a/src/mesa/swrast_setup/ss_vbtmp.h b/src/mesa/swrast_setup/ss_vbtmp.h
index 23b22d95ab7..6197f5bdb56 100644
--- a/src/mesa/swrast_setup/ss_vbtmp.h
+++ b/src/mesa/swrast_setup/ss_vbtmp.h
@@ -49,7 +49,10 @@ static void TAG(rs)(GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs )
const GLfloat tz = m[14];
GLuint maxtex = 0;
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
+ if (!newinputs) {
+ fprintf(stderr, "no new inputs\n");
+ return;
+ }
/* TODO: Get import_client_data to pad vectors out to 4 cleanly.
*/
diff --git a/src/mesa/swrast_setup/swrast_setup.h b/src/mesa/swrast_setup/swrast_setup.h
index f3607c75e9f..f3f8941a40f 100644
--- a/src/mesa/swrast_setup/swrast_setup.h
+++ b/src/mesa/swrast_setup/swrast_setup.h
@@ -69,4 +69,22 @@ _swsetup_RenderStart( GLcontext *ctx );
extern void
_swsetup_RenderFinish( GLcontext *ctx );
+extern void
+_swsetup_RenderProjectInterpVerts( GLcontext *ctx );
+
+extern void
+_swsetup_RenderInterp( GLcontext *ctx, GLfloat t,
+ GLuint dst, GLuint out, GLuint in,
+ GLboolean force_boundary );
+extern void
+_swsetup_RenderCopyPV( GLcontext *ctx, GLuint dst, GLuint src );
+
+extern void
+_swsetup_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n );
+
+extern void
+_swsetup_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj );
+
+
+
#endif