summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_vb_cliptmp.h
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2001-01-13 05:48:25 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2001-01-13 05:48:25 +0000
commit321f67c4729adeebd7aa9ef9e22c95e709952851 (patch)
tree8661da8a994f3c554c4428afdd53642c0814854b /src/mesa/tnl/t_vb_cliptmp.h
parenta087c7421bef25747e1d692f62062393d849c501 (diff)
Fix crash in book/stencil.
Allow drivers to perform the perspective divide themselves. Assembly to do cliptesting without perspective divide for size-4 vectors.
Diffstat (limited to 'src/mesa/tnl/t_vb_cliptmp.h')
-rw-r--r--src/mesa/tnl/t_vb_cliptmp.h45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h
index 5957f4960c..56f2031c90 100644
--- a/src/mesa/tnl/t_vb_cliptmp.h
+++ b/src/mesa/tnl/t_vb_cliptmp.h
@@ -1,4 +1,4 @@
-/* $Id: t_vb_cliptmp.h,v 1.5 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: t_vb_cliptmp.h,v 1.6 2001/01/13 05:48:26 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -115,29 +115,32 @@ do { \
} while (0)
-/* Project if necessary.
- */
static void TAG(build_proj_verts)( GLcontext *ctx )
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*coord)[4] = VB->ClipPtr->data;
- GLfloat (*proj)[4] = VB->ProjectedClipPtr->data;
- GLuint last = VB->LastClipped;
- GLuint i;
-
- for (i = VB->FirstClipped; i < last; i++) {
- if (VB->ClipMask[i] == 0) {
- if (SIZE == 4 && W(i) != 0.0F) {
- GLfloat wInv = 1.0F / W(i);
- proj[i][0] = X(i) * wInv;
- proj[i][1] = Y(i) * wInv;
- proj[i][2] = Z(i) * wInv;
- proj[i][3] = wInv;
- } else {
- proj[i][0] = X(i);
- proj[i][1] = Y(i);
- proj[i][2] = Z(i);
- proj[i][3] = W(i);
+
+ /* Project if necessary.
+ */
+ if (VB->ProjectedClipPtr) {
+ GLfloat (*coord)[4] = VB->ClipPtr->data;
+ GLfloat (*proj)[4] = VB->ProjectedClipPtr->data;
+ GLuint last = VB->LastClipped;
+ GLuint i;
+
+ for (i = VB->FirstClipped; i < last; i++) {
+ if (VB->ClipMask[i] == 0) {
+ if (SIZE == 4 && W(i) != 0.0F) {
+ GLfloat wInv = 1.0F / W(i);
+ proj[i][0] = X(i) * wInv;
+ proj[i][1] = Y(i) * wInv;
+ proj[i][2] = Z(i) * wInv;
+ proj[i][3] = wInv;
+ } else {
+ proj[i][0] = X(i);
+ proj[i][1] = Y(i);
+ proj[i][2] = Z(i);
+ proj[i][3] = W(i);
+ }
}
}
}