Commit 55378d1c authored by alanh's avatar alanh
Browse files

Import of XFree86 4.0.1

parent 4a947efe
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -78,9 +78,6 @@ extern "C" {
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "xmesa_x.h"
#ifdef GLX_DIRECT_RENDERING
#include "dri_mesa.h"
#endif
#endif
#include "GL/gl.h"
......@@ -116,18 +113,6 @@ typedef struct xmesa_visual *XMesaVisual;
typedef struct xmesa_buffer *XMesaBuffer;
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
/*
* Initialize the XMesa driver.
*/
extern GLboolean XMesaInitDriver( __DRIscreenPrivate *driScrnPriv );
/*
* Reset the XMesa driver when the X server resets.
*/
extern void XMesaResetDriver( __DRIscreenPrivate *driScrnPriv );
#endif
/*
......@@ -140,24 +125,35 @@ extern void XMesaResetDriver( __DRIscreenPrivate *driScrnPriv );
* db_flag - GL_TRUE = double-buffered,
* GL_FALSE = single buffered
* stereo_flag - stereo visual?
* depth_size - requested bits/depth values, or zero
* stencil_size - requested bits/stencil values, or zero
* accum_size - requested bits/component values, or zero
* ximage_flag - GL_TRUE = use an XImage for back buffer,
* GL_FALSE = use an off-screen pixmap for back buffer
* depth_size - requested bits/depth values, or zero
* stencil_size - requested bits/stencil values, or zero
* accum_red_size - requested bits/red accum values, or zero
* accum_green_size - requested bits/green accum values, or zero
* accum_blue_size - requested bits/blue accum values, or zero
* accum_alpha_size - requested bits/alpha accum values, or zero
* num_samples - number of samples/pixel if multisampling, or zero
* level - visual level, usually 0
* visualCaveat - ala the GLX extension, usually GLX_NONE_EXT
* Return; a new XMesaVisual or 0 if error.
*/
extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
XMesaVisualInfo visinfo,
GLboolean rgb_flag,
GLboolean alpha_flag,
GLboolean db_flag,
GLboolean stereo_flag,
GLboolean ximage_flag,
GLint depth_size,
GLint stencil_size,
GLint accum_size,
GLint level );
XMesaVisualInfo visinfo,
GLboolean rgb_flag,
GLboolean alpha_flag,
GLboolean db_flag,
GLboolean stereo_flag,
GLboolean ximage_flag,
GLint depth_size,
GLint stencil_size,
GLint accum_red_size,
GLint accum_green_size,
GLint accum_blue_size,
GLint accum_alpha_size,
GLint num_samples,
GLint level,
GLint visualCaveat );
/*
* Destroy an XMesaVisual, but not the associated XVisualInfo.
......@@ -175,11 +171,7 @@ extern void XMesaDestroyVisual( XMesaVisual v );
* Return: an XMesaContext or NULL if error.
*/
extern XMesaContext XMesaCreateContext( XMesaVisual v,
XMesaContext share_list
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
, __DRIcontextPrivate *driContextPriv
#endif
);
XMesaContext share_list );
/*
......@@ -191,12 +183,7 @@ extern void XMesaDestroyContext( XMesaContext c );
/*
* Create an XMesaBuffer from an X window.
*/
extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v,
XMesaWindow w
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
, __DRIdrawablePrivate *driDrawPriv
#endif
);
extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w );
/*
......@@ -204,11 +191,7 @@ extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v,
*/
extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
XMesaPixmap p,
XMesaColormap cmap
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
, __DRIdrawablePrivate *driDrawPriv
#endif
);
XMesaColormap cmap );
/*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -55,6 +55,13 @@
#include <stdlib.h>
#include <string.h>
grStencilFunc_t grStencilFuncPtr = NULL;
grStencilMask_t grStencilMaskPtr = NULL;
grStencilOp_t grStencilOpPtr = NULL;
grBufferClearExt_t grBufferClearExtPtr = NULL;
FxI32 FX_grGetInteger_NoLock(FxU32 pname)
{
#if !defined(FX_GLIDE3)
......@@ -71,6 +78,8 @@ FxI32 FX_grGetInteger_NoLock(FxU32 pname)
case FX_TEXTURE_ALIGN:
/* This is a guess from reading the glide3 docs */
return 8;
case FX_ZDEPTH_MAX:
return 0xFFFF;
default:
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"Wrong parameter in FX_grGetInteger!\n");
......@@ -90,6 +99,12 @@ FxI32 FX_grGetInteger_NoLock(FxU32 pname)
case FX_TEXTURE_ALIGN:
grname = pname;
break;
case FX_ZDEPTH_MAX: {
int zvals[2];
grGet(GR_ZDEPTH_MIN_MAX, 8, zvals);
return zvals[0];
}
default:
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"Wrong parameter in FX_grGetInteger!\n");
......@@ -154,7 +169,17 @@ extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu) {
FxBool FX_grSstControl(FxU32 code)
{
#if defined(FX_GLIDE3)
(void) code;
/* The glide 3 sources call for grEnable/grDisable to be called in exchange
* for grSstControl. */
switch(code) {
case GR_CONTROL_ACTIVATE:
grEnable(GR_PASSTHRU);
break;
case GR_CONTROL_DEACTIVATE:
grDisable(GR_PASSTHRU);
break;
}
/* Appearently GR_CONTROL_RESIZE can be ignored. */
return 1; /* OK? */
#else
FxU32 result;
......@@ -225,12 +250,12 @@ void FX_grGlideGetVersion(char *buf)
void FX_grSstPerfStats(GrSstPerfStats_t *st)
{
/* ToDo */
st->pixelsIn = 0;
st->chromaFail = 0;
st->zFuncFail = 0;
st->aFuncFail = 0;
st->pixelsOut = 0;
FxI32 n;
grGet(GR_STATS_PIXELS_IN, 4, &n); st->pixelsIn = n;
grGet(GR_STATS_PIXELS_CHROMA_FAIL, 4, &n); st->chromaFail = n;
grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, 4, &n); st->zFuncFail = n;
grGet(GR_STATS_PIXELS_AFUNC_FAIL, 4, &n); st->aFuncFail = n;
grGet(GR_STATS_PIXELS_OUT, 4, &n); st->pixelsOut = n;
}
void FX_grAADrawLine(GrVertex *a,GrVertex *b)
......@@ -385,6 +410,10 @@ int FX_grSstQueryHardware(GrHwConfiguration *c)
return i;
}
#endif /* FX_GLIDE3 */
/* It appears to me that this function is needed either way. */
FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
GrScreenResolution_t screen_resolution,
GrScreenRefresh_t refresh_rate,
......@@ -403,6 +432,7 @@ FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
nColBuffers,
nAuxBuffers );
/*
fprintf(stderr,
"grSstWinOpen( win %d res %d ref %d fmt %d\n"
" org %d ncol %d naux %d )\n"
......@@ -415,13 +445,13 @@ FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
nColBuffers,
nAuxBuffers,
i);
*/
END_BOARD_LOCK();
return i;
}
#endif
#else
/*
......
This diff is collapsed.
......@@ -104,7 +104,7 @@ static void fxDDRenderVB( struct vertex_buffer *VB )
GLcontext *ctx = VB->ctx;
fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
if ((fxMesa->render_index & ~FX_FLAT) ||
if ((fxMesa->render_index != 0) ||
((ctx->Texture.ReallyEnabled & 0xf) && VB->TexCoordPtr[0]->size>2) ||
((ctx->Texture.ReallyEnabled & 0xf0) && VB->TexCoordPtr[1]->size>2))
gl_render_vb( VB );
......@@ -281,12 +281,13 @@ void fxDDOptimizePrecalcPipeline( GLcontext *ctx, struct gl_pipeline *pipe )
/* unused?
void fxDDOptimizeEltPipeline( GLcontext *ctx, struct gl_pipeline *pipe )
{
(void) ctx;
(void) pipe;
}
*/
#else
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -363,6 +363,7 @@ void fxDDChooseRenderState( GLcontext *ctx )
* Need this to provide at least one external definition.
*/
extern int gl_fx_dummy_function_tris(void);
int gl_fx_dummy_function_tris(void)
{
return 0;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment