Fix compilation for full driver build.

Subsetted readpixels seems to be working.
This commit is contained in:
Keith Whitwell 2003-01-27 16:55:30 +00:00
parent 151cd27866
commit 675f151c42
22 changed files with 147 additions and 71 deletions

View file

@ -0,0 +1 @@
*.d

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.1.2.18 2003/01/24 17:11:10 keithw Exp $
# $Id: Makefile,v 1.1.2.19 2003/01/27 16:55:31 keithw Exp $
# Mesa 3-D graphics library
# Version: 5.0
@ -13,15 +13,15 @@ INCLUDES = -I$(MESABUILDDIR) -I$(MESA)/include -I. -I../common \
-I$(MESABUILDDIR)/miniglx -Iserver
DEFINES = \
-D_HAVE_SWRAST=0 \
-D_HAVE_SWTNL=0 \
-D_HAVE_SANITY=0 \
-D_HAVE_CODEGEN=0 \
-D_HAVE_LIGHTING=0 \
-D_HAVE_TEXGEN=0 \
-D_HAVE_USERCLIP=0
-D_HAVE_SWRAST=1 \
-D_HAVE_SWTNL=1 \
-D_HAVE_SANITY=1 \
-D_HAVE_CODEGEN=1 \
-D_HAVE_LIGHTING=1 \
-D_HAVE_TEXGEN=1 \
-D_HAVE_USERCLIP=1
CFLAGS = $(INCLUDES) $(DEFINES) -g -MD -DGLX_DIRECT_RENDERING
CFLAGS = $(INCLUDES) $(DEFINES) -g -MD
# The .a files for each mesa module required by this driver:
#
@ -55,6 +55,8 @@ SUBSET_DRIVER_SOURCES = \
radeon_subset_vtx.c
FULL_DRIVER_SOURCES = \
radeon_subset_bitmap.c \
radeon_subset_readpix.c \
radeon_lighting.c \
radeon_userclip.c \
radeon_texgen.c \
@ -72,7 +74,7 @@ FULL_DRIVER_SOURCES = \
C_SOURCES = $(DRIVER_SOURCES) \
$(SUBSET_DRIVER_SOURCES) \
$(FULL_DRIVER_SOURCES) \
$(DRI_SOURCES)
ASM_SOURCES =
@ -94,8 +96,8 @@ OBJECTS = $(C_SOURCES:.c=.o) \
default: radeon_dri.so install
radeon_dri.so: $(SUBSET_MESA) $(OBJECTS) Makefile
rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(SUBSET_MESA) -L$(MESA)/src/miniglx -lGL -lc -lm
radeon_dri.so: $(FULL_MESA) $(OBJECTS) Makefile
rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(FULL_MESA) -L$(MESA)/src/miniglx -lGL -lc -lm
loc:
wc -l $(DRIVER_SOURCES)

View file

