bring over build fixes from stable branch
This commit is contained in:
@@ -1083,7 +1083,7 @@ driValidateTextureHeaps( driTexHeap * const * texture_heaps,
|
||||
* the correct heap.
|
||||
*
|
||||
* Check the texobj base address corresponds to the MemBlock
|
||||
* range. Check the texobj size (recalculate???) fits within
|
||||
* range. Check the texobj size (recalculate?) fits within
|
||||
* the MemBlock.
|
||||
*
|
||||
* Count the number of texobj's using this heap.
|
||||
|
||||
@@ -46,7 +46,8 @@ driParseDebugString( const char * debug,
|
||||
flag = 0;
|
||||
if ( debug != NULL ) {
|
||||
while( control->string != NULL ) {
|
||||
if ( strstr( debug, control->string ) != NULL ) {
|
||||
if ( !strcmp( debug, "all" ) ||
|
||||
strstr( debug, control->string ) != NULL ) {
|
||||
flag |= control->flag;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,10 @@ extern int driWaitForVBlank( const __DRIdrawablePrivate *priv,
|
||||
#include <unistd.h> /* for usleep() */
|
||||
#include <sched.h> /* for sched_yield() */
|
||||
|
||||
#ifdef linux
|
||||
#include <sched.h> /* for sched_yield() */
|
||||
#endif
|
||||
|
||||
#define DO_USLEEP(nr) \
|
||||
do { \
|
||||
if (0) fprintf(stderr, "%s: usleep for %u\n", __FUNCTION__, nr ); \
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
|
||||
{
|
||||
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
|
||||
#if defined(VB_DEBUG) || (IND & (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT))
|
||||
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
||||
#endif
|
||||
#if (IND & (FFB_VB_RGBA_BIT))
|
||||
GLfloat (*col0)[4];
|
||||
GLuint col0_stride;
|
||||
|
||||
@@ -60,6 +60,7 @@ void i810DestroyTexObj(i810ContextPtr imesa, i810TextureObjectPtr t)
|
||||
|
||||
|
||||
|
||||
#if defined(i386) || defined(__i386__)
|
||||
/* From linux kernel i386 header files, copes with odd sizes better
|
||||
* than COPY_DWORDS would:
|
||||
*/
|
||||
@@ -80,6 +81,10 @@ __asm__ __volatile__(
|
||||
: "memory");
|
||||
return (to);
|
||||
}
|
||||
#else
|
||||
/* Allow compilation on other architectures */
|
||||
#define __memcpy memcpy
|
||||
#endif
|
||||
|
||||
/* Upload an image from mesa's internal copy.
|
||||
*/
|
||||
|
||||
@@ -68,6 +68,7 @@ void i830DestroyTexObj(i830ContextPtr imesa, i830TextureObjectPtr t)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(i386) || defined(__i386__)
|
||||
/* From linux kernel i386 header files, copes with odd sizes better
|
||||
* than COPY_DWORDS would:
|
||||
*/
|
||||
@@ -88,7 +89,10 @@ __asm__ __volatile__(
|
||||
: "memory");
|
||||
return (to);
|
||||
}
|
||||
|
||||
#else
|
||||
/* Allow compilation on other architectures */
|
||||
#define __memcpy memcpy
|
||||
#endif
|
||||
|
||||
/* Upload an image from mesa's internal copy.
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#ifndef MGALIB_INC
|
||||
#define MGALIB_INC
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "drm.h"
|
||||
#include "mga_drm.h"
|
||||
#include "dri_util.h"
|
||||
|
||||
@@ -115,8 +115,8 @@ static struct {
|
||||
|
||||
#define PTEX_FALLBACK() FALLBACK(ctx, MGA_FALLBACK_TEXTURE, 1)
|
||||
|
||||
#define INTERP_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].interp
|
||||
#define COPY_PV_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].copy_pv
|
||||
#define INTERP_VERTEX setup_tab[mmesa->SetupIndex].interp
|
||||
#define COPY_PV_VERTEX setup_tab[mmesa->SetupIndex].copy_pv
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
|
||||
@@ -33,6 +33,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <errno.h>
|
||||
|
||||
#define STANDALONE_MMIO
|
||||
#include "r128_context.h"
|
||||
#include "r128_state.h"
|
||||
#include "r128_ioctl.h"
|
||||
@@ -266,7 +267,7 @@ void r128CopyBuffer( const __DRIdrawablePrivate *dPriv )
|
||||
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
|
||||
fprintf( stderr, "\n********************************\n" );
|
||||
fprintf( stderr, "\n%s( %p )\n\n",
|
||||
__FUNCTION__, rmesa->glCtx );
|
||||
__FUNCTION__, (void *)rmesa->glCtx );
|
||||
fflush( stderr );
|
||||
}
|
||||
|
||||
@@ -344,7 +345,7 @@ void r128PageFlip( const __DRIdrawablePrivate *dPriv )
|
||||
|
||||
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
|
||||
fprintf( stderr, "\n%s( %p ): page=%d\n\n",
|
||||
__FUNCTION__, rmesa->glCtx, rmesa->sarea->pfCurrentPage );
|
||||
__FUNCTION__, (void *)rmesa->glCtx, rmesa->sarea->pfCurrentPage );
|
||||
}
|
||||
|
||||
FLUSH_BATCH( rmesa );
|
||||
|
||||
@@ -38,7 +38,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "tnl/t_vertex.h"
|
||||
#include "drm.h"
|
||||
#include "radeon_drm.h"
|
||||
|
||||
@@ -41,6 +41,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "imports.h"
|
||||
#include "context.h"
|
||||
|
||||
#define STANDALONE_MMIO
|
||||
#include "r200_screen.h"
|
||||
#include "r200_context.h"
|
||||
#include "r200_ioctl.h"
|
||||
@@ -364,6 +365,8 @@ r200CreateScreen( __DRIscreenPrivate *sPriv )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RADEONMMIO = screen->mmio.map;
|
||||
|
||||
screen->status.handle = dri_priv->statusHandle;
|
||||
screen->status.size = dri_priv->statusSize;
|
||||
if ( drmMap( sPriv->fd,
|
||||
|
||||
@@ -391,6 +391,7 @@ GLOBL( _x86_MultiTexCoord2f_2 )
|
||||
ret
|
||||
GLOBL( _x86_MultiTexCoord2f_2_end )
|
||||
|
||||
#if defined(USE_SSE_ASM)
|
||||
/**
|
||||
* This can be used as a template for either Color3fv (when the color
|
||||
* target is also a 3f) or Normal3fv.
|
||||
@@ -490,3 +491,4 @@ GLOBL( _sse_MultiTexCoord2f_2 )
|
||||
movlps %xmm0, (%eax)
|
||||
ret
|
||||
GLOBL( _sse_MultiTexCoord2f_2_end )
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "dri_util.h"
|
||||
#include "drm.h"
|
||||
#include "radeon_drm.h"
|
||||
|
||||
@@ -49,6 +49,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "radeon_tcl.h"
|
||||
#include "radeon_sanity.h"
|
||||
|
||||
#define STANDALONE_MMIO
|
||||
#include "radeon_macros.h" /* for INREG() */
|
||||
|
||||
#include "vblank.h"
|
||||
@@ -750,12 +751,10 @@ static uint32_t radeonGetLastFrame (radeonContextPtr rmesa)
|
||||
else
|
||||
ret = -EINVAL;
|
||||
|
||||
#ifndef __alpha__
|
||||
if ( ret == -EINVAL ) {
|
||||
frame = INREG( RADEON_LAST_FRAME_REG );
|
||||
ret = 0;
|
||||
}
|
||||
#endif
|
||||
if ( ret ) {
|
||||
fprintf( stderr, "%s: drm_radeon_getparam_t: %d\n", __FUNCTION__, ret );
|
||||
exit(1);
|
||||
@@ -1043,12 +1042,10 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
} else
|
||||
ret = -EINVAL;
|
||||
|
||||
#ifndef __alpha__
|
||||
if ( ret == -EINVAL ) {
|
||||
clear = INREG( RADEON_LAST_CLEAR_REG );
|
||||
ret = 0;
|
||||
}
|
||||
#endif
|
||||
if ( ret ) {
|
||||
fprintf( stderr, "%s: drm_radeon_getparam_t: %d\n", __FUNCTION__, ret );
|
||||
exit(1);
|
||||
|
||||
@@ -39,6 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "glheader.h"
|
||||
#include "imports.h"
|
||||
|
||||
#define STANDALONE_MMIO
|
||||
#include "radeon_context.h"
|
||||
#include "radeon_screen.h"
|
||||
#include "radeon_macros.h"
|
||||
|
||||
@@ -244,7 +244,7 @@ static radeonTexObjPtr radeonAllocTexObj( struct gl_texture_object *texObj )
|
||||
texObj->DriverData = t;
|
||||
if ( t != NULL ) {
|
||||
if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
|
||||
fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, texObj, t );
|
||||
fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)texObj, (void *)t );
|
||||
}
|
||||
|
||||
/* Initialize non-image-dependent parts of the state:
|
||||
@@ -666,7 +666,7 @@ static void radeonBindTexture( GLcontext *ctx, GLenum target,
|
||||
struct gl_texture_object *texObj )
|
||||
{
|
||||
if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
|
||||
fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, texObj,
|
||||
fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *)texObj,
|
||||
ctx->Texture.CurrentUnit );
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ static void radeonDeleteTexture( GLcontext *ctx,
|
||||
driTextureObject * t = (driTextureObject *) texObj->DriverData;
|
||||
|
||||
if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
|
||||
fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, texObj,
|
||||
fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj,
|
||||
_mesa_lookup_enum_by_nr( texObj->Target ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ void
|
||||
radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t )
|
||||
{
|
||||
if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
|
||||
fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->base.tObj );
|
||||
fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)t, (void *)t->base.tObj );
|
||||
}
|
||||
|
||||
if ( rmesa != NULL ) {
|
||||
@@ -189,7 +189,7 @@ static void uploadSubImage( radeonContextPtr rmesa, radeonTexObjPtr t,
|
||||
|
||||
if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
|
||||
fprintf( stderr, "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n",
|
||||
__FUNCTION__, t, t->base.tObj, level, width, height, face );
|
||||
__FUNCTION__, (void *)t, (void *)t->base.tObj, level, width, height, face );
|
||||
}
|
||||
|
||||
ASSERT(face < 6);
|
||||
@@ -306,7 +306,7 @@ int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, GLuint fac
|
||||
|
||||
if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
|
||||
fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
|
||||
rmesa->glCtx, t->base.tObj, t->base.totalSize,
|
||||
(void *)rmesa->glCtx, (void *)t->base.tObj, t->base.totalSize,
|
||||
t->base.firstLevel, t->base.lastLevel );
|
||||
}
|
||||
|
||||
|
||||
@@ -391,7 +391,7 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
|
||||
|| (texUnit->_Current != NULL) );
|
||||
|
||||
if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
|
||||
fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, ctx, unit );
|
||||
fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
|
||||
}
|
||||
|
||||
/* Set the texture environment state. Isn't this nice and clean?
|
||||
|
||||
@@ -527,7 +527,7 @@ static void wrap_buffer( void )
|
||||
for (i = 0 ; i < nrverts; i++) {
|
||||
if (RADEON_DEBUG & DEBUG_VERTS) {
|
||||
int j;
|
||||
fprintf(stderr, "re-emit vertex %d to %p\n", i, rmesa->vb.dmaptr);
|
||||
fprintf(stderr, "re-emit vertex %d to %p\n", i, (void *)rmesa->vb.dmaptr);
|
||||
if (RADEON_DEBUG & DEBUG_VERBOSE)
|
||||
for (j = 0 ; j < rmesa->vb.vertex_size; j++)
|
||||
fprintf(stderr, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]);
|
||||
|
||||
@@ -391,6 +391,7 @@ GLOBL( _x86_MultiTexCoord2f_2 )
|
||||
ret
|
||||
GLOBL( _x86_MultiTexCoord2f_2_end )
|
||||
|
||||
#if defined(USE_SSE_ASM)
|
||||
/**
|
||||
* This can be used as a template for either Color3fv (when the color
|
||||
* target is also a 3f) or Normal3fv.
|
||||
@@ -490,3 +491,4 @@ GLOBL( _sse_MultiTexCoord2f_2 )
|
||||
movlps %xmm0, (%eax)
|
||||
ret
|
||||
GLOBL( _sse_MultiTexCoord2f_2_end )
|
||||
#endif
|
||||
|
||||
@@ -170,7 +170,7 @@ sisAllocZStencilBuffer( sisContextPtr smesa )
|
||||
memset( &smesa->zClearPacket, 0, sizeof(ENGPACKET) );
|
||||
|
||||
smesa->zClearPacket.dwSrcPitch = (z_depth == 2) ? 0x80000000 : 0xf0000000;
|
||||
smesa->zClearPacket.dwDestBaseAddr = (GLint)(addr -
|
||||
smesa->zClearPacket.dwDestBaseAddr = (unsigned long)(addr -
|
||||
(unsigned long)smesa->FbBase);
|
||||
smesa->zClearPacket.wDestPitch = width2;
|
||||
smesa->zClearPacket.stdwDestPos.wY = 0;
|
||||
@@ -218,7 +218,7 @@ sisAllocBackbuffer( sisContextPtr smesa )
|
||||
addr = (char *)ALIGNMENT( (unsigned long)addr, DRAW_BUFFER_HW_ALIGNMENT );
|
||||
|
||||
smesa->backbuffer = addr;
|
||||
smesa->backOffset = (GLint)(addr - (unsigned long)smesa->FbBase);
|
||||
smesa->backOffset = (unsigned long)(addr - (unsigned long)smesa->FbBase);
|
||||
smesa->backPitch = width2 * depth;
|
||||
|
||||
memset ( &smesa->cbClearPacket, 0, sizeof(ENGPACKET) );
|
||||
|
||||
@@ -118,7 +118,7 @@ static GLboolean
|
||||
tdfxInitDriver( __DRIscreenPrivate *sPriv )
|
||||
{
|
||||
if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
|
||||
fprintf( stderr, "%s( %p )\n", __FUNCTION__, sPriv );
|
||||
fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)sPriv );
|
||||
}
|
||||
|
||||
/* Check the DRI externsion version */
|
||||
@@ -195,7 +195,7 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
|
||||
GLframebuffer *mesaBuffer;
|
||||
|
||||
if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
|
||||
fprintf( stderr, "%s( %p )\n", __FUNCTION__, driDrawPriv );
|
||||
fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driDrawPriv );
|
||||
}
|
||||
|
||||
mesaBuffer = (GLframebuffer *) driDrawPriv->driverPrivate;
|
||||
|
||||
@@ -572,14 +572,6 @@ GetFbParams(tdfxContextPtr fxMesa,
|
||||
*
|
||||
* Recall that x and y are screen coordinates.
|
||||
*/
|
||||
#define GET_FB_DATA(ReadParamsp, type, x, y) \
|
||||
(((x) < (ReadParamsp)->firstWrappedX) \
|
||||
? (((type *)((ReadParamsp)->lfbPtr)) \
|
||||
[(y) * ((ReadParamsp)->LFBStrideInElts) \
|
||||
+ (x)]) \
|
||||
: (((type *)((ReadParamsp)->lfbWrapPtr)) \
|
||||
[((y)) * ((ReadParamsp)->LFBStrideInElts) \
|
||||
+ ((x) - (ReadParamsp)->firstWrappedX)]))
|
||||
#define GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \
|
||||
(((type *)((ReadParamsp)->lfbPtr)) \
|
||||
[(y) * ((ReadParamsp)->LFBStrideInElts) \
|
||||
@@ -588,12 +580,21 @@ GetFbParams(tdfxContextPtr fxMesa,
|
||||
(((type *)((ReadParamsp)->lfbWrapPtr)) \
|
||||
[((y)) * ((ReadParamsp)->LFBStrideInElts) \
|
||||
+ ((x) - (ReadParamsp)->firstWrappedX)])
|
||||
#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \
|
||||
(GET_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
|
||||
#define GET_FB_DATA(ReadParamsp, type, x, y) \
|
||||
(((x) < (ReadParamsp)->firstWrappedX) \
|
||||
? GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \
|
||||
: GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y))
|
||||
#define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \
|
||||
(GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
|
||||
#define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value) \
|
||||
(GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
|
||||
#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \
|
||||
do { \
|
||||
if ((x) < (ReadParamsp)->firstWrappedX) \
|
||||
PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value); \
|
||||
else \
|
||||
PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value); \
|
||||
} while (0)
|
||||
|
||||
static void
|
||||
tdfxDDWriteDepthSpan(GLcontext * ctx,
|
||||
|
||||
@@ -880,7 +880,7 @@ tdfxTMMoveOutTM_NoLock( tdfxContextPtr fxMesa, struct gl_texture_object *tObj )
|
||||
tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_DRIVER) {
|
||||
fprintf(stderr, "fxmesa: %s(%p (%d))\n", __FUNCTION__, tObj, tObj->Name);
|
||||
fprintf(stderr, "fxmesa: %s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -794,6 +794,8 @@ noFaultXAllocColor( int client,
|
||||
static GLboolean setup_grayscale( int client, XMesaVisual v,
|
||||
XMesaBuffer buffer, XMesaColormap cmap )
|
||||
{
|
||||
(void) DitherValues; /* Muffle compiler */
|
||||
|
||||
if (GET_VISUAL_DEPTH(v)<4 || GET_VISUAL_DEPTH(v)>16) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -223,9 +223,10 @@ extern void _ext_mesa_free_pixelbuffer( void *pb );
|
||||
*** USE_IEEE: Determine if we're using IEEE floating point
|
||||
***/
|
||||
#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
|
||||
defined(__s390x__) || defined(__powerpc__) || defined(__AMD64__) || \
|
||||
defined(__ia64__) || \
|
||||
( defined(__alpha__) && ( defined(__IEEE_FLOAT) || !defined(VMS) ) )
|
||||
defined(__s390x__) || defined(__powerpc__) || \
|
||||
defined(__AMD64__) || defined(__amd64__) || \
|
||||
defined(ia64) || defined(__ia64__) || \
|
||||
(defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS)))
|
||||
#define USE_IEEE
|
||||
#define IEEE_ONE 0x3f800000
|
||||
#endif
|
||||
|
||||
@@ -3553,9 +3553,7 @@ make_2d_mipmap(const struct gl_texture_format *format, GLint border,
|
||||
const GLint dstRowStride = bpt * dstWidth;
|
||||
const GLubyte *srcA, *srcB;
|
||||
GLubyte *dst;
|
||||
GLint row, colStride;
|
||||
|
||||
colStride = (srcWidth == dstWidth) ? 1 : 2;
|
||||
GLint row;
|
||||
|
||||
/* Compute src and dst pointers, skipping any border */
|
||||
srcA = srcPtr + border * ((srcWidth + 1) * bpt);
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
#include "m_debug.h"
|
||||
#include "m_debug_util.h"
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
/* The linker doesn't like empty files */
|
||||
static char dummy;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG /* This code only used for debugging */
|
||||
|
||||
static clip_func *clip_tab[2] = {
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
#include "m_debug_util.h"
|
||||
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
/* The linker doesn't like empty files */
|
||||
static char dummy;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG /* This code only used for debugging */
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
#include "m_debug.h"
|
||||
#include "m_debug_util.h"
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
/* The linker doesn't like empty files */
|
||||
static char dummy;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG /* This code only used for debugging */
|
||||
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ void _mesa_transform_point_sz( GLfloat Q[4], const GLfloat M[16],
|
||||
/*
|
||||
* This is called only once. It initializes several tables with pointers
|
||||
* to optimized transformation functions. This is where we can test for
|
||||
* AMD 3Dnow! capability, Intel Katmai, etc. and hook in the right code.
|
||||
* AMD 3Dnow! capability, Intel SSE, etc. and hook in the right code.
|
||||
*/
|
||||
void
|
||||
_math_init_transformation( void )
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
#define VEC_SIZE_3 7
|
||||
#define VEC_SIZE_4 15
|
||||
|
||||
#ifdef SVR4
|
||||
/* Solaris requires this for 64-bit. */
|
||||
.register %g2, #scratch
|
||||
.register %g3, #scratch
|
||||
.register %g7, #scratch
|
||||
#endif
|
||||
|
||||
.text
|
||||
.align 64
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
/* $Id: norm.S,v 1.2 2003/12/01 22:40:51 brianp Exp $ */
|
||||
/* $Id: norm.S,v 1.3 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
#include "sparc_matrix.h"
|
||||
|
||||
#ifdef SVR4
|
||||
/* Solaris requires this for 64-bit. */
|
||||
.register %g2, #scratch
|
||||
.register %g3, #scratch
|
||||
#endif
|
||||
|
||||
.text
|
||||
|
||||
#if defined(__sparc_v9__) && !defined(__linux__)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: xform.S,v 1.2 2001/06/05 23:54:01 davem69 Exp $ */
|
||||
/* $Id: xform.S,v 1.3 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/* TODO
|
||||
*
|
||||
@@ -18,6 +18,12 @@
|
||||
|
||||
#include "sparc_matrix.h"
|
||||
|
||||
#ifdef SVR4
|
||||
/* Solaris requires this for 64-bit. */
|
||||
.register %g2, #scratch
|
||||
.register %g3, #scratch
|
||||
#endif
|
||||
|
||||
.text
|
||||
.align 64
|
||||
|
||||
|
||||
@@ -1481,8 +1481,7 @@ void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
|
||||
|
||||
void _tnl_EndList( GLcontext *ctx )
|
||||
{
|
||||
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
||||
assert(tnl->save.vertex_size == 0);
|
||||
assert(TNL_CONTEXT(ctx)->save.vertex_size == 0);
|
||||
}
|
||||
|
||||
void _tnl_BeginCallList( GLcontext *ctx, GLuint list )
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#if (IDX & LIGHT_TWOSIDE)
|
||||
#if IDX & LIGHT_TWOSIDE
|
||||
# define NR_SIDES 2
|
||||
#else
|
||||
# define NR_SIDES 1
|
||||
@@ -283,18 +283,19 @@ static void TAG(light_rgba)( GLcontext *ctx,
|
||||
GLfloat sum[2][3];
|
||||
struct gl_light *light;
|
||||
|
||||
if ( IDX & LIGHT_MATERIAL ) {
|
||||
update_materials( ctx, store );
|
||||
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
|
||||
#if IDX & LIGHT_MATERIAL
|
||||
update_materials( ctx, store );
|
||||
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
|
||||
#if IDX & LIGHT_TWOSIDE
|
||||
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
|
||||
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
COPY_3V(sum[0], base[0]);
|
||||
|
||||
if ( IDX & LIGHT_TWOSIDE )
|
||||
COPY_3V(sum[1], base[1]);
|
||||
#if IDX & LIGHT_TWOSIDE
|
||||
COPY_3V(sum[1], base[1]);
|
||||
#endif
|
||||
|
||||
/* Add contribution from each enabled light source */
|
||||
foreach (light, &ctx->Light.EnabledList) {
|
||||
@@ -467,12 +468,16 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
|
||||
|
||||
GLfloat n_dot_VP;
|
||||
|
||||
if ( IDX & LIGHT_MATERIAL )
|
||||
update_materials( ctx, store );
|
||||
#if IDX & LIGHT_MATERIAL
|
||||
update_materials( ctx, store );
|
||||
#endif
|
||||
|
||||
/* No attenuation, so incoporate _MatAmbient into base color.
|
||||
*/
|
||||
if ( j == 0 || (IDX & LIGHT_MATERIAL) ) {
|
||||
#if !(IDX & LIGHT_MATERIAL)
|
||||
if ( j == 0 )
|
||||
#endif
|
||||
{
|
||||
COPY_3V(base[0], light->_MatAmbient[0]);
|
||||
ACC_3V(base[0], ctx->Light._BaseColor[0] );
|
||||
base[0][3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
|
||||
@@ -565,14 +570,14 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
|
||||
|
||||
GLfloat sum[2][3];
|
||||
|
||||
if ( IDX & LIGHT_MATERIAL ) {
|
||||
update_materials( ctx, store );
|
||||
#if IDX & LIGHT_MATERIAL
|
||||
update_materials( ctx, store );
|
||||
|
||||
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
|
||||
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
|
||||
#if IDX & LIGHT_TWOSIDE
|
||||
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
|
||||
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
COPY_3V(sum[0], ctx->Light._BaseColor[0]);
|
||||
@@ -675,14 +680,15 @@ static void TAG(light_ci)( GLcontext *ctx,
|
||||
GLuint side = 0;
|
||||
struct gl_light *light;
|
||||
|
||||
if ( IDX & LIGHT_MATERIAL )
|
||||
update_materials( ctx, store );
|
||||
#if IDX & LIGHT_MATERIAL
|
||||
update_materials( ctx, store );
|
||||
#endif
|
||||
|
||||
diffuse[0] = specular[0] = 0.0F;
|
||||
|
||||
if ( IDX & LIGHT_TWOSIDE ) {
|
||||
#if IDX & LIGHT_TWOSIDE
|
||||
diffuse[1] = specular[1] = 0.0F;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Accumulate diffuse and specular from each light source */
|
||||
foreach (light, &ctx->Light.EnabledList) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: 3dnow_normal.S,v 1.7 2004/04/08 08:10:37 alanh Exp $ */
|
||||
/* $Id: 3dnow_normal.S,v 1.8 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -28,6 +28,8 @@
|
||||
* 3Dnow assembly code by Holger Waechtler
|
||||
*/
|
||||
|
||||
#ifdef USE_3DNOW_ASM
|
||||
|
||||
#include "matypes.h"
|
||||
#include "norm_args.h"
|
||||
|
||||
@@ -834,3 +836,5 @@ LLBL (G3R_end):
|
||||
POP_L ( ESI )
|
||||
POP_L ( EDI )
|
||||
RET
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: 3dnow_xform1.S,v 1.1 2001/03/29 06:46:16 gareth Exp $ */
|
||||
/* $Id: 3dnow_xform1.S,v 1.2 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -24,6 +24,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef USE_3DNOW_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -421,3 +422,5 @@ LLBL( G3TP3R_3 ):
|
||||
POP_L ( EDI )
|
||||
POP_L ( ESI )
|
||||
RET
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: 3dnow_xform2.S,v 1.1 2001/03/29 06:46:16 gareth Exp $ */
|
||||
/* $Id: 3dnow_xform2.S,v 1.2 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -24,6 +24,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef USE_3DNOW_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -462,3 +463,4 @@ LLBL( G3TPIR_4 ):
|
||||
POP_L ( EDI )
|
||||
POP_L ( ESI )
|
||||
RET
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: 3dnow_xform3.S,v 1.2 2001/10/22 01:21:16 brianp Exp $ */
|
||||
/* $Id: 3dnow_xform3.S,v 1.3 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -24,6 +24,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef USE_3DNOW_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -546,3 +547,4 @@ LLBL( G3TPIR_2 ):
|
||||
POP_L ( EDI )
|
||||
POP_L ( ESI )
|
||||
RET
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: 3dnow_xform4.S,v 1.2 2001/10/22 01:21:16 brianp Exp $ */
|
||||
/* $Id: 3dnow_xform4.S,v 1.3 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -24,6 +24,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef USE_3DNOW_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -555,3 +556,4 @@ LLBL( G3TPIR_2 ):
|
||||
POP_L ( EDI )
|
||||
POP_L ( ESI )
|
||||
RET
|
||||
#endif
|
||||
|
||||
+21
-3
@@ -274,9 +274,7 @@
|
||||
#define GLOBL CHOICE(.globl, .globl, .extern)
|
||||
#define GLOBAL GLOBL
|
||||
#define EXTERN GLOBL
|
||||
/*
|
||||
#define ALIGNTEXT32 CHOICE(.align 32, .align ARG2(5,0x90), .align 32)
|
||||
*/
|
||||
#ifndef __AOUT__
|
||||
#define ALIGNTEXT32 CHOICE(.align 32, .balign 32, .align 32)
|
||||
#define ALIGNTEXT16 CHOICE(.align 16, .balign 16, .align 16)
|
||||
#define ALIGNTEXT8 CHOICE(.align 8, .balign 8, .align 8)
|
||||
@@ -294,6 +292,26 @@
|
||||
#define ALIGNDATA8 CHOICE(.align 8, .balign ARG2(8,0x0), .align 8)
|
||||
#define ALIGNDATA4 CHOICE(.align 4, .balign ARG2(4,0x0), .align 4)
|
||||
#define ALIGNDATA2 CHOICE(.align 2, .balign ARG2(2,0x0), .align 2)
|
||||
#else
|
||||
/* 'as -aout' on FreeBSD doesn't have .balign */
|
||||
#define ALIGNTEXT32 CHOICE(.align 32, .align ARG2(5,0x90), .align 32)
|
||||
#define ALIGNTEXT16 CHOICE(.align 16, .align ARG2(4,0x90), .align 16)
|
||||
#define ALIGNTEXT8 CHOICE(.align 8, .align ARG2(3,0x90), .align 8)
|
||||
#define ALIGNTEXT4 CHOICE(.align 4, .align ARG2(2,0x90), .align 4)
|
||||
#define ALIGNTEXT2 CHOICE(.align 2, .align ARG2(1,0x90), .align 2)
|
||||
/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
|
||||
* guaranteed to be filled with NOPs. Otherwise it does nothing.
|
||||
*/
|
||||
#define ALIGNTEXT32ifNOP CHOICE(.align 32, .align ARG2(5,0x90), /*can't do it*/)
|
||||
#define ALIGNTEXT16ifNOP CHOICE(.align 16, .align ARG2(4,0x90), /*can't do it*/)
|
||||
#define ALIGNTEXT8ifNOP CHOICE(.align 8, .align ARG2(3,0x90), /*can't do it*/)
|
||||
#define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/)
|
||||
#define ALIGNDATA32 CHOICE(.align 32, .align ARG2(5,0x0), .align 32)
|
||||
#define ALIGNDATA16 CHOICE(.align 16, .align ARG2(4,0x0), .align 16)
|
||||
#define ALIGNDATA8 CHOICE(.align 8, .align ARG2(3,0x0), .align 8)
|
||||
#define ALIGNDATA4 CHOICE(.align 4, .align ARG2(2,0x0), .align 4)
|
||||
#define ALIGNDATA2 CHOICE(.align 2, .align ARG2(1,0x0), .align 2)
|
||||
#endif /* __AOUT__ */
|
||||
#define FILE(s) CHOICE(.file s, .file s, .file s)
|
||||
#define STRING(s) CHOICE(.string s, .asciz s, .asciz s)
|
||||
#define D_LONG CHOICE(.long, .long, .data4)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
*
|
||||
* Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
|
||||
* Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the
|
||||
* new Katmai functions.
|
||||
* new SSE functions.
|
||||
*/
|
||||
|
||||
/* XXX these includes should probably go into imports.h or glheader.h */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: common_x86_asm.h,v 1.10 2002/10/29 20:28:57 brianp Exp $ */
|
||||
/* $Id: common_x86_asm.h,v 1.11 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -30,7 +30,7 @@
|
||||
*
|
||||
* Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
|
||||
* Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the
|
||||
* new Katmai functions
|
||||
* new SSE functions
|
||||
*
|
||||
* Reimplemented by Gareth Hughes in a more
|
||||
* future-proof manner, based on code in the Linux kernel.
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
|
||||
/*
|
||||
* Written by José Fonseca <j_r_fonseca@yahoo.co.uk>
|
||||
*/
|
||||
|
||||
#include "matypes.h"
|
||||
|
||||
#ifdef USE_MMX_ASM
|
||||
#include "matypes.h"
|
||||
|
||||
/* integer multiplication - alpha plus one
|
||||
*
|
||||
@@ -361,3 +363,4 @@ TWO(MOVQ ( MM1, REGIND(rgba) ))
|
||||
|
||||
#include "mmx_blendtmp.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: sse_normal.S,v 1.3 2003/11/26 08:32:36 dborca Exp $ */
|
||||
/* $Id: sse_normal.S,v 1.4 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -31,6 +31,7 @@
|
||||
* data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
|
||||
*/
|
||||
|
||||
#ifdef USE_SSE_ASM
|
||||
#include "matypes.h"
|
||||
#include "norm_args.h"
|
||||
|
||||
@@ -250,3 +251,4 @@ LLBL(K_G3TNNRR_finish):
|
||||
POP_L ( ESI )
|
||||
RET
|
||||
#undef FRAME_OFFSET
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: sse_xform1.S,v 1.1 2001/03/29 06:46:27 gareth Exp $ */
|
||||
/* $Id: sse_xform1.S,v 1.2 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -31,6 +31,7 @@
|
||||
* data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
|
||||
*/
|
||||
|
||||
#ifdef USE_SSE_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -431,3 +432,4 @@ LLBL(K_GTP13P3DR_finish):
|
||||
POP_L( ESI )
|
||||
RET
|
||||
#undef FRAME_OFFSET
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: sse_xform2.S,v 1.1 2001/03/29 06:46:27 gareth Exp $ */
|
||||
/* $Id: sse_xform2.S,v 1.2 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -31,6 +31,7 @@
|
||||
* data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
|
||||
*/
|
||||
|
||||
#ifdef USE_SSE_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -450,3 +451,4 @@ LLBL(K_GTP23P3DR_finish):
|
||||
POP_L( ESI )
|
||||
RET
|
||||
#undef FRAME_OFFSET
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: sse_xform3.S,v 1.1 2001/03/29 06:46:27 gareth Exp $ */
|
||||
/* $Id: sse_xform3.S,v 1.2 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -31,6 +31,7 @@
|
||||
* data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
|
||||
*/
|
||||
|
||||
#ifdef USE_SSE_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -496,3 +497,4 @@ LLBL(K_GTP3P3DR_finish):
|
||||
POP_L( ESI )
|
||||
RET
|
||||
#undef FRAME_OFFSET
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: sse_xform4.S,v 1.1 2001/03/29 06:46:27 gareth Exp $ */
|
||||
/* $Id: sse_xform4.S,v 1.2 2004/04/26 10:10:25 alanh Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -24,6 +24,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef USE_SSE_ASM
|
||||
#include "matypes.h"
|
||||
#include "xform_args.h"
|
||||
|
||||
@@ -224,3 +225,4 @@ LLBL( sse_identity_done ):
|
||||
POP_L( EDI )
|
||||
POP_L( ESI )
|
||||
RET
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user