summaryrefslogtreecommitdiff
path: root/src/mesa/main/vtxfmt.c
AgeCommit message (Collapse)Author
2009-03-03mesa: Add BeginVertices driver callKeith Whitwell
Provides notification to the VBO modules prior to the first immediate call. Pairs with FlushVertices()
2006-04-25Put color index attribute into the 6th attribute slot.Brian Paul
Update a lot of loops, conditionals to use the _TNL_FIRST/LAST_* values instead of specific vertex attributes. Remove the EdgeFlagv function from the GLvertexformat struct.
2006-04-25No longer alias generic vertex attribs with conventional attribs for ↵Brian Paul
GL_ARB_vertex_program.
2005-08-05Fix recent problems with display lists and other parts of the code.Ian Romanick
CALL_by_offset, SET_by_offset, and GET_by_offset all had various problems. The core issue is that parts of the device-independent code in Mesa assumes that all functions have slots in the dispatch table. This is especially true in the display list code. It will merrilly try to set dispatch pointers for glVertexAttrib1fARB even if GL_ARB_vertex_program is not supported. When the GET/SET/CALL macros are invoked, they would read a 0 from the remap table. The problem is that 0 is the dispatch offset for glNewList! One change is that the remap table is now initialized to be full of -1 values. In addtion, all of the *_by_offset marcos misbehave in an obvious way if the specified offset is -1. SET_by_offset will do nothing, GET_by_offset will return NULL, and CALL_by_offset, since it uses GET_by_offset, will segfault. I also had to add GL_EXT_blend_func_separate to the list of default extensions in all_mesa_extensions (src/mesa/drivers/dri/common/utils.c). Even though many drivers do not export this extension, glBlendFunc is internally implemented by calling glBlendFuncSeparate. Without this addition, glBlendFunc stopped working on drivers (such as mga) that do not export GL_EXT_blend_func_separate. There are still a few assertions / crashes in GL_ARB_vertex_program tests, but I don't think that these are related to any of my changes.
2005-07-28Major rip-up of internal function insertion interface. The oldIan Romanick
_glapi_add_entrypoint has been replaced by a new routine called _glapi_add_dispatch. This new routine dynamically assignes dispatch offsets to functions added. This allows IHVs to add support for extension functions that do not have assigned dispatch offsets. It also means that a driver has no idea what offset will be assigned to a function. The vast majority of the changes in this commit account for that. An additional table, driDispatchRemapTable, is added. Functions not in the Linux OpenGL ABI (i.e., anything not in GL 1.2 + ARB_multitexture) has a fixed offset in this new table. The entry in this table specifies the offset in of the function in the real dispatch table. The internal interface was also bumped from version 20050725 to 20050727. This has been tested with various programs in progs/demos on: radeon (Radeon Mobility M6) r128 (Rage 128 Pro) mga (G400)
2005-07-18Wrap every place that accesses a dispatch table with a macro. A new script-Ian Romanick
generated file, called src/mesa/glapi/dispatch.h, is added. This file contains three macros for each API function. It contains a GET, a SET, and a CALL. Each of the macros take a pointer to the context and a pointer to the dispatch table. In several threads on mesa3d-dev we discussed replacing _glapi_add_entrypoint with a new function called _glapi_add_dispatch. For this discussion, the important difference between the two is that the caller of _glapi_add_dispatch does *not* know what the dispatch offset will be at compile time. Because of this callers need to track the dispatch offset returned by _glapi_add_dispatch. http://marc.theaimsgroup.com/?t=111947074700001&r=1&w=2 The downside is that driver code then has to access the dispatch table two different ways. It accesses it using structure tags (e.g., exec->Begin) for functions with fixed offsets and via a remap table (e.g., exec[ remap->NewExtensionFunction ]) for functions without fixed offsets. Yuck! Using the macros allows both types of functions to be accessed identically. If a driver needs to set a pointer for Begin, it does 'SET_Begin(ctx, exec, my_begin_function)'. If it needs to set a pointer for NewExtensionFunction, it does 'SET_NewExtensionFunction(ctx, exec, my_NewExtensionFunction_function)'. Furthermore, if at some point in the future a static offset is assigned for NewExtensionFunction, only the macros need to change (instead of every single place that accesses a table for that function). This code differs slightly from the originally posted patches in that the CALL, GET, and SET marcos no longer take a context pointer as a parameter. Brian Paul had suggested that the remap table could be stored as a global since it would be set at CreateScreen time and would be constant for all contexts. This change reflects that feedback. http://marc.theaimsgroup.com/?t=112087194700001&r=1&w=2
2004-12-08silence warningsAlan Hourihane
2004-11-27Change the dispatch offsets for the VertexAttrib*NV functions so they don'tBrian Paul
alias with the corresponding ARB functions. GL_ARB_vertex_shader (and OpenGL 2.0's) VertexAttrib functions don't alias with conventional vertex attributes, as GL_NV_vertex_program does. So, the ARB and NV version of VertexAttrib need to be distinct.
2004-08-25Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch ↵Brian Paul
1015696)
2004-02-24added some const keywordsBrian Paul
2003-11-24Merge vtx-0-2-branchKeith Whitwell
2003-10-06VertexAttrib4fv wasn't being installed (4f was).Keith Whitwell
2003-06-05Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything.Ian Romanick
2002-10-29updated email addressesBrian Paul
2002-10-24Header file clean-up:Brian Paul
1. Remove all.h and PC_HEADER junk. 2. Rolled mem.c and mem.h into imports.c and imports.h 3. Include imports.h instead of mem.h Restore _mesa_create/initialize_context() to be like they were in 4.0.4 New wrappers for a few std C functions: _mesa_atoi(), _mesa_strstr(), etc.
2002-06-29Applied Matt Sealey's patch to remove/isolate all stdio.h function calls.Brian Paul
Instead of mstdio.[ch], use imports.[ch] to isolate these functions.
2002-04-09bring in changes from dri tcl branchKeith Whitwell
2001-12-15vertex program fixesBrian Paul
2001-12-14vertex program check-inBrian Paul
2001-12-04dispatch changes to minimize hassle with XFree86 libGLBrian Paul
2001-11-18API dispath updatesBrian Paul
2001-03-12Add missing header file include.Gareth Hughes
2001-03-12Consistent copyright info (version number, date) across all files.Gareth Hughes
2001-03-11Minor cleanups.Gareth Hughes
2001-03-11Clean up install, restore for exec vtxfmts.Gareth Hughes
2001-03-11Support for swappable tnl modules.Gareth Hughes
Core Mesa provides a neutral tnl module that verifies the currently module before installing the tnl function pointers in a lazy fashion. It also records which tnl functions have been swapped out, and only restores these when tnl modules themselves are swapped. Fallback strategies: Drivers set a bitmask of dangerous stage changes. When such a state change occurs, the driver should restore the neutral tnl module via _mesa_restore_exec_vtxfmt(). The neutral tnl module will call _mesa_update_state(), followed by ctx->Driver.ValidateTnlModule() if the validation bitmask matches the new state bitmask. The driver should call _tnl_wakeup_exec() if it can no longer handle the current state, which will revert to the default tnl module. In this case, previous vertices should be replayed as required (depending on the current primitive) after the new tnl module is installed. If the driver uses chooser functions for any part of the tnl module, these should generally be reinstalled as part of the fallback to the neutral tnl module. For example, if the lighting state changes, a driver might fall back to the neutral tnl module, verify that the current lighting state can be handled, and use the chooser function to pick the most efficient implementation of the current lighting state. It is up to the drivers to detect and handle fallback cases caused by tnl function calls themselves (such as glTexCoord4f* if the current tnl module can't handle projected textures, for example).
2000-11-24New files...Keith Whitwell