diff options
Diffstat (limited to 'xc/extras')
-rw-r--r-- | xc/extras/Mesa/src/swrast/s_context.c | 20 | ||||
-rw-r--r-- | xc/extras/Mesa/src/swrast/swrast.h | 5 | ||||
-rw-r--r-- | xc/extras/Mesa/src/swrast_setup/ss_context.c | 11 | ||||
-rw-r--r-- | xc/extras/Mesa/src/swrast_setup/ss_context.h | 6 | ||||
-rw-r--r-- | xc/extras/Mesa/src/texstate.c | 3 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h | 18 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl_dd/t_dd_triemit.h | 40 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl_dd/t_dd_vb.c | 74 | ||||
-rwxr-xr-x | xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc | 2 |
9 files changed, 145 insertions, 34 deletions
diff --git a/xc/extras/Mesa/src/swrast/s_context.c b/xc/extras/Mesa/src/swrast/s_context.c index 094725f40..4cdb4f87f 100644 --- a/xc/extras/Mesa/src/swrast/s_context.c +++ b/xc/extras/Mesa/src/swrast/s_context.c @@ -526,6 +526,24 @@ _swrast_GetDeviceDriverReference( GLcontext *ctx ) return &swrast->Driver; } + +void +_swrast_render_start( GLcontext *ctx ) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + if (swrast->Driver.SpanRenderStart) + swrast->Driver.SpanRenderStart( ctx ); +} + +void +_swrast_render_finish( GLcontext *ctx ) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + if (swrast->Driver.SpanRenderFinish) + swrast->Driver.SpanRenderFinish( ctx ); +} + + #define SWRAST_DEBUG_VERTICES 0 void @@ -560,3 +578,5 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ) fprintf(stderr, "\n"); } } + + diff --git a/xc/extras/Mesa/src/swrast/swrast.h b/xc/extras/Mesa/src/swrast/swrast.h index 6799bc309..830c1baee 100644 --- a/xc/extras/Mesa/src/swrast/swrast.h +++ b/xc/extras/Mesa/src/swrast/swrast.h @@ -152,6 +152,11 @@ _swrast_Quad( GLcontext *ctx, extern void _swrast_flush( GLcontext *ctx ); +extern void +_swrast_render_start( GLcontext *ctx ); + +extern void +_swrast_render_finish( GLcontext *ctx ); /* Tell the software rasterizer about core state changes. */ diff --git a/xc/extras/Mesa/src/swrast_setup/ss_context.c b/xc/extras/Mesa/src/swrast_setup/ss_context.c index 557d48f00..58d85faa1 100644 --- a/xc/extras/Mesa/src/swrast_setup/ss_context.c +++ b/xc/extras/Mesa/src/swrast_setup/ss_context.c @@ -48,7 +48,6 @@ #define _SWSETUP_NEW_RENDERINDEX (_NEW_POLYGON|_NEW_LIGHT) - GLboolean _swsetup_CreateContext( GLcontext *ctx ) { @@ -116,19 +115,13 @@ _swsetup_RenderStart( GLcontext *ctx ) swsetup->NewState = 0; - if (swsetup->Driver.Start) - swsetup->Driver.Start( ctx ); + _swrast_render_start( ctx ); } static void _swsetup_RenderFinish( GLcontext *ctx ) { - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - - _swrast_flush( ctx ); - - if (swsetup->Driver.Finish) - swsetup->Driver.Finish( ctx ); + _swrast_render_finish( ctx ); } void diff --git a/xc/extras/Mesa/src/swrast_setup/ss_context.h b/xc/extras/Mesa/src/swrast_setup/ss_context.h index 973edd024..3174c95de 100644 --- a/xc/extras/Mesa/src/swrast_setup/ss_context.h +++ b/xc/extras/Mesa/src/swrast_setup/ss_context.h @@ -43,12 +43,6 @@ typedef struct { */ struct gl_client_array ChanColor; struct gl_client_array ChanSecondaryColor; - - - struct { - void (*Start)( GLcontext * ); - void (*Finish)( GLcontext * ); - } Driver; } SScontext; #define SWSETUP_CONTEXT(ctx) ((SScontext *)ctx->swsetup_context) diff --git a/xc/extras/Mesa/src/texstate.c b/xc/extras/Mesa/src/texstate.c index db4031fcc..89db8520c 100644 --- a/xc/extras/Mesa/src/texstate.c +++ b/xc/extras/Mesa/src/texstate.c @@ -1362,6 +1362,9 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = 0; else if (img->TexFormat->IntensityBits > 0) *params = img->TexFormat->IntensityBits; + else if (img->TexFormat->LuminanceBits > 0) + /* intensity probably stored as luminance-alpha texture */ + *params = MIN2(img->TexFormat->LuminanceBits, img->TexFormat->AlphaBits); else /* intensity probably stored as rgb texture */ *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); return; diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h b/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h index e37631e69..1d2614fbc 100644 --- a/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h +++ b/xc/extras/Mesa/src/tnl_dd/t_dd_dmatmp2.h @@ -112,9 +112,11 @@ static void TAG(render_points_verts)( GLcontext *ctx, GLuint count, GLuint flags ) { - LOCAL_VARS; - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - EMIT_PRIM( ctx, GL_POINTS, HW_POINTS, start, count ); + if (start < count) { + LOCAL_VARS; + if (0) fprintf(stderr, "%s\n", __FUNCTION__); + EMIT_PRIM( ctx, GL_POINTS, HW_POINTS, start, count ); + } } static void TAG(render_lines_verts)( GLcontext *ctx, @@ -156,7 +158,7 @@ static void TAG(render_line_strip_verts)( GLcontext *ctx, RESET_STIPPLE(); - if (PREFER_DISCREET_ELT_PRIM( count-start, HW_LINES )) + if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) { int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); int currentsz; @@ -220,7 +222,7 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx, if (start+1 >= count) return; - if (PREFER_DISCREET_ELT_PRIM( count-start, HW_LINES )) { + if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) { int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); int currentsz; @@ -334,7 +336,7 @@ static void TAG(render_triangles_verts)( GLcontext *ctx, return; } - /* need a PREFER_DISCREET_ELT_PRIM here too.. + /* need a PREFER_DISCRETE_ELT_PRIM here too.. */ EMIT_PRIM( ctx, GL_TRIANGLES, HW_TRIANGLES, start, count ); } @@ -352,7 +354,7 @@ static void TAG(render_tri_strip_verts)( GLcontext *ctx, if (start + 2 >= count) return; - if (PREFER_DISCREET_ELT_PRIM( count-start, HW_TRIANGLES )) + if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) { int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); int currentsz; @@ -434,7 +436,7 @@ static void TAG(render_tri_fan_verts)( GLcontext *ctx, if (start+2 >= count) return; - if (PREFER_DISCREET_ELT_PRIM( count-start, HW_TRIANGLES )) + if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) { int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); int currentsz; diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_triemit.h b/xc/extras/Mesa/src/tnl_dd/t_dd_triemit.h index 39c4a20c4..2f5bcee7e 100644 --- a/xc/extras/Mesa/src/tnl_dd/t_dd_triemit.h +++ b/xc/extras/Mesa/src/tnl_dd/t_dd_triemit.h @@ -1,3 +1,10 @@ +#ifndef DO_DEBUG_VERTS +#define DO_DEBUG_VERTS 0 +#endif + +#ifndef PRINT_VERTEX +#define PRINT_VERTEX(x) +#endif #if defined(USE_X86_ASM) #define COPY_DWORDS( j, vb, vertsize, v ) \ @@ -31,6 +38,14 @@ static __inline void TAG(quad)( CTX_ARG, GLuint *vb = (GLuint *)ALLOC_VERTS( 4, vertsize); GLuint j; + if (DO_DEBUG_VERTS) { + fprintf(stderr, "%s\n", __FUNCTION__); + PRINT_VERTEX(v0); + PRINT_VERTEX(v1); + PRINT_VERTEX(v2); + PRINT_VERTEX(v3); + } + COPY_DWORDS( j, vb, vertsize, v0 ); COPY_DWORDS( j, vb, vertsize, v1 ); COPY_DWORDS( j, vb, vertsize, v2 ); @@ -47,6 +62,14 @@ static __inline void TAG(quad)( CTX_ARG, GLuint *vb = (GLuint *)ALLOC_VERTS( 6, vertsize); GLuint j; + if (DO_DEBUG_VERTS) { + fprintf(stderr, "%s\n", __FUNCTION__); + PRINT_VERTEX(v0); + PRINT_VERTEX(v1); + PRINT_VERTEX(v2); + PRINT_VERTEX(v3); + } + COPY_DWORDS( j, vb, vertsize, v0 ); COPY_DWORDS( j, vb, vertsize, v1 ); COPY_DWORDS( j, vb, vertsize, v3 ); @@ -66,6 +89,13 @@ static __inline void TAG(triangle)( CTX_ARG, GLuint *vb = (GLuint *)ALLOC_VERTS( 3, vertsize); GLuint j; + if (DO_DEBUG_VERTS) { + fprintf(stderr, "%s\n", __FUNCTION__); + PRINT_VERTEX(v0); + PRINT_VERTEX(v1); + PRINT_VERTEX(v2); + } + COPY_DWORDS( j, vb, vertsize, v0 ); COPY_DWORDS( j, vb, vertsize, v1 ); COPY_DWORDS( j, vb, vertsize, v2 ); @@ -108,7 +138,17 @@ static void TAG(fast_clipped_poly)( GLcontext *ctx, const GLuint *elts, const GLuint *start = (const GLuint *)VERT(elts[0]); int i,j; + if (DO_DEBUG_VERTS) { + fprintf(stderr, "%s\n", __FUNCTION__); + PRINT_VERTEX(VERT(elts[0])); + PRINT_VERTEX(VERT(elts[1])); + } + for (i = 2 ; i < n ; i++) { + if (DO_DEBUG_VERTS) { + PRINT_VERTEX(VERT(elts[i])); + } + COPY_DWORDS( j, vb, vertsize, VERT(elts[i-1]) ); COPY_DWORDS( j, vb, vertsize, VERT(elts[i]) ); COPY_DWORDS( j, vb, vertsize, start ); diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c b/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c index 2478ebaa4..3ba8fb3d8 100644 --- a/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c +++ b/xc/extras/Mesa/src/tnl_dd/t_dd_vb.c @@ -194,22 +194,78 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v ) LOCALVARS GLuint format = GET_VERTEX_FORMAT(); - if (format == TINY_VERTEX_FORMAT) { - fprintf(stderr, "x %f y %f z %f\n", v->v.x, v->v.y, v->v.z); - fprintf(stderr, "r %d g %d b %d a %d\n", + fprintf(stderr, "(%x) ", format); + + switch (format) { +#if HAVE_TINY_VERTICES + case TINY_VERTEX_FORMAT: + fprintf(stderr, "xyz %.4f,%.4f,%.4f rgba %x:%x:%x:%x\n", + v->v.x, v->v.y, v->v.z, v->tv.color.red, v->tv.color.green, v->tv.color.blue, v->tv.color.alpha); - } - else { - fprintf(stderr, "x %f y %f z %f oow %f\n", - v->v.x, v->v.y, v->v.z, v->v.w); - fprintf(stderr, "r %d g %d b %d a %d\n", + break; +#endif +#if HAVE_NOTEX_VERTICES + case NOTEX_VERTEX_FORMAT: + fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x spec %x:%x:%x:%x\n", + v->v.x, v->v.y, v->v.z, v->v.w, + v->v.color.red, + v->v.color.green, + v->v.color.blue, + v->v.color.alpha, + v->v.specular.red, + v->v.specular.green, + v->v.specular.blue, + v->v.specular.alpha); + break; +#endif +#if HAVE_TEX0_VERTICES + case TEX0_VERTEX_FORMAT: + fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f\n", + v->v.x, v->v.y, v->v.z, v->v.w, + v->v.color.red, + v->v.color.green, + v->v.color.blue, + v->v.color.alpha, + v->v.u0, + v->v.v0); + break; +#endif +#if HAVE_TEX1_VERTICES + case TEX1_VERTEX_FORMAT: + fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f st %.4f,%.4f\n", + v->v.x, v->v.y, v->v.z, v->v.w, + v->v.color.red, + v->v.color.green, + v->v.color.blue, + v->v.color.alpha, + v->v.u0, + v->v.v0, + v->v.u1, + v->v.u2); + break; +#endif +#if HAVE_PTEX_VERTICES + case PROJ_TEX1_VERTEX_FORMAT: + fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x stq %.4f,%.4f,%.4f stq %.4f,%.4f,%.4f\n", + v->v.x, v->v.y, v->v.z, v->v.w, v->v.color.red, v->v.color.green, v->v.color.blue, - v->v.color.alpha); + v->v.color.alpha, + v->pv.u0, + v->pv.v0, + v->pv.q0, + v->pv.u1, + v->pv.v1, + v->pv.q1); + break; +#endif + default: + fprintf(stderr, "???\n"); + break; } fprintf(stderr, "\n"); diff --git a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc index 02cfb906c..9d0b290b3 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc +++ b/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/quicksort.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2002/07/05 08:31:06 $ $Revision: 1.3 $ */ /* -** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/Attic/quicksort.cc,v 1.3 2002/07/05 08:31:06 alanh Exp $ */ #include <stdlib.h> |