diff options
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/savage_xmesa.c | 190 | ||||
-rw-r--r-- | src/savageioctl.h | 14 | ||||
-rw-r--r-- | src/savagespan.c | 8 | ||||
-rw-r--r-- | src/savagespan.h | 8 | ||||
-rw-r--r-- | src/savagestate.c | 16 | ||||
-rw-r--r-- | src/savagetex.c | 6 | ||||
-rw-r--r-- | src/savagetris.c | 34 |
8 files changed, 119 insertions, 163 deletions
diff --git a/configure.ac b/configure.ac index aca1dd3..9e9fba9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script AC_PREREQ(2.57) -AC_INIT([mesa-dri-savage], 7.0.3, [], mesa-dri-savage) +AC_INIT([mesa-dri-savage], 7.1.0, [], mesa-dri-savage) AM_INIT_AUTOMAKE([dist-bzip2]) @@ -16,8 +16,8 @@ AC_PROG_CC AC_HEADER_STDC PKG_CHECK_MODULES([DRM], [libdrm >= 2.3.0]) -PKG_CHECK_MODULES([DRI], [libmesadri >= 7.0.3 libmesadri < 7.1.0 - libmesadricommon >= 7.0.3 libmesadricommon < 7.1.0]) +PKG_CHECK_MODULES([DRI], [libmesadri >= 7.1.0 libmesadri < 7.3.0 + libmesadricommon >= 7.1.0 libmesadricommon < 7.3.0]) AC_OUTPUT([ Makefile diff --git a/src/savage_xmesa.c b/src/savage_xmesa.c index 43422db..6f1cbd6 100644 --- a/src/savage_xmesa.c +++ b/src/savage_xmesa.c @@ -168,16 +168,17 @@ static const struct tnl_pipeline_stage *savage_pipeline[] = { }; -/* this is first function called in dirver*/ +PUBLIC const __DRIextension *savageScreenExtensions[] = { + &driCoreExtension.base, + &driLegacyExtension.base, + &driReadDrawableExtension, +}; static GLboolean savageInitDriver(__DRIscreenPrivate *sPriv) { savageScreenPrivate *savageScreen; SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv; - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) { fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n"); @@ -265,10 +266,7 @@ savageInitDriver(__DRIscreenPrivate *sPriv) driParseOptionInfo (&savageScreen->optionCache, __driConfigOptions, __driNConfigOptions); - if (glx_enable_extension != NULL) { - (*glx_enable_extension)(sPriv->psc->screenConfigs, - "GLX_SGI_make_current_read"); - } + sPriv->extensions = savageScreenExtensions; #if 0 savageDDFastPathInit(); @@ -295,34 +293,6 @@ savageDestroyScreen(__DRIscreenPrivate *sPriv) sPriv->private = NULL; } -#if 0 -GLvisual *XMesaCreateVisual(Display *dpy, - __DRIscreenPrivate *driScrnPriv, - const XVisualInfo *visinfo, - const __GLXvisualConfig *config) -{ - /* Drivers may change the args to _mesa_create_visual() in order to - * setup special visuals. - */ - return _mesa_create_visual( config->rgba, - config->doubleBuffer, - config->stereo, - _mesa_bitcount(visinfo->red_mask), - _mesa_bitcount(visinfo->green_mask), - _mesa_bitcount(visinfo->blue_mask), - config->alphaSize, - 0, /* index bits */ - config->depthSize, - config->stencilSize, - config->accumRedSize, - config->accumGreenSize, - config->accumBlueSize, - config->accumAlphaSize, - 0 /* num samples */ ); -} -#endif - - static GLboolean savageCreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, @@ -525,7 +495,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, "enable_fastpath"); /* DRM versions before 2.1.3 would only render triangle lists. ELTS * support was added in 2.2.0. */ - if (imesa->enable_fastpath && sPriv->drmMinor < 2) { + if (imesa->enable_fastpath && sPriv->drm_version.minor < 2) { fprintf (stderr, "*** Disabling fast path because your DRM version is buggy " "or doesn't\n*** support ELTS. You need at least Savage DRM " @@ -732,7 +702,7 @@ void savageXMesaSetClipRects(savageContextPtr imesa) __DRIdrawablePrivate *dPriv = imesa->driDrawable; if ((dPriv->numBackClipRects == 0) - || (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)) { + || (imesa->glCtx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT)) { imesa->numClipRects = dPriv->numClipRects; imesa->pClipRects = dPriv->pClipRects; imesa->drawX = dPriv->x; @@ -917,32 +887,18 @@ void savageGetLock( savageContextPtr imesa, GLuint flags ) } } - - -static const struct __DriverAPIRec savageAPI = { - savageInitDriver, - savageDestroyScreen, - savageCreateContext, - savageDestroyContext, - savageCreateBuffer, - savageDestroyBuffer, - savageSwapBuffers, - savageMakeCurrent, - savageUnbindContext -}; - - -static __GLcontextModes * -savageFillInModes( unsigned pixel_bits, unsigned depth_bits, +static const __DRIconfig ** +savageFillInModes( __DRIscreenPrivate *psp, + unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) { - __GLcontextModes * modes; + __DRIconfig **configs; __GLcontextModes * m; - unsigned num_modes; unsigned depth_buffer_factor; unsigned back_buffer_factor; GLenum fb_format; GLenum fb_type; + int i; /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy * enough to add support. Basically, if a context is created with an @@ -973,8 +929,6 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits, depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; - num_modes = depth_buffer_factor * back_buffer_factor * 4; - if ( pixel_bits == 16 ) { fb_format = GL_RGB; fb_type = GL_UNSIGNED_SHORT_5_6_5; @@ -984,21 +938,11 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); - m = modes; - if ( ! driFillInModes( & m, fb_format, fb_type, - depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor, - GLX_TRUE_COLOR ) ) { - fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", - __func__, __LINE__ ); - return NULL; - } - - if ( ! driFillInModes( & m, fb_format, fb_type, - depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor, - GLX_DIRECT_COLOR ) ) { + configs = driCreateConfigs(fb_format, fb_type, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, back_buffer_factor); + if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); return NULL; @@ -1006,74 +950,68 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits, /* Mark the visual as slow if there are "fake" stencil bits. */ - for ( m = modes ; m != NULL ; m = m->next ) { - if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) { + for (i = 0; configs[i]; i++) { + m = &configs[i]->modes; + if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) { m->visualRating = GLX_SLOW_CONFIG; } } - return modes; + return (const __DRIconfig **) configs; } /** - * This is the bootstrap function for the driver. libGL supplies all of the - * requisite information about the system, and the driver initializes itself. - * This routine also fills in the linked list pointed to by \c driver_modes - * with the \c __GLcontextModes that the driver can support for windows or - * pbuffers. + * This is the driver specific part of the createNewScreen entry point. * - * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on - * failure. + * \todo maybe fold this into intelInitDriver + * + * \return the __GLcontextModes supported by this driver */ -PUBLIC -void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, - const __GLcontextModes * modes, - const __DRIversion * ddx_version, - const __DRIversion * dri_version, - const __DRIversion * drm_version, - const __DRIframebuffer * frame_buffer, - drmAddress pSAREA, int fd, - int internal_api_version, - const __DRIinterfaceMethods * interface, - __GLcontextModes ** driver_modes ) - +static const __DRIconfig ** +savageInitScreen(__DRIscreenPrivate *psp) { - __DRIscreenPrivate *psp; static const __DRIversion ddx_expected = { 2, 0, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 2, 1, 0 }; - - dri_interface = interface; + SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv; if ( ! driCheckDriDdxDrmVersions2( "Savage", - dri_version, & dri_expected, - ddx_version, & ddx_expected, - drm_version, & drm_expected ) ) { + &psp->dri_version, & dri_expected, + &psp->ddx_version, & ddx_expected, + &psp->drm_version, & drm_expected ) ) return NULL; - } - - psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL, - ddx_version, dri_version, drm_version, - frame_buffer, pSAREA, fd, - internal_api_version, &savageAPI); - if ( psp != NULL ) { - SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv; - *driver_modes = savageFillInModes( dri_priv->cpp*8, - (dri_priv->cpp == 2) ? 16 : 24, - (dri_priv->cpp == 2) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - - /* Calling driInitExtensions here, with a NULL context pointer, does not actually - * enable the extensions. It just makes sure that all the dispatch offsets for all - * the extensions that *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is called, but we can't - * enable the extensions until we have a context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - } - return (void *) psp; + /* Calling driInitExtensions here, with a NULL context pointer, + * does not actually enable the extensions. It just makes sure + * that all the dispatch offsets for all the extensions that + * *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is + * called, but we can't enable the extensions until we have a + * context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); + + if (!savageInitDriver(psp)) + return NULL; + + return savageFillInModes( psp, + dri_priv->cpp*8, + (dri_priv->cpp == 2) ? 16 : 24, + (dri_priv->cpp == 2) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } + +const struct __DriverAPIRec driDriverAPI = { + savageInitScreen, + savageDestroyScreen, + savageCreateContext, + savageDestroyContext, + savageCreateBuffer, + savageDestroyBuffer, + savageSwapBuffers, + savageMakeCurrent, + savageUnbindContext +}; diff --git a/src/savageioctl.h b/src/savageioctl.h index c7ff001..50dce84 100644 --- a/src/savageioctl.h +++ b/src/savageioctl.h @@ -64,19 +64,19 @@ void savageSwapBuffers( __DRIdrawablePrivate *dPriv ); extern void savageGetDMABuffer( savageContextPtr imesa ); -static __inline +static INLINE void savageReleaseIndexedVerts( savageContextPtr imesa ) { imesa->firstElt = -1; } -static __inline +static INLINE GLboolean savageHaveIndexedVerts( savageContextPtr imesa ) { return (imesa->firstElt != -1); } -static __inline +static INLINE u_int32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words ) { struct savage_vtxbuf_t *buffer = imesa->vtxBuf; @@ -115,7 +115,7 @@ u_int32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words ) return head; } -static __inline +static INLINE u_int32_t *savageAllocIndexedVerts( savageContextPtr imesa, GLuint n ) { u_int32_t *ret; @@ -131,7 +131,7 @@ u_int32_t *savageAllocIndexedVerts( savageContextPtr imesa, GLuint n ) * - Actually allocate entries for the indices in the command buffer. * (This allocation must succeed without wrapping the cmd buffer!) */ -static __inline +static INLINE void savageFlushElts( savageContextPtr imesa ) { if (imesa->elts.cmd) { @@ -148,7 +148,7 @@ void savageFlushElts( savageContextPtr imesa ) /* Allocate a command buffer entry with <bytes> bytes of arguments: * - implies savageFlushElts */ -static __inline +static INLINE drm_savage_cmd_header_t *savageAllocCmdBuf( savageContextPtr imesa, GLuint bytes ) { drm_savage_cmd_header_t *ret; @@ -171,7 +171,7 @@ drm_savage_cmd_header_t *savageAllocCmdBuf( savageContextPtr imesa, GLuint bytes * incomplete indexed drawing command yet * - increments the number of elts. Final allocation is done in savageFlushElts */ -static __inline +static INLINE u_int16_t *savageAllocElts( savageContextPtr imesa, GLuint n ) { u_int16_t *ret; diff --git a/src/savagespan.c b/src/savagespan.c index 61ab9e6..00fd125 100644 --- a/src/savagespan.c +++ b/src/savagespan.c @@ -93,6 +93,8 @@ /* 16 bit integer depthbuffer functions * Depth range is reversed. See also savageCalcViewport. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = 0xFFFF - d @@ -107,6 +109,8 @@ /* 16 bit float depthbuffer functions */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = \ savageEncodeFloat16( 1.0 - (GLfloat)d/65535.0 ) @@ -125,6 +129,8 @@ /* 8-bit stencil /24-bit integer depth depthbuffer functions. * Depth range is reversed. See also savageCalcViewport. */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) do { \ GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \ tmp &= 0xFF000000; \ @@ -143,6 +149,8 @@ /* 24 bit float depthbuffer functions */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) do { \ GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \ tmp &= 0xFF000000; \ diff --git a/src/savagespan.h b/src/savagespan.h index f6a312e..53a7f8b 100644 --- a/src/savagespan.h +++ b/src/savagespan.h @@ -55,7 +55,7 @@ savageSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis, * * Note that there is no encoding for numbers < 2^-16. */ -static __inline GLuint savageEncodeFloat16( GLdouble x ) +static INLINE GLuint savageEncodeFloat16( GLdouble x ) { GLint r = (GLint)(x * 0x10000000); GLint exp = 0; @@ -67,7 +67,7 @@ static __inline GLuint savageEncodeFloat16( GLdouble x ) } return exp > 0xf ? 0xffff : (r - 0x1000) | (exp << 12); } -static __inline GLdouble savageDecodeFloat16( GLuint x ) +static INLINE GLdouble savageDecodeFloat16( GLuint x ) { static const GLdouble pow2[16] = { 1.0/(1<<28), 1.0/(1<<27), 1.0/(1<<26), 1.0/(1<<25), @@ -92,7 +92,7 @@ static __inline GLdouble savageDecodeFloat16( GLuint x ) * * Details analogous to the 16-bit format. */ -static __inline GLuint savageEncodeFloat24( GLdouble x ) +static INLINE GLuint savageEncodeFloat24( GLdouble x ) { int64_t r = (int64_t)(x * ((int64_t)1 << (19+32))); GLint exp = 0; @@ -105,7 +105,7 @@ static __inline GLuint savageEncodeFloat24( GLdouble x ) return exp > 0x1f ? 0xffffff : (r - 0x80000) | (exp << 19); } #define _1 (int64_t)1 -static __inline GLdouble savageDecodeFloat24( GLuint x ) +static INLINE GLdouble savageDecodeFloat24( GLuint x ) { static const GLdouble pow2[32] = { 1.0/(_1<<51), 1.0/(_1<<50), 1.0/(_1<<49), 1.0/(_1<<48), diff --git a/src/savagestate.c b/src/savagestate.c index 741a9dd..c5ef47f 100644 --- a/src/savagestate.c +++ b/src/savagestate.c @@ -76,7 +76,7 @@ static void savageBlendFunc_s4(GLcontext *); static void savageBlendFunc_s3d(GLcontext *); -static __inline__ GLuint savagePackColor(GLuint format, +static INLINE GLuint savagePackColor(GLuint format, GLubyte r, GLubyte g, GLubyte b, GLubyte a) { @@ -640,15 +640,17 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode ) savageContextPtr imesa = SAVAGE_CONTEXT(ctx); u_int32_t destCtrl = imesa->regs.s4.destCtrl.ui; - /* - * _DrawDestMask is easier to cope with than <mode>. - */ - switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { - case BUFFER_BIT_FRONT_LEFT: + if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { + FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + + switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) { + case BUFFER_FRONT_LEFT: imesa->IsDouble = GL_FALSE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11; break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: imesa->IsDouble = GL_TRUE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11; break; diff --git a/src/savagetex.c b/src/savagetex.c index 719e50f..9b81756 100644 --- a/src/savagetex.c +++ b/src/savagetex.c @@ -101,7 +101,7 @@ static const savageTileInfo tileInfo_s3d_s4[5] = { * \param w width in bytes */ #define SUBTILE_FUNC(w,h) \ -static __inline GLubyte *savageUploadSubtile_##w##x##h \ +static INLINE GLubyte *savageUploadSubtile_##w##x##h \ (GLubyte *dest, GLubyte *src, GLuint srcStride) \ { \ GLuint y; \ @@ -1016,7 +1016,7 @@ static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t ) /* Heap timestamps are only reliable with Savage DRM 2.3.x or * later. Earlier versions had only 16 bit time stamps which * would wrap too frequently. */ - if (imesa->savageScreen->driScrnPriv->drmMinor >= 3) { + if (imesa->savageScreen->driScrnPriv->drm_version.minor >= 3) { unsigned int heap = t->base.heap->heapId; LOCK_HARDWARE(imesa); savageWaitEvent (imesa, imesa->textureHeaps[heap]->timestamp); @@ -1713,7 +1713,7 @@ static void savageTimestampTextures( savageContextPtr imesa ) * Only useful with long-lived 32-bit event tags available * with Savage DRM 2.3.x or later. */ if ((imesa->CurrentTexObj[0] || imesa->CurrentTexObj[1]) && - imesa->savageScreen->driScrnPriv->drmMinor >= 3) { + imesa->savageScreen->driScrnPriv->drm_version.minor >= 3) { unsigned int e; FLUSH_BATCH(imesa); e = savageEmitEvent(imesa, SAVAGE_WAIT_3D); diff --git a/src/savagetris.c b/src/savagetris.c index 3dd821a..c67045c 100644 --- a/src/savagetris.c +++ b/src/savagetris.c @@ -95,7 +95,7 @@ do { \ } while (0) #endif -static void __inline__ savage_draw_triangle (savageContextPtr imesa, +static void INLINE savage_draw_triangle (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1, savageVertexPtr v2) { @@ -108,7 +108,7 @@ static void __inline__ savage_draw_triangle (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 0, v2); } -static void __inline__ savage_draw_quad (savageContextPtr imesa, +static void INLINE savage_draw_quad (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1, savageVertexPtr v2, @@ -125,13 +125,15 @@ static void __inline__ savage_draw_quad (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 0, v3); } -static __inline__ void savage_draw_point (savageContextPtr imesa, +static INLINE void savage_draw_point (savageContextPtr imesa, savageVertexPtr tmp) { GLuint vertsize = imesa->HwVertexSize; u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat x = tmp->v.x; const GLfloat y = tmp->v.y; - const GLfloat sz = imesa->glCtx->Point._Size * .5; + const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size, + imesa->glCtx->Const.MinPointSize, + imesa->glCtx->Const.MaxPointSize); GLuint j; *(float *)&vb[0] = x - sz; @@ -159,12 +161,14 @@ static __inline__ void savage_draw_point (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 2, tmp); } -static __inline__ void savage_draw_line (savageContextPtr imesa, +static INLINE void savage_draw_line (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1 ) { GLuint vertsize = imesa->HwVertexSize; u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); - GLfloat width = imesa->glCtx->Line._Width; + const GLfloat width = CLAMP(imesa->glCtx->Line.Width, + imesa->glCtx->Const.MinLineWidth, + imesa->glCtx->Const.MaxLineWidth); GLfloat dx, dy, ix, iy; GLuint j; @@ -215,7 +219,7 @@ do { \ tmp.f[vertex_size-1] *= rhw; \ } while (0) -static void __inline__ savage_ptex_tri (savageContextPtr imesa, +static void INLINE savage_ptex_tri (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1, savageVertexPtr v2) { @@ -229,12 +233,14 @@ static void __inline__ savage_ptex_tri (savageContextPtr imesa, PTEX_VERTEX (j, tmp, vertsize, 0, v2); EMIT_VERT (j, vb, vertsize, 0, &tmp); } -static __inline__ void savage_ptex_line (savageContextPtr imesa, +static INLINE void savage_ptex_line (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1 ) { GLuint vertsize = imesa->HwVertexSize; u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); - GLfloat width = imesa->glCtx->Line._Width; + const GLfloat width = CLAMP(imesa->glCtx->Line.Width, + imesa->glCtx->Const.MinLineWidth, + imesa->glCtx->Const.MaxLineWidth); GLfloat dx, dy, ix, iy; savageVertex tmp0, tmp1; GLuint j; @@ -275,13 +281,15 @@ static __inline__ void savage_ptex_line (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 2, &tmp1); } -static __inline__ void savage_ptex_point (savageContextPtr imesa, +static INLINE void savage_ptex_point (savageContextPtr imesa, savageVertexPtr v0) { GLuint vertsize = imesa->HwVertexSize; u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat x = v0->v.x; const GLfloat y = v0->v.y; - const GLfloat sz = imesa->glCtx->Point._Size * .5; + const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size, + imesa->glCtx->Const.MinPointSize, + imesa->glCtx->Const.MaxPointSize); savageVertex tmp; GLuint j; @@ -926,7 +934,7 @@ do { \ #define SAVAGE_EMIT_ST1 0x0300 -static __inline__ GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) +static INLINE GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -989,7 +997,7 @@ static __inline__ GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) } -static __inline__ GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) +static INLINE GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); |