summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi
Commit message (Collapse)AuthorAgeFilesLines
* Add rules and target to build src/mesa/x86-64/glapi_x86-64.S.Ian Romanick2005-08-091-0/+4
|
* s/Disaptch/Dispatch/ (bug 3918)Brian Paul2005-08-081-1/+1
|
* Fix recent problems with display lists and other parts of the code.Ian Romanick2005-08-054-9/+475
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Convert all instances of XTHREADS to USE_XTHREADS. This fixes one ofIan Romanick2005-08-034-6/+6
| | | | | serveral things that are broken when building on a system with X.org 7.0rc0 installed.
* Major rip-up of internal function insertion interface. The oldmesa_6_3_1Ian Romanick2005-07-288-116/+1939
| | | | | | | | | | | | | | | | | | | | | | _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)
* Fix SPARC assembly for 64-bitIan Romanick2005-07-282-21/+22
| | | | | | | | | | | | | | - The test for whether or not we're building for 64-bit is '#ifdef __arch64__'. This appears to be correct on both Linux and Solaris. - The test for Solaris is now '#if defined(SVR4) || defined(__SVR4) || defined(__svr4__)'. GCC 3.4.0 has all three defined on Solaris 9. - Enables assembly language clip routines. - Fixes to make GLSL code build on Solaris. - Update gl_SPARC_asm.py.
* Missed this on the previous commit.Ian Romanick2005-07-181-0/+2498
|
* Wrap every place that accesses a dispatch table with a macro. A new script-Ian Romanick2005-07-183-12/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for assembly (static) dispatch functions on x86-64. ThisIan Romanick2005-07-022-4/+314
| | | | | | is basically patch #2939 from X.org bugzilla #3379. This does *not* fix the bug as it does not dynamically generate stubs at run-time. It just gets things one step closer.
* Move the PYTHON2 and PYTHON_FLAGS assignments to configs/current, andBrian Paul2005-07-011-3/+3
| | | | | include $(TOP)/configs/current in glapi/Makefile so those vars can be easily overridden by any system config, if needed.
* Replace add_newer_entrypoints (src/mesa/main/context.c) withIan Romanick2005-06-302-0/+293
| | | | | | | | | | | | | | | device-specific code. A new Python script (src/mesa/glapi/extension_helper.py) generates a list of all entry-points for all known extensions. Each driver the selects only the extensions that it needs and enables the via either driInitExtensions or driInitSingleExtension. This code has been compile-tested on a drivers, but has only been run-tested on mga and i915 (on i830 hardware). These changes were discussed at length on the mesa3d-dev mailing list. http://marc.theaimsgroup.com/?t=111947074700001&r=1&w=2
* Ignore files generated as part of the build process.Ian Romanick2005-06-241-0/+11
|
* Fix non-x86 specific builds. The changes from glTexImage3DEXT toIan Romanick2005-06-245-109/+117
| | | | | | | | | | | | | | | glTexImage3D that caused me so many problems during the re-development of the API scripts reared its ugly head again. This has been fixed by tracking the parameter string for each entry-point individually. This has the annoying side-effect that the names of the parameters in all aliases of a function must be the same or gl_apitemp.py will generate bad code. :( The changes in src/mesa/glapi/{gl_API.xml,glapitable.h} and src/glx/x11/* are caused by fixing the parameter names in various function aliases that didn't match. Reported by: Eric Anholt, Jacob Jansen
* Fixed the XCB implementation when always_array is true, thanks to Ian ↵Jeremy Kolb2005-06-241-1/+2
| | | | Romanick for pointing it out. Please review.
* Mark GenQueriesARB at 'always_array="true"'. This eliminates the needIan Romanick2005-06-222-2/+2
| | | | to special-case the handling of that function in glX_proto_send.py.
* Fixed a bug where GenQueriesARB was generating the wrong code for XCB and ↵Jeremy Kolb2005-06-221-1/+1
| | | | wouldn't compile. Not sure how that slipped through before but it should work now.
* Mammoth update to the Python code generator scripts that live inIan Romanick2005-06-2119-3448/+3832
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/mesa/glapi. Basically, the scripts that did simple things (like gl_offsets.py) were simple, and the scripts that did more complicated things (like glX_proto_send.py) were getting progressively more and more out of control. So, I re-write the foundation classes on which everything is based. One problem with the existing code is that the division between the GL API database representation and the way the output code is generated was either blury or nonexistant. The new code somewhat follows the Model-View-Controller pattern, minus the Controller. There is a distinct set of classes that model the API data, and there is a distinct set of classes that generate code from that data. One big change is in the class that represents GL functions (was glFunction, is now gl_function). There used to be an instance of this calls for each function and for each alias to that function. For example, there was an instance for PointParameterivSGIS, PointParameterivEXT, PointParameterivARB, and PointParameteriv. In the new code, there is one instance. Each instance has a list of entrypoint names for the function. In the next revision, this will allow a couple useful things. The script will be able to verify that the parameters, return type, and GLX protocol for a function and all it's aliases match. It will also allow aliases to be represented in the XML more compactly. Instead of repeating all the information, an alias can be listed as: <function name="PointParameterivARB" alias="PointParameterivEXT"/> Because the data representation was changed, the order that the alias functions are processed by the scripts also changed. This accounts for at least 2,700 of the ~3,600 lines of diffs in the generated code. Most of the remaining ~900 lines of diffs are the result of bugs *fixed* by the new scripts. The old scripts also generated code with some bugs in it. These bugs were discovered while the new code was being written. These changes were discussed on the mesa3d-dev mailing list back at the end of May: http://marc.theaimsgroup.com/?t=111714569000004&r=1&w=2 Xorg bug: 3197, 3208
* ran "make" after update to glX_proto_send.py.Jeremy Kolb2005-06-201-397/+397
|
* Fixed some issues where XCB replies were being freed and data was not being ↵Jeremy Kolb2005-06-201-4/+2
| | | | copied.
* Fix gl_enums.py so that enums that are listed with the same name inIan Romanick2005-05-261-2/+9
| | | | multiple places don't get generated multiple times.
* Minor correction to EXT_framebuffer_object XML. Fix gl_table.py so that itIan Romanick2005-05-264-7/+7
| | | | generates the correct script name in the generated output.
* Make a couple minor corrections to gl_API.xml. Fixes the name of anIan Romanick2005-05-263-11/+11
| | | | | | | | extension that was missing the GL_ part and uses the core GL type names for vertex buffer object functions instead of the ARB names. Also commits the resulting changes to the generated code. Some how, the #if sequence disappeared in the 1.52 version of glapi_x86.S.
* Fix a couple typeos in enum names.Ian Romanick2005-05-251-2/+2
|
* moved to windows build dirKarl Schultz2005-05-241-124/+0
|
* another GLX / XCB patch (Jeremy Kolb)Brian Paul2005-05-161-4/+4
|
* Patches for XCB (Jeremy Kolb)Brian Paul2005-05-071-5/+60
|
* Stop gcc-4.0 complaining about "type qualifiers ignored on functionKeith Whitwell2005-04-281-1/+1
| | | | return type".
* Stop gcc-4.0 complaining about "type qualifiers ignored on functionKeith Whitwell2005-04-281-1/+1
| | | | return type".
* If the file name passed to parse_GL_API is None or "-", read from standardIan Romanick2005-04-181-1/+7
| | | | input. This allows use of GL API scripts in pipelines.
* Refactor a bunch of common code from the "leaf" scripts to a new functions,Ian Romanick2005-04-1812-141/+29
| | | | parse_GL_API, in gl_XML.py.
* Fill-in function offsets and correct a couple typos.Ian Romanick2005-04-181-25/+28
|
* Convert all Python scripts to use XML namespaces.Ian Romanick2005-04-1812-92/+106
|
* Move the DTD to its own file.Ian Romanick2005-04-182-122/+121
|
* Reverted the last change back to fix bug 3035Ben Crossman2005-04-151-1/+1
|
* Convert 'variable_param' from a CDATA attribute to a NMTOKENS attribute.Ian Romanick2005-04-142-5/+5
| | | | | The main difference is that white-space is used to separate the names instead of comas.
* Refactor the handling of the '(true | false)' enumerated attributes.Ian Romanick2005-04-142-54/+27
|
* Modify the DTD to use NMTOKEN, enumerants, and explicit default valuesIan Romanick2005-04-141-57/+56
| | | | | | wherever possible. Correct a couple mis-uses of the 'counter' attribute when 'count' was intended. Fix some errors in the DTD and in the data with 'doubles_in_order'.
* In GLX_USE_TLS builds, make GET_CURRENT_CONTEXT use the TLS verion of theIan Romanick2005-04-142-3/+28
| | | | | | variable. Without this, GET_CURRENT_CONTEXT would *always* result in a call to _glapi_get_context (because _glapi_Context is a const pointer to NULL in TLS builds).
* A few getenv() that werent using the mesa wrapper versionBen Crossman2005-04-141-1/+1
|
* Add TLS support to libGL and, by virtue of using glthread.h and GL_CALL, allIan Romanick2005-04-134-61/+220
| | | | | | | DRI drivers. A TLS enabled libGL can load a TLS or a non-TLS DRI driver, but a TLS DRI driver requires a TLS enabled libGL. This fixes bug #1822.
* xmllint fixes. Revert 'note_unflushed' changes that were accidetnallyIan Romanick2005-03-171-4/+6
| | | | committed in the last version.
* Enable the generation of server-side __glGetBooleanv_size and relatedIan Romanick2005-03-174-450/+1443
| | | | | | | | | | | | | | | | | | functions. There are two parts to this. First, a size element with a name "Get" is shorthand for having four separate size elements with names "GetIntegerv", "GetDoublev", "GetFloatv", and "GetBooleanv". Additionally, a count of "?" is treated specially. This causes a call to a handcoded function named "__gl<base name>_variable_size". This is *only* needed to support GL_COMPRESSED_TEXTURE_FORMATS. That enum can return a variable number of values depending how many compressed texture formats are supported by the implementation. Fix a problem with glGetProgram{Local,Env}Parameter[df]vARB, glAreProgramsResidentNV, and glGetVertexAttribivNV. These changes only affect code generated for the server-side. The changes to enum.c are caused by enums added for the server-side __glGetBooleanv_size functions.
* Minor refactoring and code tweaking. The only notable chage is thatIan Romanick2005-03-172-13/+9
| | | | | | | | FilterGLAPISpecBase::xref is replaced by FilterGLAPISpecBase::functions_by_name. The notable difference between the two is that ::functions_by_name includes all functions, whether they have an assigned offset or not. This feature will be useful (necessary) when more server-side code is generated.
* Refactored some of the code for PrintGlxReqSize_[ch]. This ensures that theIan Romanick2005-03-171-19/+44
| | | | | same set of functions will be iterated for both the generated C-source file and the generated header file.
* Fix the handling of zero-sized output parameters (i.e., those with typeIan Romanick2005-03-172-2/+6
| | | | | | | | 'GLvoid *'). This fixes the GLX protocol for glGetProgramStringARB. This fixes bugzilla #2747. Remove the 'ignore="true"' from glVertexAttrib4bvARB. This fixes bugzilla #2746.
* Add support for ARB_draw_buffers and ARB_occlusion_query. The GLX protocolIan Romanick2005-03-111-29/+43
| | | | | | | | | | | for these extensions (as well as ARB_vertex_program and ARB_matrix_palette) was just approved by the ARB on 8-Mar-2005. Now the only extension missing for 1.5 support is ARB_vertex_buffer_object. The opcodes for ARB_matrix_palette were also added to gl_API.xml. Since this extension isn't supported by Mesa, no code is generated for it. Some tabs were also converted to spaces in the comment for GetCompressedTexImageARB.
* Actually *use* the count_scale value associated with a parameter.Ian Romanick2005-03-061-3/+11
|
* Fix some errors in the parameter descriptions in serveral vertex / fragmentIan Romanick2005-03-031-11/+11
| | | | program related functions.
* Check for some common function parameter description errors in theIan Romanick2005-03-031-0/+34
| | | | | endElement handler for <function>. This catches the errors as early as possible and makes debugging other code easier.
* Fairly significant changes to enums.c and the way it is generated. enums.cIan Romanick2005-02-262-43/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now contains 3 static tables. The first table is a single, large string of all the enum names. The second table is an array, sorted by enum name, of indexes to the string table and the matching enum value. The extra string table is used to eliminate relocs (and save space) in the compiled file. The third table is an array, sorted by enum value, of indexes into the second table. The [name, enum] table contains all of the enums, but the table sorted by enum-value does not. This table contains one entry per enum value. For enum values that have multiple names (e.g., 0x84C0 has GL_TEXTURE0_ARB and GL_TEXTURE0), only an index to the "best" name will appear in the table. gl_enums.py gives precedence to "core" GL versions of names, followed by ARB versions, followed by EXT versions, followed, finally, by vendor versions (i.e., anything that doesn't fall into one of the previous categories). By filtering the unneeded elements from this table, not only can we guarantee determinism in the generated tables, but we save 364 elements in the table. The optimizations outlined above reduced the size of the stripped enums.o (on x86) from ~80KB to ~53KB. The internal organization of gl_enums.py was also heavily modified. Previously enums were stored in an unsorted list as [value, name] tuples (basically). This list was then sorted, using a user-specified compare function (i.e., VERY slow in most Python implementations) to generate a table sorted by enum value. It was then sorted again, using another user-specified compare function, to generate a table sorted by name. Enums are now stored in a dictionary, called enum_table, with the enum value as the key. Each dictionary element is a list of [name, priority] pairs. The priority is determined as described above. The table sorted by enum value is generated by sorting the keys of enum_table (i.e., very fast). The tables sorted by name are generated by creating a list, called name_table, of [name, enum value] pairs. This table can then be sorted by doing name_table.sort() (i.e., very fast). The result is a fair amount more Python code, but execution time was reduced from ~14 seconds to ~2 seconds.