diff options
author | Brian Paul <[email protected]> | 2004-01-20 02:49:27 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-01-20 02:49:27 +0000 |
commit | d3fd7ba8af15bead2f770d68a893449adeb11397 (patch) | |
tree | 2c92f7cb35f2776d6c461378f93b556fc1ca080d /src/mesa/main/dd.h | |
parent | 988a8862c8379c0312d40353ee4b35537dff59a1 (diff) |
Before calling _mesa_create_context(), initialize a dd_function_table struct
by calling _mesa_init_driver_functions() and then plugging in the driver-
specific functions.
In particular, make sure ctx->Driver.NewTextureObject points to the
appropriate driver function so that _all_ texture objects are augmented
with the driver-specific data.
Put in a bunch of assertions in the texture-related driver functions that
texObj->DriverData is valid. Remove old dead code in near future.
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r-- | src/mesa/main/dd.h | 99 |
1 files changed, 40 insertions, 59 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index e9826abd6d2..60b16db10f2 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -58,6 +58,9 @@ struct gl_pixelstore_attrib; * * Vertex transformation/clipping/lighting is patched into the T&L module. * Rasterization functions are patched into the swrast module. + * + * Note: when new functions are added here, the drivers/common/driverfuncs.c + * file should be updated too!!! */ struct dd_function_table { /** @@ -77,36 +80,6 @@ struct dd_function_table { void (*UpdateState)( GLcontext *ctx, GLuint new_state ); /** - * Clear the color/depth/stencil/accum buffer(s). - * - * \param mask a bitmask of the DD_*_BIT values defined above that indicates - * which buffers need to be cleared. - * \param all if true then clear the whole buffer, else clear only the - * region defined by <tt>(x, y, width, height)</tt>. - * - * This function must obey the glColorMask(), glIndexMask() and glStencilMask() - * settings! - * Software Mesa can do masked clears if the device driver can't. - */ - void (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ); - - /** - * Specify the current buffer for writing. - * - * Called via glDrawBuffer(). Note the driver must organize fallbacks (e.g. - * with swrast) if it cannot implement the requested mode. - */ - void (*DrawBuffer)( GLcontext *ctx, GLenum buffer ); - - /** - * Specifies the current buffer for reading. - * - * Called via glReadBuffer(). - */ - void (*ReadBuffer)( GLcontext *ctx, GLenum buffer ); - - /** * Get the width and height of the named buffer/window. * * Mesa uses this to determine when the driver's window size has changed. @@ -123,6 +96,13 @@ struct dd_function_table { void (*ResizeBuffers)( GLframebuffer *buffer ); /** + * Called whenever an error is generated. + * + * __GLcontextRec::ErrorValue contains the error value. + */ + void (*Error)( GLcontext *ctx ); + + /** * This is called whenever glFinish() is called. */ void (*Finish)( GLcontext *ctx ); @@ -133,11 +113,19 @@ struct dd_function_table { void (*Flush)( GLcontext *ctx ); /** - * Called whenever an error is generated. + * Clear the color/depth/stencil/accum buffer(s). * - * __GLcontextRec::ErrorValue contains the error value. + * \param mask a bitmask of the DD_*_BIT values defined above that indicates + * which buffers need to be cleared. + * \param all if true then clear the whole buffer, else clear only the + * region defined by <tt>(x, y, width, height)</tt>. + * + * This function must obey the glColorMask(), glIndexMask() and + * glStencilMask() settings! + * Software Mesa can do masked clears if the device driver can't. */ - void (*Error)( GLcontext *ctx ); + void (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all, + GLint x, GLint y, GLint width, GLint height ); /** @@ -505,23 +493,17 @@ struct dd_function_table { struct gl_texture_object *tObj ); /** - * Called when a texture object is created. - */ - void (*CreateTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); - - /** * Called to allocate a new texture object. - * - * \note This function pointer should be initialized by drivers \e before - * calling _mesa_initialize_context() since context initialization involves - * allocating some texture objects! + * A new gl_texture_object should be returned. The driver should + * attach to it any device-specific info it needs. */ struct gl_texture_object * (*NewTextureObject)( GLcontext *ctx, GLuint name, GLenum target ); /** * Called when a texture object is about to be deallocated. * - * Driver should free anything attached to the DriverData pointers. + * Driver should delete the gl_texture_object object and anything + * hanging off of it. */ void (*DeleteTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); @@ -627,6 +609,8 @@ struct dd_function_table { void (*DepthMask)(GLcontext *ctx, GLboolean flag); /** Specify mapping of depth values from normalized device coordinates to window coordinates */ void (*DepthRange)(GLcontext *ctx, GLclampd nearval, GLclampd farval); + /** Specify the current buffer for writing */ + void (*DrawBuffer)( GLcontext *ctx, GLenum buffer ); /** Enable or disable server-side gl capabilities */ void (*Enable)(GLcontext *ctx, GLenum cap, GLboolean state); /** Specify fog parameters */ @@ -656,6 +640,8 @@ struct dd_function_table { void (*PolygonOffset)(GLcontext *ctx, GLfloat factor, GLfloat units); /** Set the polygon stippling pattern */ void (*PolygonStipple)(GLcontext *ctx, const GLubyte *mask ); + /* Specifies the current buffer for reading */ + void (*ReadBuffer)( GLcontext *ctx, GLenum buffer ); /** Set rasterization mode */ void (*RenderMode)(GLcontext *ctx, GLenum mode ); /** Define the scissor box */ @@ -708,6 +694,11 @@ struct dd_function_table { void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr); void (*VertexAttribPointer)(GLcontext *ctx, GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); + void (*LockArraysEXT)( GLcontext *ctx, GLint first, GLsizei count ); + void (*UnlockArraysEXT)( GLcontext *ctx ); + /*@}*/ + + /*@}*/ @@ -847,6 +838,12 @@ struct dd_function_table { void (*LightingSpaceChange)( GLcontext *ctx ); /** + * Let the T&L component know when the context becomes current. + */ + void (*MakeCurrent)( GLcontext *ctx, GLframebuffer *drawBuffer, + GLframebuffer *readBuffer ); + + /** * Called by glNewList(). * * Let the T&L component know what is going on with display lists @@ -874,22 +871,6 @@ struct dd_function_table { */ void (*EndCallList)( GLcontext *ctx ); - /** - * Let the T&L component know when the context becomes current. - */ - void (*MakeCurrent)( GLcontext *ctx, GLframebuffer *drawBuffer, - GLframebuffer *readBuffer ); - - /** - * Called by glLockArraysEXT(). - */ - void (*LockArraysEXT)( GLcontext *ctx, GLint first, GLsizei count ); - /** - * Called by UnlockArraysEXT(). - */ - void (*UnlockArraysEXT)( GLcontext *ctx ); - /*@}*/ - }; |