@ -339,6 +339,9 @@ radeonCreateContext( const __GLcontextModes *glVisual,
radeonCreateTnlContext( ctx );
#endif
radeonInitState( rmesa );
#if _HAVE_TEXGEN
radeonInitTexTransform( ctx );
#endif
@ -353,7 +356,6 @@ radeonCreateContext( const __GLcontextModes *glVisual,
radeonInitSpanFuncs( ctx );
#endif
radeonInitTextureFuncs( ctx );
radeonInitState( rmesa );
#if _HAVE_SWTNL
radeonInitSwtcl( ctx );
#endif

View file

@ -37,8 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_CONTEXT_H__
#define __RADEON_CONTEXT_H__
#ifdef GLX_DIRECT_RENDERING
struct radeon_context;
typedef struct radeon_context radeonContextRec;
typedef struct radeon_context *radeonContextPtr;
@ -800,5 +798,4 @@ extern int RADEON_DEBUG;
#define DEBUG_DMA 0x400
#define DEBUG_SANITY 0x800
#endif
#endif /* __RADEON_CONTEXT_H__ */

View file

@ -37,8 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_IOCTL_H__
#define __RADEON_IOCTL_H__
#ifdef GLX_DIRECT_RENDERING
#include "simple_list.h"
#include "radeon_lock.h"
@ -174,5 +172,4 @@ static __inline char *radeonAllocCmdBuf( radeonContextPtr rmesa,
#endif
#endif /* __RADEON_IOCTL_H__ */

View file

@ -256,7 +256,7 @@ void radeonUpdateMaterial( GLcontext *ctx )
* lighting space (model or eye), hence dependencies on _NEW_MODELVIEW
* and _MESA_NEW_NEED_EYE_COORDS.
*/
void update_light( GLcontext *ctx )
void radeonUpdateLighting( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@ -544,7 +544,7 @@ static void radeonFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
/* Examine lighting and texture state to determine if separate specular
* should be enabled.
*/
void radeonUpdateSpecular( GLcontext *ctx )
void radeonUpdateSpecular( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLuint p = rmesa->hw.ctx.cmd[CTX_PP_CNTL];
@ -641,9 +641,13 @@ static void radeonLightingSpaceChange( GLcontext *ctx )
void radeonInitLightStateFuncs( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
int i;
ctx->Driver.LightModelfv = radeonLightModelfv;
ctx->Driver.Lightfv = radeonLightfv;
ctx->Driver.Fogfv = radeonFogfv;
ctx->Driver.LightingSpaceChange = radeonLightingSpaceChange;
for (i = 0 ; i < 8; i++) {
struct gl_light *l = &ctx->Light.Light[i];

View file

@ -37,8 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_LOCK_H__
#define __RADEON_LOCK_H__
#ifdef GLX_DIRECT_RENDERING
extern void radeonGetLock( radeonContextPtr rmesa, GLuint flags );
/* Turn DEBUG_LOCKING on to find locking conflicts.
@ -109,5 +107,4 @@ extern int prevLockLine;
DEBUG_RESET(); \
} while (0)
#endif
#endif /* __RADEON_LOCK_H__ */

View file

@ -36,12 +36,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_MAOS_H__
#define __RADEON_MAOS_H__
#ifdef GLX_DIRECT_RENDERING
#include "radeon_context.h"
extern void radeonEmitArrays( GLcontext *ctx, GLuint inputs );
extern void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs );
#endif
#endif

View file

@ -37,8 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_SCREEN_H__
#define __RADEON_SCREEN_H__
#ifdef GLX_DIRECT_RENDERING
/*
* IMPORTS: these headers contain all the DRI, X and kernel-related
* definitions that we need.
@ -97,5 +95,4 @@ typedef struct {
extern radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv );
extern void radeonDestroyScreen( __DRIscreenPrivate *sPriv );
#endif
#endif /* __RADEON_SCREEN_H__ */

View file

@ -418,7 +418,7 @@ void radeonInitSpanFuncs( GLcontext *ctx )
ctx->Driver.Bitmap = _swrast_Bitmap;
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
/* ctx->Driver.ReadPixels = _swrast_ReadPixels; */
/* Swrast hooks for imaging extensions:
*/

View file

@ -37,9 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_SPAN_H__
#define __RADEON_SPAN_H__
#ifdef GLX_DIRECT_RENDERING
extern void radeonInitSpanFuncs( GLcontext *ctx );
#endif
#endif

View file

@ -1186,7 +1186,7 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
RADEON_STATECHANGE(rmesa, ctx );
if ( state ) {
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_FOG_ENABLE;
radeonFogfv( ctx, GL_FOG_MODE, 0 );
ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 );
} else {
rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_FOG_ENABLE;
RADEON_STATECHANGE(rmesa, tcl);
@ -1258,7 +1258,7 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
static void upload_matrix( radeonContextPtr rmesa, GLfloat *src, int idx )
void radeonUploadMatrix( radeonContextPtr rmesa, GLfloat *src, int idx )
{
float *dest = ((float *)RADEON_DB_STATE( mat[idx] ))+MAT_ELT_0;
int i;
@ -1274,7 +1274,8 @@ static void upload_matrix( radeonContextPtr rmesa, GLfloat *src, int idx )
RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
}
static void upload_matrix_t( radeonContextPtr rmesa, GLfloat *src, int idx )
void radeonUploadMatrixTranspose( radeonContextPtr rmesa, GLfloat *src,
int idx )
{
float *dest = ((float *)RADEON_DB_STATE( mat[idx] ))+MAT_ELT_0;
memcpy(dest, src, 16*sizeof(float));
@ -1298,13 +1299,14 @@ void radeonValidateState( GLcontext *ctx )
/* Need an event driven matrix update?
*/
if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
upload_matrix( rmesa, ctx->_ModelProjectMatrix.m, MODEL_PROJ );
radeonUploadMatrix( rmesa, ctx->_ModelProjectMatrix.m, MODEL_PROJ );
/* Need these for lighting (shouldn't upload otherwise)
*/
if (new_state & (_NEW_MODELVIEW)) {
upload_matrix( rmesa, ctx->ModelviewMatrixStack.Top->m, MODEL );
upload_matrix_t( rmesa, ctx->ModelviewMatrixStack.Top->inv, MODEL_IT );
radeonUploadMatrix( rmesa, ctx->ModelviewMatrixStack.Top->m, MODEL );
radeonUploadMatrixTranspose( rmesa, ctx->ModelviewMatrixStack.Top->inv,
MODEL_IT );
}
/* Does this need to be triggered on eg. modelview for
@ -1312,13 +1314,13 @@ void radeonValidateState( GLcontext *ctx )
*/
#if _HAVE_TEXGEN
if (new_state & _NEW_TEXTURE_MATRIX) {
update_texturematrix( ctx );
radeonUpdateTextureMatrix( ctx );
}
#endif
#if _HAVE_LIGHTING
if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW|_MESA_NEW_NEED_EYE_COORDS)) {
update_light( ctx );
radeonUpdateLighting( ctx );
}
#endif

View file

@ -37,8 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_STATE_H__
#define __RADEON_STATE_H__
#ifdef GLX_DIRECT_RENDERING
#include "radeon_context.h"
extern void radeonInitState( radeonContextPtr rmesa );
@ -72,5 +70,8 @@ extern void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
#define TEXMAT_1 4
#define TEXMAT_2 5
#endif
extern void radeonUpdateSpecular( GLcontext *ctx );
extern void radeonClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq );
#endif

View file

@ -514,11 +514,6 @@ void radeonInitState( radeonContextPtr rmesa )
(RADEON_LM_SOURCE_STATE_PREMULT << RADEON_SPECULAR_SOURCE_SHIFT));
#if _HAVE_SWTNL
TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
#endif
rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;

View file

@ -107,6 +107,8 @@ void radeonReadPixels( GLcontext *ctx,
GLint skipPixels = packing->SkipPixels;
GLint rowLength;
fprintf(stderr, "%s\n", __FUNCTION__);
/* can't do scale, bias, mapping, etc */
assert(!ctx->_ImageTransferState);

View file

@ -1271,8 +1271,9 @@ void radeonInitSwtcl( GLcontext *ctx )
rmesa->swtcl.render_primitive = GL_TRIANGLES;
rmesa->swtcl.hw_primitive = 0;
ctx->Driver.PolygonMode = radeonPolygonMode
ctx->Driver.LightingSpaceChange = radeonLightingSpaceChange;
ctx->Driver.PolygonMode = radeonPolygonMode;
tnl->Driver.NotifyMaterialChange( ctx );
}

View file

@ -36,8 +36,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_TCL_H__
#define __RADEON_TCL_H__
#ifdef GLX_DIRECT_RENDERING
#include "radeon_context.h"
extern void radeonTclPrimitive( GLcontext *ctx, GLenum prim, int hw_prim );
@ -76,4 +74,3 @@ typedef void (*render_func)( GLcontext *ctx, GLuint start, GLuint count,
#endif
#endif
#endif

View file

@ -37,7 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_TEX_H__
#define __RADEON_TEX_H__
#ifdef GLX_DIRECT_RENDERING
extern void radeonUpdateTextureState( GLcontext *ctx );
@ -53,5 +52,4 @@ extern void radeonUpdateTexLRU( radeonContextPtr rmesa, radeonTexObjPtr t );
extern void radeonInitTextureFuncs( GLcontext *ctx );
#endif
#endif /* __RADEON_TEX_H__ */

View file

@ -1,3 +1,48 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.5 2002/09/16 18:05:20 eich Exp $ */
/*
* Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
*
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "imports.h"
#include "api_arrayelt.h"
#include "mmath.h"
#include "enums.h"
#include "colormac.h"
#include "radeon_context.h"
#include "radeon_ioctl.h"
#include "radeon_state.h"
#include "radeon_tcl.h"
#include "radeon_tex.h"
#include "radeon_vtxfmt.h"
static void set_texgen_matrix( radeonContextPtr rmesa,
GLuint unit,
GLfloat *s_plane,
@ -25,7 +70,7 @@ static void set_texgen_matrix( radeonContextPtr rmesa,
*
* Returns GL_FALSE if fallback required.
*/
static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
GLboolean radeonUpdateTexgen( GLcontext *ctx, GLuint unit )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
@ -109,7 +154,7 @@ static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
static void update_texturematrix( GLcontext *ctx )
void radeonUpdateTextureMatrix( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
GLuint tpc = rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL];
@ -134,18 +179,18 @@ static void update_texturematrix( GLcontext *ctx )
_math_matrix_mul_matrix( &rmesa->tmpmat,
&rmesa->TexGenMatrix[unit],
ctx->TextureMatrixStack[unit].Top );
upload_matrix( rmesa, rmesa->tmpmat.m, TEXMAT_0+unit );
radeonUploadMatrix( rmesa, rmesa->tmpmat.m, TEXMAT_0+unit );
}
else {
rmesa->TexMatEnabled |=
(RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
upload_matrix( rmesa, ctx->TextureMatrixStack[unit].Top->m,
TEXMAT_0+unit );
radeonUploadMatrix( rmesa, ctx->TextureMatrixStack[unit].Top->m,
TEXMAT_0+unit );
}
}
else if (rmesa->TexGenEnabled & (RADEON_TEXMAT_0_ENABLE << unit)) {
upload_matrix( rmesa, rmesa->TexGenMatrix[unit].m,
TEXMAT_0+unit );
radeonUploadMatrix( rmesa, rmesa->TexGenMatrix[unit].m,
TEXMAT_0+unit );
}
}
@ -178,6 +223,8 @@ static void update_texturematrix( GLcontext *ctx )
void radeonInitTexTransform( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
_math_matrix_ctr( &rmesa->TexGenMatrix[0] );
_math_matrix_ctr( &rmesa->TexGenMatrix[1] );
_math_matrix_ctr( &rmesa->tmpmat );

View file

@ -1216,7 +1216,7 @@ static GLboolean radeonUpdateTextureUnit( GLcontext *ctx, int unit )
#if _HAVE_TEXGEN
if (rmesa->recheck_texgen[unit]) {
GLboolean fallback = !radeon_validate_texgen( ctx, unit );
GLboolean fallback = !radeonUpdateTexgen( ctx, unit );
TCL_FALLBACK( ctx, (RADEON_TCL_FALLBACK_TEXGEN_0<<unit), fallback);
rmesa->recheck_texgen[unit] = 0;
rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;

View file

@ -1,4 +1,49 @@
static void radeonClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq )
/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.5 2002/09/16 18:05:20 eich Exp $ */
/*
* Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
*
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#include "imports.h"
#include "api_arrayelt.h"
#include "mmath.h"
#include "enums.h"
#include "colormac.h"
#include "radeon_context.h"
#include "radeon_ioctl.h"
#include "radeon_state.h"
#include "radeon_tcl.h"
#include "radeon_tex.h"
#include "radeon_vtxfmt.h"
void radeonClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq )
{
GLint p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@ -31,9 +76,9 @@ void radeonUpdateClipPlanes( GLcontext *ctx )
void radeonInitUserClip( GLcontext *ctx )
{
ctx->Driver.ClipPlane = radeonClipPlane;
int i;
ctx->Driver.ClipPlane = radeonClipPlane;
for (i = 0 ; i < 6; i++)
ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, NULL );
}

View file

@ -36,8 +36,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_VTXFMT_H__
#define __RADEON_VTXFMT_H__
#ifdef GLX_DIRECT_RENDERING
#include "radeon_context.h"
@ -125,4 +123,3 @@ struct dynfn *radeon_makeX86MultiTexCoord1fvARB( GLcontext *, int );
#endif
#endif