X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fsavage%2Fsavagetris.c;h=e9529d19391ff8368784d0979ccf02f0441c82a8;hb=06d3732a9094030fc33120f16f162e0d405f132c;hp=52c7f5fa765902bae98528b5c732b29e86634495;hpb=fc72d7e032fc0a4130fae53106f03aa3fbe4e99e;p=mesa.git diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c index 52c7f5fa765..e9529d19391 100644 --- a/src/mesa/drivers/dri/savage/savagetris.c +++ b/src/mesa/drivers/dri/savage/savagetris.c @@ -37,10 +37,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/macros.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -95,12 +95,12 @@ 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) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); GLuint j; EMIT_VERT (j, vb, vertsize, 0, v0); @@ -108,13 +108,13 @@ 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, savageVertexPtr v3) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); GLuint j; EMIT_VERT (j, vb, vertsize, 0, v0); @@ -125,10 +125,10 @@ 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); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat x = tmp->v.x; const GLfloat y = tmp->v.y; const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size, @@ -161,11 +161,11 @@ 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); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat width = CLAMP(imesa->glCtx->Line.Width, imesa->glCtx->Const.MinLineWidth, imesa->glCtx->Const.MaxLineWidth); @@ -219,12 +219,12 @@ 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) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); savageVertex tmp; GLuint j; @@ -233,11 +233,11 @@ 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); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat width = CLAMP(imesa->glCtx->Line.Width, imesa->glCtx->Const.MinLineWidth, imesa->glCtx->Const.MaxLineWidth); @@ -281,10 +281,10 @@ 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); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat x = v0->v.x; const GLfloat y = v0->v.y; const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size, @@ -879,13 +879,13 @@ static GLboolean savageCheckPTexHack( GLcontext *ctx ) RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 ) && VB->TexCoordPtr[0]->size == 4) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 ) && VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) { if (!RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_ATTRIB_TEX1, _TNL_LAST_TEX )) return GL_TRUE; /* apply ptex hack */ else FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE); } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 ) && VB->TexCoordPtr[1]->size == 4) + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 ) && VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE); return GL_FALSE; /* don't apply ptex hack */ @@ -934,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); @@ -976,13 +976,13 @@ static __inline__ GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { if (imesa->ptexHack) EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_3F_XYW, SAVAGE_EMIT_STQ0, SAVAGE_SKIP_ST0); - else if (VB->TexCoordPtr[0]->size == 4) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) assert (0); /* should be caught by savageCheckPTexHack */ - else if (VB->TexCoordPtr[0]->size >= 2) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size >= 2) /* The chromium menu emits some 3D tex coords even though no * 3D texture is enabled. Ignore the 3rd coordinate. */ EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, SAVAGE_EMIT_ST0, SAVAGE_SKIP_ST0 ); - else if (VB->TexCoordPtr[0]->size == 1) { + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 1) { EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_1F, SAVAGE_EMIT_S0, SAVAGE_SKIP_S0 ); EMIT_PAD( 4 ); } else @@ -997,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); @@ -1025,9 +1025,9 @@ static __inline__ GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { if (imesa->ptexHack) NEED_ATTR( SAVAGE_EMIT_STQ0, SAVAGE_SKIP_ST0); - else if (VB->TexCoordPtr[0]->size == 4) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) assert (0); /* should be caught by savageCheckPTexHack */ - else if (VB->TexCoordPtr[0]->size >= 2) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size >= 2) /* The chromium menu emits some 3D tex coords even though no * 3D texture is enabled. Ignore the 3rd coordinate. */ NEED_ATTR( SAVAGE_EMIT_ST0, SAVAGE_SKIP_ST0 ); @@ -1035,10 +1035,10 @@ static __inline__ GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) NEED_ATTR( SAVAGE_EMIT_S0, SAVAGE_SKIP_S0 ); } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 )) { - if (VB->TexCoordPtr[1]->size == 4) + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) /* projective textures are not supported by the hardware */ assert (0); /* should be caught by savageCheckPTexHack */ - else if (VB->TexCoordPtr[1]->size >= 2) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size >= 2) NEED_ATTR( SAVAGE_EMIT_ST1, SAVAGE_SKIP_ST1 ); else NEED_ATTR( SAVAGE_EMIT_S1, SAVAGE_SKIP_S1 );