summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/Makefile.X114
-rw-r--r--src/mesa/main/colortab.c40
-rw-r--r--src/mesa/main/convolve.c47
-rw-r--r--src/mesa/main/dd.h398
-rw-r--r--src/mesa/main/drawpix.c6
-rw-r--r--src/mesa/main/mtypes.h39
-rw-r--r--src/mesa/main/state.c23
-rw-r--r--src/mesa/main/teximage.c8
-rw-r--r--src/mesa/main/texstore.c356
-rw-r--r--src/mesa/main/texstore.h32
10 files changed, 57 insertions, 896 deletions
diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11
index 24109a739c..a2c0388f3b 100644
--- a/src/mesa/main/Makefile.X11
+++ b/src/mesa/main/Makefile.X11
@@ -1,4 +1,4 @@
-# $Id: Makefile.X11,v 1.46 2001/03/18 08:53:49 gareth Exp $
+# $Id: Makefile.X11,v 1.47 2001/03/19 02:25:35 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -138,6 +138,7 @@ CORE_SOURCES = \
swrast/s_feedback.c \
swrast/s_fog.c \
swrast/s_histogram.c \
+ swrast/s_imaging.c \
swrast/s_lines.c \
swrast/s_logic.c \
swrast/s_masking.c \
@@ -149,6 +150,7 @@ CORE_SOURCES = \
swrast/s_span.c \
swrast/s_stencil.c \
swrast/s_texture.c \
+ swrast/s_texstore.c \
swrast/s_triangle.c \
swrast/s_zoom.c
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index eae856b300..5a50ae50e6 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -1,4 +1,4 @@
-/* $Id: colortab.c,v 1.37 2001/03/12 00:48:37 gareth Exp $ */
+/* $Id: colortab.c,v 1.38 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -609,28 +609,11 @@ void
_mesa_CopyColorTable(GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
- GLchan data[MAX_WIDTH][4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
/* Select buffer to read from */
- (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
-
- if (width > MAX_WIDTH)
- width = MAX_WIDTH;
-
- /* read the data from framebuffer */
- RENDER_START(ctx);
- _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
- RENDER_FINISH(ctx);
-
- /* Restore reading from draw buffer (the default) */
- (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
-
- _mesa_ColorTable(target, internalformat, width,
- GL_RGBA, GL_UNSIGNED_BYTE, data);
+ ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width );
}
@@ -640,27 +623,10 @@ void
_mesa_CopyColorSubTable(GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
- GLchan data[MAX_WIDTH][4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- /* Select buffer to read from */
- (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
-
- if (width > MAX_WIDTH)
- width = MAX_WIDTH;
-
- /* read the data from framebuffer */
- RENDER_START(ctx);
- _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
- RENDER_FINISH(ctx);
-
- /* Restore reading from draw buffer (the default) */
- (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
-
- _mesa_ColorSubTable(target, start, width, GL_RGBA, GL_UNSIGNED_BYTE, data);
+ ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width );
}
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c
index 5031f95b62..aedbf091a7 100644
--- a/src/mesa/main/convolve.c
+++ b/src/mesa/main/convolve.c
@@ -1,4 +1,4 @@
-/* $Id: convolve.c,v 1.22 2001/03/12 00:48:37 gareth Exp $ */
+/* $Id: convolve.c,v 1.23 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -468,7 +468,6 @@ void
_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
{
GLenum baseFormat;
- GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -488,14 +487,8 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi
return;
}
- /* read pixels from framebuffer */
- RENDER_START(ctx);
- _mesa_read_rgba_span(ctx, ctx->ReadBuffer, width, x, y, (GLchan (*)[4]) rgba);
- RENDER_FINISH(ctx);
-
- /* store as convolution filter */
- _mesa_ConvolutionFilter1D(target, internalFormat, width,
- GL_RGBA, CHAN_TYPE, rgba);
+ ctx->Driver.CopyConvolutionFilter1D( ctx, target,
+ internalFormat, x, y, width);
}
@@ -503,9 +496,6 @@ void
_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
{
GLenum baseFormat;
- GLint i;
- struct gl_pixelstore_attrib packSave;
- GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -529,34 +519,9 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi
return;
}
- /* read pixels from framebuffer */
- RENDER_START(ctx);
- for (i = 0; i < height; i++) {
- _mesa_read_rgba_span(ctx, ctx->ReadBuffer, width, x, y + i,
- (GLchan (*)[4]) rgba[i]);
- }
- RENDER_FINISH(ctx);
-
- /*
- * store as convolution filter
- */
- packSave = ctx->Unpack; /* save pixel packing params */
-
- ctx->Unpack.Alignment = 1;
- ctx->Unpack.RowLength = MAX_CONVOLUTION_WIDTH;
- ctx->Unpack.SkipPixels = 0;
- ctx->Unpack.SkipRows = 0;
- ctx->Unpack.ImageHeight = 0;
- ctx->Unpack.SkipImages = 0;
- ctx->Unpack.SwapBytes = GL_FALSE;
- ctx->Unpack.LsbFirst = GL_FALSE;
- ctx->NewState |= _NEW_PACKUNPACK;
-
- _mesa_ConvolutionFilter2D(target, internalFormat, width, height,
- GL_RGBA, CHAN_TYPE, rgba);
-
- ctx->Unpack = packSave; /* restore pixel packing params */
- ctx->NewState |= _NEW_PACKUNPACK;
+ ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y,
+ width, height );
+
}
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 1e3671b5e5..2dd3751faa 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1,4 +1,4 @@
-/* $Id: dd.h,v 1.58 2001/03/12 00:48:37 gareth Exp $ */
+/* $Id: dd.h,v 1.59 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -33,74 +33,6 @@
struct gl_pixelstore_attrib;
-
-/*
- * Device Driver (DD) interface
- *
- *
- * All device driver functions are accessed through pointers in the
- * dd_function_table struct (defined below) which is stored in the GLcontext
- * struct. Since the device driver is strictly accessed trough a table of
- * function pointers we can:
- * 1. switch between a number of different device drivers at runtime.
- * 2. use optimized functions dependant on current rendering state or
- * frame buffer configuration.
- *
- * The function pointers in the dd_function_table struct are divided into
- * two groups: mandatory and optional.
- * Mandatory functions have to be implemented by every device driver.
- * Optional functions may or may not be implemented by the device driver.
- * The optional functions provide ways to take advantage of special hardware
- * or optimized algorithms.
- *
- * The function pointers in the dd_function_table struct should first be
- * initialized in the driver's "MakeCurrent" function. The "MakeCurrent"
- * function is a little different in each device driver. See the X/Mesa,
- * GLX, or OS/Mesa drivers for examples.
- *
- * Later, Mesa may call the dd_function_table's UpdateState() function.
- * This function should initialize the dd_function_table's pointers again.
- * The UpdateState() function is called whenever the core (GL) rendering
- * state is changed in a way which may effect rasterization. For example,
- * the TriangleFunc() pointer may have to point to different functions
- * depending on whether smooth or flat shading is enabled.
- *
- * Note that the first argument to every device driver function is a
- * GLcontext *. In turn, the GLcontext->DriverCtx pointer points to
- * the driver-specific context struct. See the X/Mesa or OS/Mesa interface
- * for an example.
- *
- * For more information about writing a device driver see the drivers
- * in OSmesa/ and X/ for examples.
- *
- * Look below in the dd_function_table struct definition for descriptions
- * of each device driver function.
- *
- * More function pointers may be added as required.
- *
- *
- * Notes:
- * ------
- * RGBA = red/green/blue/alpha
- * CI = color index (color mapped mode)
- * mono = all pixels have the same color or index
- *
- * The write_ functions all take an array of mask flags which indicate
- * whether or not the pixel should be written. One special case exists
- * in the write_color_span function: if the mask array is NULL, then
- * draw all pixels. This is an optimization used for glDrawPixels().
- *
- * IN ALL CASES:
- * X coordinates start at 0 at the left and increase to the right
- * Y coordinates start at 0 at the bottom and increase upward
- *
- */
-
-
-
-
-
-
/* Mask bits sent to the driver Clear() function */
#define DD_FRONT_LEFT_BIT FRONT_LEFT_BIT /* 1 */
#define DD_FRONT_RIGHT_BIT FRONT_RIGHT_BIT /* 2 */
@@ -111,35 +43,6 @@ struct gl_pixelstore_attrib;
#define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */
-
-
-
-
-
-/* Point, line, triangle, quadrilateral and rectangle rasterizer
- * functions. These are specific to the tnl module and will shortly
- * move to a driver interface specific to that module.
- */
-typedef void (*points_func)( GLcontext *ctx, GLuint first, GLuint last );
-
-typedef void (*line_func)( GLcontext *ctx, GLuint v1, GLuint v2 );
-
-typedef void (*triangle_func)( GLcontext *ctx,
- GLuint v1, GLuint v2, GLuint v3 );
-
-typedef void (*quad_func)( GLcontext *ctx, GLuint v1, GLuint v2,
- GLuint v3, GLuint v4 );
-
-typedef void (*render_func)( GLcontext *ctx, GLuint start, GLuint count,
- GLuint flags );
-
-typedef void (*interp_func)( GLcontext *ctx,
- GLfloat t, GLuint dst, GLuint in, GLuint out,
- GLboolean force_boundary );
-
-typedef void (*copy_pv_func)( GLcontext *ctx, GLuint dst, GLuint src );
-
-
/*
* Device Driver function table.
*/
@@ -158,9 +61,9 @@ struct dd_function_table {
void (*UpdateState)( GLcontext *ctx, GLuint new_state );
/*
- * UpdateState() is called whenver Mesa thinks the device driver should
- * update its state and/or the other pointers (such as PointsFunc,
- * LineFunc, or TriangleFunc).
+ * UpdateState() is called to notify the driver after Mesa has made
+ * some internal state changes. This is in addition to any
+ * statechange callbacks Mesa may already have made.
*/
void (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all,
@@ -194,120 +97,11 @@ struct dd_function_table {
* GL_NONE - disable buffer write in device driver.
*/
- void (*SetReadBuffer)( GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum buffer );
- /*
- * Specifies the current buffer for reading.
- * colorBuffer will be one of:
- * GL_FRONT_LEFT - this buffer always exists
- * GL_BACK_LEFT - when double buffering
- * GL_FRONT_RIGHT - when using stereo
- * GL_BACK_RIGHT - when using stereo and double buffering
- */
-
void (*GetBufferSize)( GLcontext *ctx, GLuint *width, GLuint *height );
/*
* Returns the width and height of the current color buffer.
*/
-
- /***
- *** Functions for writing pixels to the frame buffer:
- ***/
-
- void (*WriteRGBASpan)( const GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- CONST GLchan rgba[][4], const GLubyte mask[] );
- void (*WriteRGBSpan)( const GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- CONST GLchan rgb[][3], const GLubyte mask[] );
- /* Write a horizontal run of RGBA or RGB pixels.
- * If mask is NULL, draw all pixels.
- * If mask is not null, only draw pixel [i] when mask [i] is true.
- */
-
- void (*WriteMonoRGBASpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLchan color[4], const GLubyte mask[] );
- /* Write a horizontal run of RGBA pixels all with the same color.
- */
-
- void (*WriteRGBAPixels)( const GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- CONST GLchan rgba[][4], const GLubyte mask[] );
- /* Write array of RGBA pixels at random locations.
- */
-
- void (*WriteMonoRGBAPixels)( const GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLchan color[4], const GLubyte mask[] );
- /* Write an array of mono-RGBA pixels at random locations.
- */
-
- void (*WriteCI32Span)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLuint index[], const GLubyte mask[] );
- void (*WriteCI8Span)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLubyte index[], const GLubyte mask[] );
- /* Write a horizontal run of CI pixels. One function is for 32bpp
- * indexes and the other for 8bpp pixels (the common case). You mus
- * implement both for color index mode.
- */
-
- void (*WriteMonoCISpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLuint colorIndex, const GLubyte mask[] );
- /* Write a horizontal run of color index pixels using the color index
- * last specified by the Index() function.
- */
-
- void (*WriteCI32Pixels)( const GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLuint index[], const GLubyte mask[] );
- /*
- * Write a random array of CI pixels.
- */
-
- void (*WriteMonoCIPixels)( const GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint colorIndex, const GLubyte mask[] );
- /* Write a random array of color index pixels using the color index
- * last specified by the Index() function.
- */
-
-
- /***
- *** Functions to read pixels from frame buffer:
- ***/
-
- void (*ReadCI32Span)( const GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLuint index[] );
- /* Read a horizontal run of color index pixels.
- */
-
- void (*ReadRGBASpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLchan rgba[][4] );
- /* Read a horizontal run of RGBA pixels.
- */
-
- void (*ReadCI32Pixels)( const GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLuint indx[], const GLubyte mask[] );
- /* Read a random array of CI pixels.
- */
-
- void (*ReadRGBAPixels)( const GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLubyte mask[] );
- /* Read a random array of RGBA pixels.
- */
-
-
- /**********************************************************************
- *** Optional functions: these functions may or may not be ***
- *** implemented by the device driver. If the device driver ***
- *** doesn't implement them it should never touch these pointers ***
- *** since Mesa will either set them to NULL or point them at a ***
- *** fall-back function. ***
- **********************************************************************/
-
void (*Finish)( GLcontext *ctx );
/*
* This is called whenever glFinish() is called.
@@ -326,73 +120,6 @@ struct dd_function_table {
/***
- *** For supporting hardware Z buffers:
- *** Either ALL or NONE of these functions must be implemented!
- *** NOTE that Each depth value is a 32-bit GLuint. If the depth
- *** buffer is less than 32 bits deep then the extra upperbits are zero.
- ***/
-
- void (*WriteDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth depth[], const GLubyte mask[] );
- /* Write a horizontal span of values into the depth buffer. Only write
- * depth[i] value if mask[i] is nonzero.
- */
-
- void (*ReadDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLdepth depth[] );
- /* Read a horizontal span of values from the depth buffer.
- */
-
-
- void (*WriteDepthPixels)( GLcontext *ctx, GLuint n,
- const GLint x[], const GLint y[],
- const GLdepth depth[], const GLubyte mask[] );
- /* Write an array of randomly positioned depth values into the
- * depth buffer. Only write depth[i] value if mask[i] is nonzero.
- */
-
- void (*ReadDepthPixels)( GLcontext *ctx, GLuint n,
- const GLint x[], const GLint y[],
- GLdepth depth[] );
- /* Read an array of randomly positioned depth values from the depth buffer.
- */
-
-
-
- /***
- *** For supporting hardware stencil buffers:
- *** Either ALL or NONE of these functions must be implemented!
- ***/
-
- void (*WriteStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLstencil stencil[], const GLubyte mask[] );
- /* Write a horizontal span of stencil values into the stencil buffer.
- * If mask is NULL, write all stencil values.
- * Else, only write stencil[i] if mask[i] is non-zero.
- */
-
- void (*ReadStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLstencil stencil[] );
- /* Read a horizontal span of stencil values from the stencil buffer.
- */
-
- void (*WriteStencilPixels)( GLcontext *ctx, GLuint n,
- const GLint x[], const GLint y[],
- const GLstencil stencil[],
- const GLubyte mask[] );
- /* Write an array of stencil values into the stencil buffer.
- * If mask is NULL, write all stencil values.
- * Else, only write stencil[i] if mask[i] is non-zero.
- */
-
- void (*ReadStencilPixels)( GLcontext *ctx, GLuint n,
- const GLint x[], const GLint y[],
- GLstencil stencil[] );
- /* Read an array of stencil values from the stencil buffer.
- */
-
-
- /***
*** For hardware accumulation buffer:
***/
void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value,
@@ -709,6 +436,27 @@ struct dd_function_table {
* is to be updated.
*/
+ /***
+ *** Imaging functionality:
+ ***/
+ void (*CopyColorTable)( GLcontext *ctx,
+ GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width );
+
+ void (*CopyColorSubTable)( GLcontext *ctx,
+ GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width );
+
+ void (*CopyConvolutionFilter1D)( GLcontext *ctx, GLenum target,
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width );
+
+ void (*CopyConvolutionFilter2D)( GLcontext *ctx, GLenum target,
+ GLenum internalFormat,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+
/***
*** State-changing functions (drawing functions are above)
@@ -768,17 +516,6 @@ struct dd_function_table {
void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
- /*** State-query functions
- ***
- *** Return GL_TRUE if query was completed, GL_FALSE otherwise.
- ***/
- GLboolean (*GetBooleanv)(GLcontext *ctx, GLenum pname, GLboolean *result);
- GLboolean (*GetDoublev)(GLcontext *ctx, GLenum pname, GLdouble *result);
- GLboolean (*GetFloatv)(GLcontext *ctx, GLenum pname, GLfloat *result);
- GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result);
- GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result);
-
-
/***
*** Vertex array functions
***
@@ -801,85 +538,16 @@ struct dd_function_table {
void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr);
- /***
- *** TNL Pipeline
- ***/
-
- void (*PipelineStart)(GLcontext *ctx);
- void (*PipelineFinish)(GLcontext *ctx);
- /* Called before and after all pipeline stages.
- * These are a suitable place for grabbing/releasing hardware locks.
- */
-
- /***
- *** Rendering
- ***/
-
- void (*RenderStart)(GLcontext *ctx);
- void (*RenderFinish)(GLcontext *ctx);
- /* Called before and after all rendering operations, including DrawPixels,
- * ReadPixels, Bitmap, span functions, and CopyTexImage, etc commands.
- * These are a suitable place for grabbing/releasing hardware locks.
- */
-
- void (*RenderPrimitive)(GLcontext *ctx, GLenum mode);
- /* Called between RednerStart() and RenderFinish() to indicate the
- * type of primitive we're about to draw. Mode will be one of the
- * modes accepted by glBegin().
- */
-
- interp_func RenderInterp;
- copy_pv_func RenderCopyPV;
- void (*RenderClippedPolygon)( GLcontext *ctx, const GLuint *elts, GLuint n );
- void (*RenderClippedLine)( GLcontext *ctx, GLuint v0, GLuint v1 );
- /* Functions to interpolate between prebuilt vertices, copy flat-shade
- * provoking color, and to render clipped primitives.
- */
-
- /***
- *** Parameters for _tnl_render_stage
+ /*** State-query functions
+ ***
+ *** Return GL_TRUE if query was completed, GL_FALSE otherwise.
***/
- points_func PointsFunc; /* must now respect vb->elts */
- line_func LineFunc;
- triangle_func TriangleFunc;
- quad_func QuadFunc;
- /* These functions are called in order to render points, lines,
- * triangles and quads. These are only called via the T&L module.
- */
-
- render_func *RenderTabVerts;
- render_func *RenderTabElts;
- /* Render whole unclipped primitives (points, lines, linestrips,
- * lineloops, etc). The tables are indexed by the GL enum of the
- * primitive to be rendered.
- */
-
- void (*ResetLineStipple)( GLcontext *ctx );
- /* Reset the hardware's line stipple counter.
- */
-
- void (*BuildProjectedVertices)( GLcontext *ctx,
- GLuint start, GLuint end,
- GLuint new_inputs);
- /* This function is called whenever new vertices are required for
- * rendering. The vertices in question are those n such that start
- * <= n < end. The new_inputs parameter indicates those fields of
- * the vertex which need to be updated, if only a partial repair of
- * the vertex is required.
- *
- * This function is called only from _tnl_render_stage in tnl/t_render.c.
- */
-
+ GLboolean (*GetBooleanv)(GLcontext *ctx, GLenum pname, GLboolean *result);
+ GLboolean (*GetDoublev)(GLcontext *ctx, GLenum pname, GLdouble *result);
+ GLboolean (*GetFloatv)(GLcontext *ctx, GLenum pname, GLfloat *result);
+ GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result);
+ GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result);
- GLboolean (*MultipassFunc)( GLcontext *ctx, GLuint passno );
- /* Driver may request additional render passes by returning GL_TRUE
- * when this function is called. This function will be called
- * after the first pass, and passes will be made until the function
- * returns GL_FALSE. If no function is registered, only one pass
- * is made.
- *
- * This function will be first invoked with passno == 1.
- */
/***
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 4d7d938a69..4b34ddd707 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: drawpix.c,v 1.50 2001/03/12 00:48:37 gareth Exp $ */
+/* $Id: drawpix.c,v 1.51 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -68,12 +68,8 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
y = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
ctx->OcclusionResult = GL_TRUE;
-
- /* see if device driver can do the drawpix */
- RENDER_START(ctx);
ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
&ctx->Unpack, pixels);
- RENDER_FINISH(ctx);
}
else if (ctx->RenderMode==GL_FEEDBACK) {
if (ctx->Current.RasterPosValid) {
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 1ed5bad4c2..af3c3c94e8 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.27 2001/03/18 08:53:49 gareth Exp $ */
+/* $Id: mtypes.h,v 1.28 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -1702,43 +1702,6 @@ do { \
} while (0)
-#ifdef DEBUG
-
-#define RENDER_START(CTX) \
- do { \
- assert(!(CTX)->Rendering); \
- (CTX)->Rendering = GL_TRUE; \
- if ((CTX)->Driver.RenderStart) { \
- (*(CTX)->Driver.RenderStart)(CTX); \
- } \
- } while (0)
-
-#define RENDER_FINISH(CTX) \
- do { \
- assert((CTX)->Rendering); \
- (CTX)->Rendering = GL_FALSE; \
- if ((CTX)->Driver.RenderFinish) { \
- (*(CTX)->Driver.RenderFinish)(CTX); \
- } \
- } while (0)
-
-#else
-
-#define RENDER_START(CTX) \
- do { \
- if ((CTX)->Driver.RenderStart) { \
- (*(CTX)->Driver.RenderStart)(CTX); \
- } \
- } while (0)
-
-#define RENDER_FINISH(CTX) \
- do { \
- if ((CTX)->Driver.RenderFinish) { \
- (*(CTX)->Driver.RenderFinish)(CTX); \
- } \
- } while (0)
-
-#endif
#endif /* TYPES_H */
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 9c4685ed85..11de54ac35 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.61 2001/03/12 00:48:38 gareth Exp $ */
+/* $Id: state.c,v 1.62 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -959,26 +959,7 @@ void _mesa_update_state( GLcontext *ctx )
ASSERT(ctx->Driver.UpdateState);
ASSERT(ctx->Driver.Clear);
ASSERT(ctx->Driver.SetDrawBuffer);
- ASSERT(ctx->Driver.SetReadBuffer);
ASSERT(ctx->Driver.GetBufferSize);
- if (ctx->Visual.rgbMode) {
- ASSERT(ctx->Driver.WriteRGBASpan);
- ASSERT(ctx->Driver.WriteRGBSpan);
- ASSERT(ctx->Driver.WriteMonoRGBASpan);
- ASSERT(ctx->Driver.WriteRGBAPixels);
- ASSERT(ctx->Driver.WriteMonoRGBAPixels);
- ASSERT(ctx->Driver.ReadRGBASpan);
- ASSERT(ctx->Driver.ReadRGBAPixels);
- }
- else {
- ASSERT(ctx->Driver.WriteCI32Span);
- ASSERT(ctx->Driver.WriteCI8Span);
- ASSERT(ctx->Driver.WriteMonoCISpan);
- ASSERT(ctx->Driver.WriteCI32Pixels);
- ASSERT(ctx->Driver.WriteMonoCIPixels);
- ASSERT(ctx->Driver.ReadCI32Span);
- ASSERT(ctx->Driver.ReadCI32Pixels);
- }
if (ctx->Visual.accumRedBits > 0) {
ASSERT(ctx->Driver.Accum);
}
@@ -1009,6 +990,4 @@ void _mesa_update_state( GLcontext *ctx )
ASSERT(ctx->Driver.GetCompressedTexImage);
ASSERT(ctx->Driver.BaseCompressedTexFormat);
}
- ASSERT(ctx->Driver.RenderStart);
- ASSERT(ctx->Driver.RenderFinish);
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index d44b5d6ee6..cb7447769c 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.85 2001/03/18 08:53:49 gareth Exp $ */
+/* $Id: teximage.c,v 1.86 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -1349,11 +1349,13 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
}
}
+#if 0
/* one of these has to be non-zero! */
ASSERT(texImage->RedBits || texImage->IndexBits || texImage->AlphaBits ||
texImage->LuminanceBits || texImage->IntensityBits ||
texImage->DepthBits);
ASSERT(texImage->FetchTexel);
+#endif
/* state update */
texObj->Complete = GL_FALSE;
@@ -1461,11 +1463,13 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
}
}
+#if 0
/* one of these has to be non-zero! */
ASSERT(texImage->RedBits || texImage->IndexBits || texImage->AlphaBits ||
texImage->LuminanceBits || texImage->IntensityBits ||
texImage->DepthBits);
ASSERT(texImage->FetchTexel);
+#endif
/* state update */
texObj->Complete = GL_FALSE;
@@ -1566,11 +1570,13 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
}
}
+#if 0
/* one of these has to be non-zero! */
ASSERT(texImage->RedBits || texImage->IndexBits || texImage->AlphaBits ||
texImage->LuminanceBits || texImage->IntensityBits ||
texImage->DepthBits);
ASSERT(texImage->FetchTexel);
+#endif
/* state update */
texObj->Complete = GL_FALSE;
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 2b0c61aa19..66f47b889e 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1,4 +1,4 @@
-/* $Id: texstore.c,v 1.15 2001/03/18 14:06:25 gareth Exp $ */
+/* $Id: texstore.c,v 1.16 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -47,8 +47,6 @@
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
-#include "swrast/s_depth.h" /* XXX this is kind of a cheat */
-#include "swrast/s_span.h"
/*
@@ -579,358 +577,6 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
/*
- * Read an RGBA image from the frame buffer.
- * This is used by glCopyTex[Sub]Image[12]D().
- * Input: ctx - the context
- * x, y - lower left corner
- * width, height - size of region to read
- * Return: pointer to block of GL_RGBA, GLchan data.
- */
-static GLchan *
-read_color_image( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- GLint stride, i;
- GLchan *image, *dst;
-
- image = (GLchan *) MALLOC(width * height * 4 * sizeof(GLchan));
- if (!image)
- return NULL;
-
- /* Select buffer to read from */
- (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
-
- RENDER_START(ctx);
-
- dst = image;
- stride = width * 4;
- for (i = 0; i < height; i++) {
- _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y + i,
- (GLchan (*)[4]) dst );
- dst += stride;
- }
-
- RENDER_FINISH(ctx);
-
- /* Read from draw buffer (the default) */
- (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
-
- return image;
-}
-
-
-/*
- * As above, but read data from depth buffer.
- */
-static GLfloat *
-read_depth_image( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- GLint i;
- GLfloat *image, *dst;
-
- image = (GLfloat *) MALLOC(width * height * sizeof(GLfloat));
- if (!image)
- return NULL;
-
- RENDER_START(ctx);
-
- dst = image;
- for (i = 0; i < height; i++) {
- _mesa_read_depth_span_float(ctx, width, x, y + i, dst);
- dst += width;
- }
-
- RENDER_FINISH(ctx);
-
- return image;
-}
-
-
-
-static GLboolean
-is_depth_format(GLenum format)
-{
- switch (format) {
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_COMPONENT16_SGIX:
- case GL_DEPTH_COMPONENT24_SGIX:
- case GL_DEPTH_COMPONENT32_SGIX:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-/*
- * Fallback for Driver.CopyTexImage1D().
- */
-void
-_mesa_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLint border )
-{
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
-
- ASSERT(ctx->Driver.TexImage1D);
-
- if (is_depth_format(internalFormat)) {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, 1);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D");
- return;
- }
-
- /* call glTexImage1D to redefine the texture */
- (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat,
- width, border,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
- else {
- /* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, 1);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D");
- return;
- }
-
- /* call glTexImage1D to redefine the texture */
- (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat,
- width, border,
- GL_RGBA, CHAN_TYPE, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
-}
-
-
-/*
- * Fallback for Driver.CopyTexImage2D().
- */
-void
-_mesa_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border )
-{
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
-
- ASSERT(ctx->Driver.TexImage2D);
-
- if (is_depth_format(internalFormat)) {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, height);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D");
- return;
- }
-
- /* call glTexImage2D to redefine the texture */
- (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat,
- width, height, border,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
- else {
- /* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D");
- return;
- }
-
- /* call glTexImage2D to redefine the texture */
- (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat,
- width, height, border,
- GL_RGBA, CHAN_TYPE, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
-}
-
-
-/*
- * Fallback for Driver.CopyTexSubImage1D().
- */
-void
-_mesa_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
-
- ASSERT(ctx->Driver.TexImage1D);
-
- if (is_depth_format(texImage->IntFormat)) {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, 1);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D");
- return;
- }
-
- /* call glTexImage1D to redefine the texture */
- (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
- else {
- GLchan *image = read_color_image(ctx, x, y, width, 1);
- if (!image) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" );
- return;
- }
-
- /* now call glTexSubImage1D to do the real work */
- (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
- GL_RGBA, CHAN_TYPE, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
-}
-
-
-/*
- * Fallback for Driver.CopyTexSubImage2D().
- */
-void
-_mesa_copy_texsubimage2d( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
-{
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
-
- ASSERT(ctx->Driver.TexImage2D);
-
- if (is_depth_format(texImage->IntFormat)) {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, height);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D");
- return;
- }
-
- /* call glTexImage1D to redefine the texture */
- (*ctx->Driver.TexSubImage2D)(ctx, target, level,
- xoffset, yoffset, width, height,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
- else {
- /* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
- if (!image) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" );
- return;
- }
-
- /* now call glTexSubImage2D to do the real work */
- (*ctx->Driver.TexSubImage2D)(ctx, target, level,
- xoffset, yoffset, width, height,
- GL_RGBA, CHAN_TYPE, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
-}
-
-
-/*
- * Fallback for Driver.CopyTexSubImage3D().
- */
-void
-_mesa_copy_texsubimage3d( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
-{
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- ASSERT(texObj);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- ASSERT(texImage);
-
- ASSERT(ctx->Driver.TexImage3D);
-
- if (is_depth_format(texImage->IntFormat)) {
- /* read depth image from framebuffer */
- GLfloat *image = read_depth_image(ctx, x, y, width, height);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D");
- return;
- }
-
- /* call glTexImage1D to redefine the texture */
- (*ctx->Driver.TexSubImage3D)(ctx, target, level,
- xoffset, yoffset, zoffset, width, height, 1,
- GL_DEPTH_COMPONENT, GL_FLOAT, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
- else {
- /* read RGBA image from framebuffer */
- GLchan *image = read_color_image(ctx, x, y, width, height);
- if (!image) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" );
- return;
- }
-
- /* now call glTexSubImage3D to do the real work */
- (*ctx->Driver.TexSubImage3D)(ctx, target, level,
- xoffset, yoffset, zoffset, width, height, 1,
- GL_RGBA, CHAN_TYPE, image,
- &_mesa_native_packing, texObj, texImage);
- FREE(image);
- }
-}
-
-
-
-/*
* Fallback for Driver.CompressedTexImage1D()
*/
void
diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h
index d23940e4e7..f51c0c0d63 100644
--- a/src/mesa/main/texstore.h
+++ b/src/mesa/main/texstore.h
@@ -1,4 +1,4 @@
-/* $Id: texstore.h,v 1.2 2001/02/19 20:01:42 brianp Exp $ */
+/* $Id: texstore.h,v 1.3 2001/03/19 02:25:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -108,36 +108,6 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
extern void
-_mesa_copy_teximage1d(GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLint border);
-
-extern void
-_mesa_copy_teximage2d(GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border);
-
-
-extern void
-_mesa_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width);
-
-extern void
-_mesa_copy_texsubimage2d(GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height);
-
-extern void
-_mesa_copy_texsubimage3d(GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height);
-
-
-
-extern void
_mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
GLint internalFormat,
GLint width, GLint border,