Compare commits

..

118 Commits

Author SHA1 Message Date
Brian Paul
8d3aca655e disable call to via_sse_memcpy() until it's fixed 2005-07-15 23:13:46 +00:00
Brian Paul
1f88391747 need to flush vertices for GL_OCCLUSION_TEST_RESULT_HP query 2005-07-15 23:08:06 +00:00
Brian Paul
d39760d718 Check for null program->Parameters pointer in validate_vertex_program().
GL_NV_vertex_program programs can't directly reference GL state so this
pointer is always NULL.
2005-07-15 22:48:09 +00:00
Brian Paul
df0350b7ec added comments 2005-07-15 22:47:00 +00:00
Brian Paul
b0489d4f82 remove duplicate "User disable" string 2005-07-15 20:17:02 +00:00
Brian Paul
8ec981c469 redo previous check-in, just set ARCH_FLAGS = -m32 2005-07-15 14:31:31 +00:00
Brian Paul
4eb3a0f076 define CFLAGS and CXXflags with -m32 (Egbert Eich) 2005-07-15 13:58:58 +00:00
Brian Paul
4c72778251 replace gcc with $(CC) (Egbert Eich) 2005-07-15 13:55:20 +00:00
Brian Paul
badad72383 eglgears demo (Dane Rushton) 2005-07-14 23:16:41 +00:00
Brian Paul
c62c24c72f added a few more fallbackStrings (Andreas Stenglein) 2005-07-14 23:10:21 +00:00
Keith Whitwell
b127cfeb7a Use the LDEXPF wrapper macro. 2005-07-13 17:49:22 +00:00
Keith Whitwell
3f7cb794ea Add a LDEXPF wrapper macro. 2005-07-13 17:47:40 +00:00
Keith Whitwell
c472dcdac0 Wrap RESTORE_FPU/RND_NEG_FPU declarations with check for USE_SSE_ASM. 2005-07-13 13:50:31 +00:00
Keith Whitwell
ce721143b4 Cache texenv programs to avoid repeated compilation (Ben Skeggs) 2005-07-11 10:10:38 +00:00
Keith Whitwell
9311bc253e Add runtime compiled x87 implementations for most of the remaining
opcodes.  When enabled via environment vars, gears runs and almost
looks right but other apps are still quite buggy.
2005-07-10 11:23:10 +00:00
Keith Whitwell
0cfbd849ec Add lots of x87 fpu instructions. 2005-07-10 11:14:00 +00:00
Ian Romanick
6d5d1f8a41 Restore linux-x86-32 config for Brian. 2005-07-08 21:55:56 +00:00
Ian Romanick
38e2fa385d Put back the glPopMatrix. This test was derived from blendminmax.c.
When extra code was cut from blendminmax.c's Display function, the
glPopMatrix call was also accidentally cut.
2005-07-07 20:43:01 +00:00
Ian Romanick
2550844c6e Correct the comments in the file headers. Oops. 2005-07-07 19:35:30 +00:00
Ian Romanick
259f096ed8 Add regression test for bug #3101. 2005-07-07 19:34:06 +00:00
Roland Scheidegger
f3186e5789 Re-enable r200InitSpanFuncs, which was ifdefed out (probably by mistake?),
so r200SetBuffer, r200SpanRenderStart and r200SpanRenderFinish get called again.
Bugzilla #3705, #3706.
2005-07-06 12:49:46 +00:00
Brian Paul
4cf6718725 The old MESA_PBUFFER_ALLOC() function allocated memory on 512-byte boundaries.
Restore that behavior with new _mesa_alloc_texmemory() function.
Should fix via_sse_memcpy() problem in found with flightgear.
2005-07-05 14:13:42 +00:00
Jon Smirl
78be0b5dad Put default back to the normal DRM path 2005-07-02 21:28:01 +00:00
Ian Romanick
f0ff50d4ed Add support for assembly (static) dispatch functions on x86-64. This
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.
2005-07-02 08:29:57 +00:00
Ian Romanick
1a9cac10b8 linux-x86-32 is unnecessary. The same thing can be acomplished by
'make linux-x86 ARCH_FLAGS=-m32'.
2005-07-02 07:48:41 +00:00
Ian Romanick
9204e87b2e Massive refactor of (most of) the Linux config files. This reduces
the length of each config and brings a lot of much needed uniformity
to them.
2005-07-02 07:38:40 +00:00
Ian Romanick
4f178c6e3a Add $(CFLAGS) to the link commands. This makes 'make linux-x86
ARCH_FLAGS=-m32' work correctly on x86-64 systems.
2005-07-02 07:12:44 +00:00
Ian Romanick
ef2ce9d003 Make linux-x86 more like the other linux configs. 2005-07-02 07:11:54 +00:00
Vladimir Dergachev
c1c684b0f3 Expose the fact that we do not do either selection of feedback buffers - either with software or hardware rendering. 2005-07-02 01:09:10 +00:00
Jerome Glisse
666dcaaf05 Adding RV350_NJ ID. 2005-07-01 21:26:43 +00:00
Jerome Glisse
7b12220256 Adapt extension string to new GL dispatch schema proposed
by Idr. This  patch is based on Idr patch to radeon driver.
Change #if 1 to #if 0 (r300_context.c:l69) for old dispatch
tab.
2005-07-01 21:22:05 +00:00
Karl Schultz
5f79d27b82 Update notes with VC7 info. 2005-07-01 21:08:00 +00:00
Karl Schultz
c136b41b09 Add windows VC7 project files to filelist for tar/zip files. 2005-07-01 20:31:41 +00:00
Karl Schultz
ee850657e6 VC7 project file for building glut lib 2005-07-01 20:25:57 +00:00
Karl Schultz
0cf67634bb VC7 project file for gears demo 2005-07-01 20:25:23 +00:00
Karl Schultz
101d05ad94 VC7 Solution file for building glut and demos 2005-07-01 20:24:49 +00:00
Karl Schultz
c5b6580c6f VC7 project file for osmesa 2005-07-01 20:23:52 +00:00
Karl Schultz
35a11c14ee VC7 project file for core mesa lib 2005-07-01 20:23:23 +00:00
Karl Schultz
ec171b7d02 VC7 project file for glu 2005-07-01 20:22:41 +00:00
Karl Schultz
2de5f6e252 VC7 project file for gdi driver 2005-07-01 20:21:45 +00:00
Karl Schultz
b64d60a2a6 Visual Studio 7 solution file for mesa lib 2005-07-01 20:19:47 +00:00
Karl Schultz
eac7688231 Don't #define __FUNCTION__ on a Microsoft C compiler new enough to have it. 2005-07-01 20:11:46 +00:00
Keith Whitwell
219f3c4489 Set fp->Opcode for OP_TEX_KILL case, fix from Ben Skeggs. 2005-07-01 17:12:29 +00:00
Karl Schultz
06abb854f0 Add new files to project. 2005-07-01 15:59:33 +00:00
Karl Schultz
7fe8696d01 Use frexp on Windows; frexpf is not available. 2005-07-01 15:58:02 +00:00
Karl Schultz
9b56781986 Fix a prototype 2005-07-01 15:56:14 +00:00
Roland Scheidegger
758f334717 convert sis and radeon driver to use spantmp2 instead of spantmp template. Remove old (pre-renderbuffer) span code instead of converting that too. Remove this old code from mach64 (the dead code was not fully converted to spantmp2 previously) too. 2005-07-01 11:28:14 +00:00
Brian Paul
8e8fa63cb4 comment-out some unused code to silence warnings 2005-07-01 02:03:33 +00:00
Brian Paul
559c494fc8 replace some free() calls with _mesa_free() 2005-07-01 02:03:00 +00:00
Brian Paul
03f52fea63 updates to file list for tarballs 2005-07-01 01:55:30 +00:00
Brian Paul
6d3284efd4 fix dependencies 2005-07-01 01:54:38 +00:00
Brian Paul
58a9573b08 added some glGetRenderbufferParameterivEXT calls, printfs, and assertions 2005-07-01 01:34:29 +00:00
Brian Paul
0d34c0158d fix typo in assertions 2005-07-01 01:30:03 +00:00
Brian Paul
f4f1c29597 Move the PYTHON2 and PYTHON_FLAGS assignments to configs/current, and
include $(TOP)/configs/current in glapi/Makefile so those vars can be
easily overridden by any system config, if needed.
2005-07-01 01:27:00 +00:00
Brian Paul
bb5c84fcbc Remove NEW_RENDERBUFFER stuff.
Now, OLD_RENDERBUFFER marks code that needs to eventually be removed when
all the drivers are updated to no longer need the SetBuffer() function.
2005-07-01 01:22:25 +00:00
Brian Paul
446e258940 remove OLD_RENDERBUFFER code 2005-07-01 01:10:36 +00:00
Brian Paul
54fb9226e4 remove OLD_RENDERBUFFER stuff 2005-07-01 01:08:29 +00:00
Brian Paul
30aea49cf6 minor fixes 2005-07-01 01:04:31 +00:00
Roland Scheidegger
cf5b2f7419 remove common macros used in the span functions of most drivers from the individual drivers and put them in common code. It is still possible for a driver to define its own macros if it has special needs. This affects CLIPPIXEL, CLIPSPAN, HW_CLIPLOOP, HW_ENDCLIPLOOP, and for drivers using the spantmp2 template also GET_SRC_PTR and GET_DST_PTR. 2005-07-01 00:08:46 +00:00
Ian Romanick
c212abf99a Replace add_newer_entrypoints (src/mesa/main/context.c) with
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
2005-06-30 16:00:48 +00:00
Brian Paul
1ac8ae446a remove \n from warning message string 2005-06-30 14:24:44 +00:00
Brian Paul
aa70253cbb added newline at end of file 2005-06-30 14:23:40 +00:00
Brian Paul
049e320f46 Add a set of predicate functions for testing matrices instead of directly
testing the flags field.
Move definition of all the MAT_FLAGs into the m_matrix.c file since they're
now private.
2005-06-30 14:22:23 +00:00
Brian Paul
f138b977d0 Redo all the GL_LINEAR interpolation code in terms of LERP macros/functions.
This cleans up and simplifies the arithmetic quite a bit.
2005-06-30 13:42:10 +00:00
Roland Scheidegger
4d652b7855 Fix crashes with pixel readback when using the optimized assembly functions.
Pixel count can be negative (this could be fixed elsewhere), so adapt the
functions to work with such inputs correctly (same behaviour as non-optimized
functions).
Bugzilla #2317
Submitted by idr
2005-06-30 11:42:56 +00:00
Aapo Tahkola
b0d62880e8 -"fix" page flipping
-use depth tiling if tiling is enabled
2005-06-30 04:37:19 +00:00
Brian Paul
0e55891674 fix a few glitches 2005-06-30 02:34:07 +00:00
Brian Paul
ccda2162f6 fix Darwin dynamic lib naming 2005-06-30 02:33:25 +00:00
Brian Paul
b6c0d753fa just code clean-ups and new comments 2005-06-28 03:48:08 +00:00
Vladimir Dergachev
ec17e7941a Uncomment a couple of helper functions.
Fix slipup from CVS update that was commented out and did not show up during compilation.
2005-06-27 18:46:31 +00:00
Vladimir Dergachev
b6c5116171 Rename unchecked state to match DRM driver.
Emit wait idle and pacify r300 before emitting state - this seems to improve stability.
2005-06-27 15:56:14 +00:00
Brian Paul
84f8d7aafb include t_vp_build.h 2005-06-27 00:45:36 +00:00
Brian Paul
39a488ed63 remove unused MEMSET16 macro 2005-06-27 00:39:33 +00:00
Brian Paul
2dbffb30f0 Get rid of the MESA_PBUFFER_ALLOC/FREE() macros.
If that stuff is still needed, lots of other updates are needed anyway.
Also, some misc MALLOC/FREE -> _mesa_malloc/free() changes.
2005-06-27 00:34:17 +00:00
Brian Paul
397088ff5e added _tnl_ProgramCacheDestroy() prototype 2005-06-27 00:30:56 +00:00
Brian Paul
c43f03e38d make create_new_program() static 2005-06-27 00:30:37 +00:00
Eric Anholt
3f9839a52b Fix crashes during rasterization fallback by avoiding _tnl_need_projected_coords
during fallbacks.  In one case, _swsetup_Wakeup had just been called, covering
the need there, and in the other case, we can simply exit the entire
radeonChooseVertexState function, knowing that it will be called again once we
leave the fallback.

Bugzilla #:	2516
Submitted by:	sroland
2005-06-26 21:57:23 +00:00
Eric Anholt
a4eb693b5f Remove the #if 0-ed out old span code. 2005-06-26 21:54:43 +00:00
Eric Anholt
32b898126e Explain the reason for TCL fallback when GL_SPHERE_MAP happens with
RADEON_DEBUG=fall.
2005-06-26 21:53:11 +00:00
Eric Anholt
3b817fde88 Zero out the ENGPACKET allocated on the stack, to avoid sending uninitialized
values to reserved fields on the card, resulting in all-black output and
sometimes hangs.

Submitted by:	Thomas Winischhofer
2005-06-26 21:02:58 +00:00
Brian Paul
845f2a7350 fix for-loop in _mesa_GetDouble to avoid out of bounds memory read 2005-06-26 20:08:23 +00:00
Brian Paul
f8582b6c1f check for null oldBuffer in _mesa_realloc(), cleaned up some comments 2005-06-26 19:57:17 +00:00
Brian Paul
394fd40a53 need parenthesis in realloc call 2005-06-26 19:53:52 +00:00
Ian Romanick
4e1aae6e0e Ignore files generated as part of the build process. 2005-06-24 18:54:57 +00:00
Ian Romanick
5aafea03af Fix non-x86 specific builds. The changes from glTexImage3DEXT to
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
2005-06-24 18:35:31 +00:00
Jeremy Kolb
3fb86eefe8 Fixed the XCB implementation when always_array is true, thanks to Ian Romanick for pointing it out. Please review. 2005-06-24 02:28:02 +00:00
Brian Paul
1c5caba184 Remove the xmesa_set_buffer() function. No longer needed since the
span functions pass in a gl_renderbuffer to indicate which color
buffer should be drawn into.  Optimized line/triangle routines are
smart enough to know which buffer to draw into as well.
The swrast->SetBuffer() routine should eventually be removed from
all drivers.
2005-06-23 15:09:32 +00:00
Ian Romanick
2636e853f6 Mark GenQueriesARB at 'always_array="true"'. This eliminates the need
to special-case the handling of that function in glX_proto_send.py.
2005-06-22 17:11:20 +00:00
Jeremy Kolb
814e5360b0 Fixed a bug where GenQueriesARB was generating the wrong code for XCB and wouldn't compile. Not sure how that slipped through before but it should work now. 2005-06-22 02:36:23 +00:00
Ian Romanick
66a5548fbb Mammoth update to the Python code generator scripts that live in
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
2005-06-21 23:42:43 +00:00
Nicolai Haehnle
f292e13a20 Back out the actual enabling of depth tiling.
Depth tiling breaks software fallbacks and depth buffer reads.
radeon_span.c **must** be updated for anything that is related to tiling.
2005-06-21 17:18:00 +00:00
Nicolai Haehnle
1e4744d2b9 Add PCI ID for R420 JI.
The driver appears to work reliably (i.e. lockup-free) with a card based
on this chip. However, I have not explored whether we could get anything
in terms of 3D performance "for free" just by setting some magic bits
in those registers that are still a mystery to us.
2005-06-21 17:03:29 +00:00
Aapo Tahkola
ebd99043ed r300 driver side of color tiling support. 2005-06-21 15:41:03 +00:00
Nicolai Haehnle
a5fb15cb87 Make sure texture base addresses are used correctly.
They are relative to the card's address space, not relative to fbLocation,
which will be important once we program MC_FB/AGP_LOCATION in the way
they are programmed on older Radeon chips.
2005-06-21 15:21:14 +00:00
Brian Paul
04f863e856 check for NULL swrast->Driver.SetBuffer before calling it 2005-06-21 14:39:43 +00:00
Brian Paul
23606a5704 updated to version 29 2005-06-21 14:30:46 +00:00
Brian Paul
90b40c33e7 include light.h to silence warning 2005-06-21 03:38:10 +00:00
Brian Paul
dc137ddb3f DirectFB updates (Claudio Ciccani) 2005-06-20 18:29:28 +00:00
Jeremy Kolb
a6a3e01b09 ran "make" after update to glX_proto_send.py. 2005-06-20 03:18:16 +00:00
Jeremy Kolb
4378dee78c Fixed some issues where XCB replies were being freed and data was not being copied. 2005-06-20 03:12:35 +00:00
Brian Paul
38332a6d94 Define __FUNCTION__ as a preprocessor symbol in glheader.h if we're not
using GCC or VMS.
2005-06-19 14:57:34 +00:00
Aapo Tahkola
4e7df27466 Fix gloss breakage when using hw tnl. 2005-06-16 11:57:45 +00:00
Aapo Tahkola
3c6f17be32 Use depth tiling. 2005-06-16 11:41:19 +00:00
Aapo Tahkola
af02907b4c Support 16-bit modes. 2005-06-16 10:40:39 +00:00
Aapo Tahkola
463c1d6c57 Fix problems with elts when immediate mode is on. 2005-06-16 10:27:04 +00:00
Aapo Tahkola
0e288e58ef Turn off VBO's. 2005-06-16 10:21:01 +00:00
Aapo Tahkola
3176f8e2e1 lost_context never gets reset. 2005-06-16 10:05:18 +00:00
Jon Smirl
6c2098ffd4 Fix a few compiler warnings 2005-06-16 04:25:45 +00:00
Jon Smirl
f445aaa67a Fix linux-solo build for mga check-in 2005-06-16 03:45:48 +00:00
Ian Romanick
aa26915472 Adds support for MGA DRM version 3.2.
This patch makes use of two of the new ioctls added in MGA DRM version
3.2.  Specifically, the DRM_MGA_SET_FENCE and DRM_MGA_WAIT_FENCE
ioctls are used in mgaWaitForFrameCompletion.  As a result the MMIO
register region and the primary DMA region are *not* mapped (if DRM
3.2 is available).

This patch does *not* make use of the new get_param query was added to
differentiate between G4x0 cards and G550 cards.  That is left to a
future update.

Xorg bug: 3259
Reviewed by: Eric Anholt
2005-06-14 22:51:44 +00:00
Jouk Jansen
fb818a0b11 Committing in .
OpenVMS updates

 Modified Files:
 	Mesa/src/mesa/tnl/descrip.mms Mesa/src/mesa/tnl/t_vp_build.c
 ----------------------------------------------------------------------
2005-06-14 10:27:05 +00:00
Jon Smirl
6b9d9c5039 fbSwapBuffers needs to return a status 2005-06-13 14:21:34 +00:00
Brian Paul
2d218885ec mingw changes (Nolan Leake) 2005-06-13 14:07:14 +00:00
Vladimir Dergachev
902e70875d Fixed typos. 2005-06-12 14:57:02 +00:00
Vladimir Dergachev
b675c48027 Add definition for memory controller latency registers.. 2005-06-10 16:10:50 +00:00
Keith Whitwell
4476978856 remove debug prints 2005-06-10 14:58:32 +00:00
Brian Paul
252d8e78cc be sure we have span texcoords before calling _swrast_texture_span() 2005-06-10 14:37:32 +00:00
Brian Paul
5d6ecf25f8 pass mask array to PutRowRGB() in simple_z_textured_triangle() 2005-06-10 14:36:55 +00:00
200 changed files with 49277 additions and 7231 deletions

View File

@@ -213,7 +213,6 @@ LIB_FILES = \
$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
$(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/glide/*.def \
$(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \
$(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \
@@ -230,10 +229,14 @@ LIB_FILES = \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
$(DIRECTORY)/src/mesa/x86/Makefile \
$(DIRECTORY)/src/mesa/x86/*.[ch] \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/src/glu/Makefile \
$(DIRECTORY)/src/glu/descrip.mms \
$(DIRECTORY)/src/glu/sgi/Makefile \
@@ -272,12 +275,17 @@ LIB_FILES = \
$(DIRECTORY)/vms/analyze_map.com \
$(DIRECTORY)/vms/xlib.opt \
$(DIRECTORY)/vms/xlib_share.opt \
$(DIRECTORY)/windows/VC?/mesa/gdi/gdi.dsp \
$(DIRECTORY)/windows/VC?/mesa/glu/*.txt \
$(DIRECTORY)/windows/VC?/mesa/glu/glu.dsp \
$(DIRECTORY)/windows/VC?/mesa/mesa.dsw \
$(DIRECTORY)/windows/VC?/mesa/mesa/mesa.dsp \
$(DIRECTORY)/windows/VC?/mesa/osmesa/osmesa.dsp
$(DIRECTORY)/windows/VC6/mesa/gdi/gdi.dsp \
$(DIRECTORY)/windows/VC6/mesa/glu/*.txt \
$(DIRECTORY)/windows/VC6/mesa/glu/glu.dsp \
$(DIRECTORY)/windows/VC6/mesa/mesa.dsw \
$(DIRECTORY)/windows/VC6/mesa/mesa/mesa.dsp \
$(DIRECTORY)/windows/VC6/mesa/osmesa/osmesa.dsp \
$(DIRECTORY)/windows/VC7/mesa/gdi/gdi.vcproj \
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
GLUT_FILES = \
@@ -323,9 +331,12 @@ DEMO_FILES = \
$(DIRECTORY)/progs/windml/*.c \
$(DIRECTORY)/progs/windml/*.bmp \
$(DIRECTORY)/progs/ggi/*.c \
$(DIRECTORY)/windows/VC?/progs/demos/*.dsp \
$(DIRECTORY)/windows/VC?/progs/glut/glut.dsp \
$(DIRECTORY)/windows/VC?/progs/progs.dsw
$(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \
$(DIRECTORY)/windows/VC6/progs/progs.dsw \
$(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj \
$(DIRECTORY)/windows/VC7/progs/progs.sln
DRI_FILES = \

View File

@@ -446,7 +446,7 @@ case $ARCH in
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
LIBNAME="${LIBNAME}.dylib"
LIBNAME="lib${LIBNAME}.dylib"
echo "mklib: Making Darwin shared library: " ${LIBNAME}
FLAGS="-dynamiclib -multiply_defined suppress"
if [ $CPLUSPLUS = 1 ] ; then

View File

@@ -18,8 +18,12 @@ GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = $(TOP)/lib/GL.dylib
GLU_LIB_DEPS = $(TOP)/lib/GL.dylib
GLUT_LIB_DEPS =
OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL
GLU_LIB_DEPS = -L$(LIB_DIR) -lGL
GLUT_LIB_DEPS = -L$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = mesa glu glut/glx

View File

@@ -26,6 +26,10 @@ MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
# Python and flags (generally only needed by the developers)
PYTHON2 = python
PYTHON_FLAGS = -t -O -O
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
@@ -61,9 +65,10 @@ PROGRAM_DIRS = demos redbook samples xdemos
# Library/program dependencies
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@@ -6,3 +6,4 @@ include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86-64
ASM_FLAGS = -DUSE_X86_64_ASM
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)

View File

@@ -8,13 +8,26 @@ CONFIG_NAME = linux
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
WARN_FLAGS = -Wall
OPT_FLAGS = -O3 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. Add -m32
# to build properly on 64-bit platforms.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -DPTHREADS -DUSE_XSHM
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(X11_INCLUDES)
GLUT_CFLAGS = -fexceptions
# Library/program dependencies
# Need to have -L/usr/X11R6/lib in these:
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
EXTRA_LIB_PATH = -L/usr/X11R6/lib

View File

@@ -1,20 +1,8 @@
# Configuration for debugging on Linux
include $(TOP)/configs/default
include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG
CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
GLUT_CFLAGS = -fexceptions
# Need to have -L/usr/X11R6/lib in these:
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11
OPT_FLAGS = -g
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK

View File

@@ -39,8 +39,6 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
# Directories

View File

@@ -8,5 +8,9 @@ CONFIG_NAME = linux-dri-x86
# Unnecessary on x86, generally.
PIC_FLAGS =
# Add -m32 to CFLAGS:
ARCH_FLAGS = -m32
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
ASM_SOURCES = $(X86_SOURCES)

View File

@@ -7,6 +7,9 @@ CONFIG_NAME = linux-dri-x86-64
ARCH_FLAGS = -m64
ASM_FLAGS = -DUSE_X86_64_ASM
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
LIB_DIR = $(TOP)/lib64
# Library/program dependencies

View File

@@ -1,18 +1,9 @@
# Configuration for Linux on PPC
include $(TOP)/configs/default
include $(TOP)/configs/linux
CONFIG_NAME = linux-ppc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE
GLUT_CFLAGS = -fexceptions
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
OPT_FLAGS = -O3 -mcpu=603 -fsigned-char -funroll-loops
# FIXME: Use of PowerPC assembly should be enabled here.

View File

@@ -1,15 +1,9 @@
# Configuration for Linux on PPC, static libs
include $(TOP)/configs/default
include $(TOP)/configs/linux-ppc
CONFIG_NAME = linux-ppc-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
# Library names (actual file names)
@@ -18,9 +12,3 @@ GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm

View File

@@ -1,17 +1,9 @@
# Configuration for generic Linux, making static libs
include $(TOP)/configs/default
include $(TOP)/configs/linux
CONFIG_NAME = linux-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
# Library names (actual file names)
@@ -27,4 +19,3 @@ OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++

View File

@@ -1,24 +1,8 @@
# Configuration for Linux with x86 optimizations
include $(TOP)/configs/default
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
GLUT_CFLAGS = -fexceptions
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@@ -4,10 +4,4 @@ include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-32
# Other than -m32, these are the same as in linux-x86, which we included above.
CFLAGS = -m32 -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -m32 -Wall -O3 fPIC -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
ARCH_FLAGS += -m32

View File

@@ -1,28 +1,13 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/default
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86-64
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -m64 -Wall -O3 -std=c99 -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DUSE_X86_64_ASM
CXXFLAGS = -m64 -Wall -O3 -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
GLUT_CFLAGS = -fexceptions
ASM_SOURCES = $(X86-64_SOURCES)
ARCH_FLAGS = -m64
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
ASM_FLAGS = -DUSE_X86_64_ASM
LIB_DIR = $(TOP)/lib64
# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib64 -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
EXTRA_LIB_PATH = -L/usr/X11R6/lib64

View File

@@ -1,28 +1,7 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/default
include $(TOP)/configs/linux-x86-64
CONFIG_NAME = linux-x86-64-debug
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -g -m64 -Wall -O3 -std=c99 -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DUSE_X86_64_ASM -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
CXXFLAGS = -g -m64 -Wall -O3 -ansi -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
GLUT_CFLAGS = -fexceptions
ASM_SOURCES = $(X86-64_SOURCES)
LIB_DIR = $(TOP)/lib64
# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib64 -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK

View File

@@ -1,22 +1,11 @@
# Configuration for Linux for 64-bit X86 (Opteron), static libs
include $(TOP)/configs/default
include $(TOP)/configs/linux-x86-64
CONFIG_NAME = linux-x86-64-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -m64 -Wall -O3 -ansi -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -m64 -Wall -O3 -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
@@ -24,17 +13,9 @@ GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
#ASM_SOURCES = $(X86_SOURCES)
LIB_DIR = $(TOP)/lib64
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++

View File

@@ -5,6 +5,5 @@ include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-debug
CFLAGS = -Wall -g -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -Wall -g -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
OPT_FLAGS = -g
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK

View File

@@ -1,22 +1,11 @@
# Configuration for Linux with x86 optimizations, static libs
include $(TOP)/configs/default
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -Wall -O3 -ansi -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -Wall -O3 -ansi -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
@@ -24,14 +13,9 @@ GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++

View File

@@ -1,6 +1,6 @@
File: docs/README.WIN32
Last updated: Jun 02, 2005 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: Jul 01, 2005 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
----- -----
@@ -17,7 +17,10 @@ the top-level "windows" directory. For example, Visual Studio 6 files
are in windows/VC6. If a directory does not exist for your version of
Visual Studio, you can try importing the project files from an earlier
version of Visual Studio. At this time, project files exist for
Version 6.
Version 6 and Version 7. The code has been built with a beta version
of Version 8 and it runs on 64-bit Windows. If you want to try this,
start by importing the VC7 files and create the 64-bit targets in the
configuration manager.
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
@@ -43,8 +46,12 @@ be useful in figuring out any problems, or report them to me.
To build Mesa with the GDI driver, build the mesa, gdi, and glu
projects in the Visual Studio workspace found at
windows/VC?/mesa/mesa.dsw. The osmesa DLL can also be built with the
osmesa project.
windows/VC6/mesa/mesa.dsw
or
windows/VC7/mesa/mesa.sln
The osmesa DLL can also be built with the osmesa project.
The build system creates a lib top-level directory and copies
resulting LIB and DLL files to this lib directory. The files are:
@@ -53,13 +60,19 @@ resulting LIB and DLL files to this lib directory. The files are:
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
If the MesaDemos ZIP file was extracted, the DLL files are also copied
to the demos directory.
to the demos directory. This facilitates running the demos as described
below.
GLUT and Demos
---- --- -----
A Visual Studio workspace can be found at windows/VC?/progs/progs.dsw.
A Visual Studio workspace can be found at
windows/VC6/progs/progs.dsw
or
windows/VC7/progs/progs.sln
It can be used to build GLUT and a few demos. The GLUT lib and DLL
are copied to the top-level lib directory, along with the Mesa libs.
@@ -70,6 +83,8 @@ rely on data files found there. Also, the Mesa lib DLL's were copied
there by the Mesa lib build process. Therefore, you should be able to
simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
Build System Notes
@@ -87,19 +102,7 @@ GLU library.
VC7
---
Some users have reported problems building glu with VC7 after
importing and converting the VC6 project files. The problem is caused
by a custom build step that was put in place to work around a problem
with VC6 not recognizing .cc files as C++ source files. It appears
that VC7 can be configured to recognize .cc files as C++ files and so
it compiles these glu files with the default settings, and does not
use settings that are required to compile the files correctly. The
easiest way to solve the problem is to remove the .cc files from the
glu project. This does not delete the files, but removes them from
the project so that VS does not try to compile them at all. This
allows the custom build step to compile the files with the proper
settings. Another approach is to remove the custom build step and fix
the project up to compile the files normally.
The above-mentioned .cc problem does not exist in this version.
General

View File

@@ -62,12 +62,16 @@ Note that textures, programs and buffers can be shared by several rendering
contexts so they can't be deleted until they're unbound in _all_ contexts.
GL_EXT_framebuffer_object changes
---------------------------------
XXX describe all the changes made for this extension.
To Do before release
--------------------
Fix dinoshade bug
To Do (someday) items
---------------------
Switch to freeglut
Increase MAX_DRAWBUFFERS
driver hooks for BeginQuery/EndQuery
@@ -77,7 +81,7 @@ To Do before release
Miscellaneous
-------------
The main/get.c file is now generated with a Python script.
The main/get.c file is now generated with a Python script (get_gen.py).
@@ -97,4 +101,4 @@ D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.3,v 3.9 2005/05/04 20:11:35 brianp Exp $
$Id: RELNOTES-6.3,v 3.10 2005/07/01 01:04:31 brianp Exp $

View File

@@ -4,8 +4,6 @@
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<body bgcolor="#eeeeee">
<!--Override a few values from the style sheet: -->
<style>
<!--

View File

@@ -82,7 +82,7 @@ my work hours at the Space Science and Engineering Center at the University
of Wisconsin in Madison. My supervisor, Bill Hibbard, lets me do this because
Mesa is now being using for the <a href="http://www.ssec.wisc.edu/%7Ebillh/vis.html" target="_parent">Vis5D</a> project.
</p><p>
October 1996: Mesa 2.0 is released. It implementes the OpenGL 1.1 specification.
October 1996: Mesa 2.0 is released. It implements the OpenGL 1.1 specification.
</p>
<p>
@@ -134,8 +134,8 @@ GL_ARB_fragment_program extensions.
<p>
Ongoing: Mesa is used as the core of many hardware OpenGL drivers for XFree86
within the
Ongoing: Mesa is used as the core of many hardware OpenGL drivers for
the XFree86 X.org X servers within the
<A href="http://dri.sourceforge.net/" target="_parent">DRI project</A>.
I continue to enhance Mesa with new extensions and features.
</p>

View File

@@ -1,7 +1,6 @@
/* Mesa CSS */
body {
background-color: #ffffff;
/*background-color: #55bbff;*/
font: 14px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;
color: black;
link: #111188;

View File

@@ -6,6 +6,8 @@
<BODY>
<body bgcolor="#eeeeee">
<H1>News</H1>
@@ -960,6 +962,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.19 2005/05/05 14:18:31 brianp Exp $
$Id: news.html,v 3.20 2005/07/01 01:04:31 brianp Exp $
</body>
</html>
</html>

View File

@@ -52,9 +52,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated 2005/05/31 */
/* glext.h last updated 2005/06/20 */
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
#define GL_GLEXT_VERSION 28
#define GL_GLEXT_VERSION 29
#ifndef GL_VERSION_1_2
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
@@ -3023,7 +3023,6 @@ extern "C" {
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
#define GL_STENCIL_INDEX_EXT 0x8D45
#define GL_STENCIL_INDEX1_EXT 0x8D46
#define GL_STENCIL_INDEX4_EXT 0x8D47
#define GL_STENCIL_INDEX8_EXT 0x8D48

View File

@@ -12,7 +12,8 @@ PROGRAMS = \
demo1 \
demo2 \
demo3 \
eglinfo
eglinfo \
eglgears
.c.o:
@@ -51,6 +52,12 @@ eglinfo.o: eglinfo.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
eglgears: eglgears.o $(LIB_DIR)/libEGL.so
$(CC) eglgears.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
eglgears.o: eglgears.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c
clean:
rm -f *.o *~

View File

@@ -92,7 +92,6 @@ main(int argc, char *argv[])
EGLContext ctx;
EGLSurface pbuffer;
EGLConfig configs[10];
EGLint numConfigs, i;
EGLBoolean b;
const EGLint pbufAttribs[] = {
EGL_WIDTH, 500,

View File

@@ -56,6 +56,7 @@ static void Reshape(int width, int height)
windH = (GLint)height;
}
#if 0
static void RotateColorMask(void)
{
static GLint rotation = 0;
@@ -80,6 +81,7 @@ static void RotateColorMask(void)
break;
}
}
#endif
static void Viewport(GLint row, GLint column)
{

446
progs/egl/eglgears.c Normal file
View File

@@ -0,0 +1,446 @@
/*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* This is a port of the infamous "glxgears" demo to straight EGL
* Port by Dane Rushton 10 July 2005
*
* No command line options.
* Program runs for 5 seconds then exits, outputing framerate to console
*/
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/gl.h>
#include <GLES/egl.h>
#include <assert.h>
#define BENCHMARK
#ifdef BENCHMARK
/* XXX this probably isn't very portable */
#include <sys/time.h>
#include <unistd.h>
/* return current time (in seconds) */
static double
current_time(void)
{
struct timeval tv;
#ifdef __VMS
(void) gettimeofday(&tv, NULL );
#else
struct timezone tz;
(void) gettimeofday(&tv, &tz);
#endif
return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
}
#else /*BENCHMARK*/
/* dummy */
static double
current_time(void)
{
/* update this function for other platforms! */
static double t = 0.0;
static int warn = 1;
if (warn) {
fprintf(stderr, "Warning: current_time() not implemented!!\n");
warn = 0;
}
return t += 1.0;
}
#endif /*BENCHMARK*/
#ifndef M_PI
#define M_PI 3.14159265
#endif
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static GLfloat eyesep = 5.0; /* Eye separation. */
static GLfloat fix_point = 40.0; /* Fixation point distance. */
static GLfloat left, right, asp; /* Stereo frustum params. */
/*
*
* Draw a gear wheel. You'll probably want to call this function when
* building a display list since we do a lot of trig here.
*
* Input: inner_radius - radius of hole at center
* outer_radius - radius at center of teeth
* width - width of gear
* teeth - number of teeth
* tooth_depth - depth of tooth
*/
static void
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
GLint teeth, GLfloat tooth_depth)
{
GLint i;
GLfloat r0, r1, r2;
GLfloat angle, da;
GLfloat u, v, len;
r0 = inner_radius;
r1 = outer_radius - tooth_depth / 2.0;
r2 = outer_radius + tooth_depth / 2.0;
da = 2.0 * M_PI / teeth / 4.0;
glShadeModel(GL_FLAT);
glNormal3f(0.0, 0.0, 1.0);
/* draw front face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
if (i < teeth) {
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
}
}
glEnd();
/* draw front sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
}
glEnd();
glNormal3f(0.0, 0.0, -1.0);
/* draw back face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
if (i < teeth) {
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
}
}
glEnd();
/* draw back sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
}
glEnd();
/* draw outward faces of teeth */
glBegin(GL_QUAD_STRIP);
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
u = r2 * cos(angle + da) - r1 * cos(angle);
v = r2 * sin(angle + da) - r1 * sin(angle);
len = sqrt(u * u + v * v);
u /= len;
v /= len;
glNormal3f(v, -u, 0.0);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-width * 0.5);
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
glNormal3f(v, -u, 0.0);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
}
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
glEnd();
glShadeModel(GL_SMOOTH);
/* draw inside radius cylinder */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glNormal3f(-cos(angle), -sin(angle), 0.0);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
}
glEnd();
}
static void
draw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(view_rotx, 1.0, 0.0, 0.0);
glRotatef(view_roty, 0.0, 1.0, 0.0);
glRotatef(view_rotz, 0.0, 0.0, 1.0);
glPushMatrix();
glTranslatef(-3.0, -2.0, 0.0);
glRotatef(angle, 0.0, 0.0, 1.0);
glCallList(gear1);
glPopMatrix();
glPushMatrix();
glTranslatef(3.1, -2.0, 0.0);
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
glCallList(gear2);
glPopMatrix();
glPushMatrix();
glTranslatef(-3.1, 4.2, 0.0);
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
glCallList(gear3);
glPopMatrix();
glPopMatrix();
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
glViewport(0, 0, (GLint) width, (GLint) height);
GLfloat h = (GLfloat) height / (GLfloat) width;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
}
static void
init(void)
{
static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, pos);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
/* make the gears */
gear1 = glGenLists(1);
glNewList(gear1, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
gear(1.0, 4.0, 1.0, 20, 0.7);
glEndList();
gear2 = glGenLists(1);
glNewList(gear2, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
gear(0.5, 2.0, 2.0, 10, 0.7);
glEndList();
gear3 = glGenLists(1);
glNewList(gear3, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
gear(1.3, 2.0, 0.5, 10, 0.7);
glEndList();
glEnable(GL_NORMALIZE);
}
static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
{
double st = current_time();
double ct = st;
int frames = 0;
while (ct - st < ttr)
{
double tt = current_time();
double dt = tt - ct;
ct = tt;
/* advance rotation for next frame */
angle += 70.0 * dt; /* 70 degrees per second */
if (angle > 3600.0)
angle -= 3600.0;
draw();
// DBR : Swap the Buffers
eglSwapBuffers(dpy, surf);
frames++;
}
GLfloat seconds = ct - st;
GLfloat fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
}
int
main(int argc, char *argv[])
{
int maj, min;
EGLContext ctx;
EGLSurface screen_surf;
EGLConfig configs[10];
EGLint numConfigs, i;
EGLBoolean b;
const EGLint screenAttribs[] = {
EGL_WIDTH, 1024,
EGL_HEIGHT, 768,
EGL_NONE
};
EGLModeMESA mode;
EGLScreenMESA screen;
EGLint count;
GLboolean printInfo = GL_FALSE;
for (i = 1; i < argc; i++)
{
if (strcmp(argv[i], "-info") == 0)
{
printInfo = GL_TRUE;
}
else
printf("Warning: unknown parameter: %s\n", argv[i]);
}
// DBR : Create EGL context/surface etc
EGLDisplay d = eglGetDisplay("!fb_dri");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
printf("demo: eglInitialize failed\n");
exit(1);
}
printf("EGL version = %d.%d\n", maj, min);
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
eglGetConfigs(d, configs, 10, &numConfigs);
eglGetScreensMESA(d, &screen, 1, &count);
eglGetModesMESA(d, screen, &mode, 1, &count);
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
if (ctx == EGL_NO_CONTEXT) {
printf("failed to create context\n");
return 0;
}
screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
if (screen_surf == EGL_NO_SURFACE) {
printf("failed to create screen surface\n");
return 0;
}
eglShowSurfaceMESA(d, screen, screen_surf, mode);
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
if (!b) {
printf("make current failed\n");
return 0;
}
// DBR
if (printInfo)
{
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
init(); // Initialise the GL visual
reshape(1024,768);
// DBR : Run the simulation
run_gears(d, screen_surf, 5.0);
// DBR : Destroy EGL context/surface etc
eglDestroySurface(d, screen_surf);
eglDestroyContext(d, ctx);
eglTerminate(d);
// DBR
return 0;
}

2
progs/tests/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
.cvsignore
getproclist.h

View File

@@ -22,6 +22,7 @@ SOURCES = antialias.c \
blendminmax.c \
blendsquare.c \
bufferobj.c \
bug_3101.c \
crossbar.c \
cva.c \
dinoshade.c \

128
progs/tests/bug_3101.c Normal file
View File

@@ -0,0 +1,128 @@
/*
* (C) Copyright IBM Corporation 2005
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file bug_3101.c
*
* Simple regression test for bug #3101. Attempt to draw a single square.
* After emiting the first vertex, call \c glEdgeFlag to change the vertex
* format. If the bug still exists, this will cause a segfault.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
static int Width = 400;
static int Height = 200;
static const GLfloat Near = 5.0, Far = 25.0;
static void Display( void )
{
glClearColor(0.2, 0.2, 0.8, 0);
glClear( GL_COLOR_BUFFER_BIT );
glPushMatrix();
/* This is the "reference" square.
*/
glTranslatef(-4.5, 0, 0);
glBlendEquation( GL_FUNC_ADD );
glBlendFunc( GL_ONE, GL_ZERO );
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glEdgeFlag(GL_TRUE);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glPopMatrix();
glutSwapBuffers();
}
static void Reshape( int width, int height )
{
GLfloat ar = (float) width / (float) height;
Width = width;
Height = height;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -15.0 );
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void Init( void )
{
const char * const ver_string = (const char * const)
glGetString( GL_VERSION );
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", ver_string);
printf("\nThis program should draw a single square, but not crash.\n");
printf("This is a regression test for bug #3101.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n");
glEnable( GL_BLEND );
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3101 Test" );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
Init();
glutMainLoop();
return 0;
}

View File

@@ -145,6 +145,19 @@ Init( void )
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
{
GLint r, g, b, a;
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_RED_SIZE_EXT, &r);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_GREEN_SIZE_EXT, &g);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_BLUE_SIZE_EXT, &b);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_ALPHA_SIZE_EXT, &a);
printf("renderbuffer RGBA sizes = %d %d %d %d\n", r, g, b, a);
}
CheckError(__LINE__);
/* restore to default */

View File

@@ -223,6 +223,10 @@ Init(void)
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
TexWidth, TexHeight);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
printf("Depth renderbuffer size = %d bits\n", i);
assert(i > 0);
/* make stencil renderbuffer */
glGenRenderbuffersEXT(1, &StencilRB);
@@ -231,6 +235,10 @@ Init(void)
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX,
TexWidth, TexHeight);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_STENCIL_SIZE_EXT, &i);
printf("Stencil renderbuffer size = %d bits\n", i);
assert(i > 0);
/* attach DepthRB to MyFB */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,

View File

@@ -1,13 +1,9 @@
#!/usr/bin/env python
# $Id: getprocaddress.py,v 1.6 2004/11/27 19:57:46 brianp Exp $
# $Id: getprocaddress.py,v 1.7 2005/06/21 23:42:43 idr Exp $
# Helper for the getprocaddress.c test.
from xml.sax import saxutils
from xml.sax import make_parser
from xml.sax.handler import feature_namespaces
import sys, getopt, re
sys.path.append("../../src/mesa/glapi/" )
import gl_XML
@@ -30,16 +26,19 @@ def FindTestFunctions():
return functions
class PrintExports(gl_XML.FilterGLAPISpecBase):
name = "gl_exports.py (from Mesa)"
class PrintExports(gl_XML.gl_print_base):
def __init__(self):
gl_XML.FilterGLAPISpecBase.__init__(self)
gl_XML.gl_print_base.__init__(self)
self.name = "getprocaddress.py (from Mesa)"
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
self.tests = FindTestFunctions()
self.prevCategory = ""
return
def printRealHeader(self):
print """
@@ -50,22 +49,28 @@ struct name_test_pair {
static struct name_test_pair functions[] = {"""
def printRealFooter(self):
print"""
{ NULL, NULL }
};
"""
def printBody(self, api):
prev_category = None
def printFunction(self, f):
if f.category != self.prevCategory:
print ' { "-%s", NULL},' % f.category
self.prevCategory = f.category
for f in api.functionIterateByOffset():
[category, num] = api.get_category_for_name( f.name )
if category != prev_category:
print ' { "-%s", NULL},' % category
prev_category = category
if f.name in self.tests:
test = "test_%s" % f.name
else:
test = "NULL"
print ' { "gl%s", %s },' % (f.name, test)
for name in f.entry_points:
if name in self.tests:
test = "test_%s" % name
break
print ' { "gl%s", %s },' % (f.name, test)
print ''
print ' { NULL, NULL }'
print '};'
print ''
return
@@ -81,15 +86,8 @@ if __name__ == '__main__':
if arg == "-f":
file_name = val
dh = PrintExports()
printer = PrintExports()
parser = make_parser()
parser.setFeature(feature_namespaces, 0)
parser.setContentHandler(dh)
api = gl_XML.parse_GL_API( file_name, gl_XML.gl_item_factory() )
f = open(file_name)
parser.parse(f)
dh.printHeader()
dh.printFunctions()
dh.printFooter()
printer.Print( api )

View File

@@ -51,10 +51,10 @@ clean:
# special cases
pbinfo: pbinfo.o pbutil.o
$(CC) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@
$(CC) $(CFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@
pbdemo: pbdemo.o pbutil.o
$(CC) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@
$(CC) $(CFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@
pbinfo.o: pbinfo.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbinfo.c
@@ -66,13 +66,13 @@ pbutil.o: pbutil.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbutil.c
glxgears_fbconfig: glxgears_fbconfig.o pbutil.o
$(CC) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@
$(CC) $(CFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@
glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.c
$(CC) $(CFLAGS) -c -I. -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.c
xrotfontdemo: xrotfontdemo.o xuserotfont.o
$(CC) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@
$(CC) $(CFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@
xuserotfont.o: xuserotfont.c xuserotfont.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) xuserotfont.c

View File

@@ -49,6 +49,7 @@ C_SOURCES = \
XF86dri.c \
X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S
X86-64_SOURCES = $(TOP)/src/mesa/x86-64/glapi_x86-64.S
# ASM_SOURCES = $(X86_SOURCES)

File diff suppressed because it is too large Load Diff

View File

@@ -543,10 +543,10 @@ extern HIDDEN void __indirect_glSecondaryColor3usEXT(GLushort red, GLushort gree
extern HIDDEN void __indirect_glSecondaryColor3usvEXT(const GLushort * v);
extern HIDDEN void __indirect_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
extern HIDDEN GLboolean __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences);
extern HIDDEN void __indirect_glBindProgramNV(GLenum target, GLuint id);
extern HIDDEN void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * ids);
extern HIDDEN void __indirect_glBindProgramNV(GLenum target, GLuint program);
extern HIDDEN void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs);
extern HIDDEN void __indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params);
extern HIDDEN void __indirect_glGenProgramsNV(GLsizei n, GLuint * ids);
extern HIDDEN void __indirect_glGenProgramsNV(GLsizei n, GLuint * programs);
extern HIDDEN void __indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params);
extern HIDDEN void __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params);
extern HIDDEN void __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params);
@@ -555,8 +555,8 @@ extern HIDDEN void __indirect_glGetTrackMatrixivNV(GLenum target, GLuint address
extern HIDDEN void __indirect_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params);
extern HIDDEN void __indirect_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params);
extern HIDDEN void __indirect_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params);
extern HIDDEN void __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid ** pointer);
extern HIDDEN GLboolean __indirect_glIsProgramNV(GLuint id);
extern HIDDEN void __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid ** params);
extern HIDDEN GLboolean __indirect_glIsProgramNV(GLuint program);
extern HIDDEN void __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program);
extern HIDDEN void __indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
extern HIDDEN void __indirect_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * params);
@@ -606,7 +606,7 @@ extern HIDDEN void __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, cons
extern HIDDEN void __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v);
extern HIDDEN void __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v);
extern HIDDEN void __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v);
extern HIDDEN void __indirect_glPointParameteriNV(GLenum pname, GLint params);
extern HIDDEN void __indirect_glPointParameteriNV(GLenum pname, GLint param);
extern HIDDEN void __indirect_glPointParameterivNV(GLenum pname, const GLint * params);
extern HIDDEN void __indirect_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount);
extern HIDDEN void __indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount);
@@ -682,6 +682,23 @@ extern HIDDEN void __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshor
extern HIDDEN void __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v);
extern HIDDEN void __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
extern HIDDEN void __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v);
extern HIDDEN GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer);
extern HIDDEN void __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
extern HIDDEN void __indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers);
extern HIDDEN void __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers);
extern HIDDEN void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
extern HIDDEN void __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params);
extern HIDDEN GLboolean __indirect_glIsFramebufferEXT(GLuint framebuffer);
extern HIDDEN void __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer);
extern HIDDEN void __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers);
extern HIDDEN void __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers);
extern HIDDEN GLenum __indirect_glCheckFramebufferStatusEXT(GLenum target);
extern HIDDEN void __indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
extern HIDDEN void __indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
extern HIDDEN void __indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
extern HIDDEN void __indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
extern HIDDEN void __indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params);
extern HIDDEN void __indirect_glGenerateMipmapEXT(GLenum target);
# undef HIDDEN
# undef FASTCALL

View File

@@ -72,7 +72,7 @@ __GLapi * __glXNewIndirectAPI( void )
/* now, initialize the entries we understand */
/* GL_VERSION_1_0 */
/* 1.0 */
glAPI->NewList = __indirect_glNewList;
glAPI->EndList = __indirect_glEndList;
@@ -381,7 +381,7 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->Translatef = __indirect_glTranslatef;
glAPI->Viewport = __indirect_glViewport;
/* GL_VERSION_1_1 */
/* 1.1 */
glAPI->ArrayElement = __indirect_glArrayElement;
glAPI->BindTexture = __indirect_glBindTexture;
@@ -414,7 +414,7 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->PopClientAttrib = __indirect_glPopClientAttrib;
glAPI->PushClientAttrib = __indirect_glPushClientAttrib;
/* GL_VERSION_1_2 */
/* 1.2 */
glAPI->BlendColor = __indirect_glBlendColor;
glAPI->BlendEquation = __indirect_glBlendEquation;
@@ -455,18 +455,8 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->TexSubImage3D = __indirect_glTexSubImage3D;
glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D;
/* GL_ARB_multitexture */
/* 1. GL_ARB_multitexture */
glAPI->ActiveTextureARB = __indirect_glActiveTextureARB;
glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB;
glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB;
glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB;
glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB;
glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB;
glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB;
glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB;
glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB;
glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB;
glAPI->MultiTexCoord2dARB = __indirect_glMultiTexCoord2dARB;
glAPI->MultiTexCoord2dvARB = __indirect_glMultiTexCoord2dvARB;
glAPI->MultiTexCoord2fARB = __indirect_glMultiTexCoord2fARB;
@@ -491,79 +481,29 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->MultiTexCoord4ivARB = __indirect_glMultiTexCoord4ivARB;
glAPI->MultiTexCoord4sARB = __indirect_glMultiTexCoord4sARB;
glAPI->MultiTexCoord4svARB = __indirect_glMultiTexCoord4svARB;
glAPI->ActiveTextureARB = __indirect_glActiveTextureARB;
glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB;
glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB;
glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB;
glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB;
glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB;
glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB;
glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB;
glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB;
glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB;
/* GL_ARB_transpose_matrix */
/* 3. GL_ARB_transpose_matrix */
glAPI->LoadTransposeMatrixfARB = __indirect_glLoadTransposeMatrixfARB;
glAPI->LoadTransposeMatrixdARB = __indirect_glLoadTransposeMatrixdARB;
glAPI->MultTransposeMatrixfARB = __indirect_glMultTransposeMatrixfARB;
glAPI->MultTransposeMatrixdARB = __indirect_glMultTransposeMatrixdARB;
/* GL_ARB_multisample */
/* 5. GL_ARB_multisample */
glAPI->SampleCoverageARB = __indirect_glSampleCoverageARB;
/* GL_ARB_draw_buffers */
glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB;
/* GL_EXT_texture_object */
glAPI->AreTexturesResidentEXT = __indirect_glAreTexturesResidentEXT;
glAPI->GenTexturesEXT = __indirect_glGenTexturesEXT;
glAPI->IsTextureEXT = __indirect_glIsTextureEXT;
/* GL_SGIS_multisample */
glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS;
glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS;
/* GL_EXT_vertex_array */
glAPI->ColorPointerEXT = __indirect_glColorPointerEXT;
glAPI->EdgeFlagPointerEXT = __indirect_glEdgeFlagPointerEXT;
glAPI->IndexPointerEXT = __indirect_glIndexPointerEXT;
glAPI->NormalPointerEXT = __indirect_glNormalPointerEXT;
glAPI->TexCoordPointerEXT = __indirect_glTexCoordPointerEXT;
glAPI->VertexPointerEXT = __indirect_glVertexPointerEXT;
/* GL_EXT_point_parameters */
glAPI->PointParameterfEXT = __indirect_glPointParameterfEXT;
glAPI->PointParameterfvEXT = __indirect_glPointParameterfvEXT;
/* GL_MESA_window_pos */
glAPI->WindowPos2dMESA = __indirect_glWindowPos2dMESA;
glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvMESA;
glAPI->WindowPos2fMESA = __indirect_glWindowPos2fMESA;
glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvMESA;
glAPI->WindowPos2iMESA = __indirect_glWindowPos2iMESA;
glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivMESA;
glAPI->WindowPos2sMESA = __indirect_glWindowPos2sMESA;
glAPI->WindowPos2svMESA = __indirect_glWindowPos2svMESA;
glAPI->WindowPos3dMESA = __indirect_glWindowPos3dMESA;
glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvMESA;
glAPI->WindowPos3fMESA = __indirect_glWindowPos3fMESA;
glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvMESA;
glAPI->WindowPos3iMESA = __indirect_glWindowPos3iMESA;
glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivMESA;
glAPI->WindowPos3sMESA = __indirect_glWindowPos3sMESA;
glAPI->WindowPos3svMESA = __indirect_glWindowPos3svMESA;
/* GL_EXT_blend_func_separate */
glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparateEXT;
/* GL_EXT_fog_coord */
glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT;
glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT;
glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT;
glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT;
glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT;
/* GL_ARB_texture_compression */
/* 12. GL_ARB_texture_compression */
glAPI->CompressedTexImage3DARB = __indirect_glCompressedTexImage3DARB;
glAPI->CompressedTexImage2DARB = __indirect_glCompressedTexImage2DARB;
@@ -573,120 +513,7 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->CompressedTexSubImage1DARB = __indirect_glCompressedTexSubImage1DARB;
glAPI->GetCompressedTexImageARB = __indirect_glGetCompressedTexImageARB;
/* GL_EXT_secondary_color */
glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3bEXT;
glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bvEXT;
glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3dEXT;
glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dvEXT;
glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3fEXT;
glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fvEXT;
glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3iEXT;
glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3ivEXT;
glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3sEXT;
glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3svEXT;
glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ubEXT;
glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubvEXT;
glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3uiEXT;
glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uivEXT;
glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3usEXT;
glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usvEXT;
glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointerEXT;
/* GL_NV_vertex_program */
glAPI->AreProgramsResidentNV = __indirect_glAreProgramsResidentNV;
glAPI->BindProgramNV = __indirect_glBindProgramNV;
glAPI->DeleteProgramsNV = __indirect_glDeleteProgramsNV;
glAPI->ExecuteProgramNV = __indirect_glExecuteProgramNV;
glAPI->GenProgramsNV = __indirect_glGenProgramsNV;
glAPI->GetProgramParameterdvNV = __indirect_glGetProgramParameterdvNV;
glAPI->GetProgramParameterfvNV = __indirect_glGetProgramParameterfvNV;
glAPI->GetProgramivNV = __indirect_glGetProgramivNV;
glAPI->GetProgramStringNV = __indirect_glGetProgramStringNV;
glAPI->GetTrackMatrixivNV = __indirect_glGetTrackMatrixivNV;
/* GL_ARB_vertex_program */
glAPI->GetVertexAttribdvARB = __indirect_glGetVertexAttribdvARB;
glAPI->GetVertexAttribfvARB = __indirect_glGetVertexAttribfvARB;
glAPI->GetVertexAttribivARB = __indirect_glGetVertexAttribivARB;
/* GL_NV_vertex_program */
glAPI->GetVertexAttribPointervNV = __indirect_glGetVertexAttribPointervNV;
glAPI->IsProgramNV = __indirect_glIsProgramNV;
glAPI->LoadProgramNV = __indirect_glLoadProgramNV;
glAPI->ProgramParameter4dNV = __indirect_glProgramParameter4dNV;
glAPI->ProgramParameter4dvNV = __indirect_glProgramParameter4dvNV;
glAPI->ProgramParameter4fNV = __indirect_glProgramParameter4fNV;
glAPI->ProgramParameter4fvNV = __indirect_glProgramParameter4fvNV;
glAPI->ProgramParameters4dvNV = __indirect_glProgramParameters4dvNV;
glAPI->ProgramParameters4fvNV = __indirect_glProgramParameters4fvNV;
glAPI->RequestResidentProgramsNV = __indirect_glRequestResidentProgramsNV;
glAPI->TrackMatrixNV = __indirect_glTrackMatrixNV;
glAPI->VertexAttribPointerNV = __indirect_glVertexAttribPointerNV;
/* GL_ARB_vertex_program */
glAPI->VertexAttrib1dARB = __indirect_glVertexAttrib1dARB;
glAPI->VertexAttrib1dvARB = __indirect_glVertexAttrib1dvARB;
glAPI->VertexAttrib1fARB = __indirect_glVertexAttrib1fARB;
glAPI->VertexAttrib1fvARB = __indirect_glVertexAttrib1fvARB;
glAPI->VertexAttrib1sARB = __indirect_glVertexAttrib1sARB;
glAPI->VertexAttrib1svARB = __indirect_glVertexAttrib1svARB;
glAPI->VertexAttrib2dARB = __indirect_glVertexAttrib2dARB;
glAPI->VertexAttrib2dvARB = __indirect_glVertexAttrib2dvARB;
glAPI->VertexAttrib2fARB = __indirect_glVertexAttrib2fARB;
glAPI->VertexAttrib2fvARB = __indirect_glVertexAttrib2fvARB;
glAPI->VertexAttrib2sARB = __indirect_glVertexAttrib2sARB;
glAPI->VertexAttrib2svARB = __indirect_glVertexAttrib2svARB;
glAPI->VertexAttrib3dARB = __indirect_glVertexAttrib3dARB;
glAPI->VertexAttrib3dvARB = __indirect_glVertexAttrib3dvARB;
glAPI->VertexAttrib3fARB = __indirect_glVertexAttrib3fARB;
glAPI->VertexAttrib3fvARB = __indirect_glVertexAttrib3fvARB;
glAPI->VertexAttrib3sARB = __indirect_glVertexAttrib3sARB;
glAPI->VertexAttrib3svARB = __indirect_glVertexAttrib3svARB;
glAPI->VertexAttrib4dARB = __indirect_glVertexAttrib4dARB;
glAPI->VertexAttrib4dvARB = __indirect_glVertexAttrib4dvARB;
glAPI->VertexAttrib4fARB = __indirect_glVertexAttrib4fARB;
glAPI->VertexAttrib4fvARB = __indirect_glVertexAttrib4fvARB;
glAPI->VertexAttrib4sARB = __indirect_glVertexAttrib4sARB;
glAPI->VertexAttrib4svARB = __indirect_glVertexAttrib4svARB;
glAPI->VertexAttrib4NubARB = __indirect_glVertexAttrib4NubARB;
glAPI->VertexAttrib4NubvARB = __indirect_glVertexAttrib4NubvARB;
/* GL_NV_vertex_program */
glAPI->VertexAttribs1dvNV = __indirect_glVertexAttribs1dvNV;
glAPI->VertexAttribs1fvNV = __indirect_glVertexAttribs1fvNV;
glAPI->VertexAttribs1svNV = __indirect_glVertexAttribs1svNV;
glAPI->VertexAttribs2dvNV = __indirect_glVertexAttribs2dvNV;
glAPI->VertexAttribs2fvNV = __indirect_glVertexAttribs2fvNV;
glAPI->VertexAttribs2svNV = __indirect_glVertexAttribs2svNV;
glAPI->VertexAttribs3dvNV = __indirect_glVertexAttribs3dvNV;
glAPI->VertexAttribs3fvNV = __indirect_glVertexAttribs3fvNV;
glAPI->VertexAttribs3svNV = __indirect_glVertexAttribs3svNV;
glAPI->VertexAttribs4dvNV = __indirect_glVertexAttribs4dvNV;
glAPI->VertexAttribs4fvNV = __indirect_glVertexAttribs4fvNV;
glAPI->VertexAttribs4svNV = __indirect_glVertexAttribs4svNV;
glAPI->VertexAttribs4ubvNV = __indirect_glVertexAttribs4ubvNV;
/* GL_NV_point_sprite */
glAPI->PointParameteriNV = __indirect_glPointParameteriNV;
glAPI->PointParameterivNV = __indirect_glPointParameterivNV;
/* GL_EXT_multi_draw_arrays */
glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT;
glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT;
/* GL_EXT_stencil_two_side */
glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
/* GL_ARB_vertex_program */
/* 26. GL_ARB_vertex_program */
glAPI->VertexAttrib4bvARB = __indirect_glVertexAttrib4bvARB;
glAPI->VertexAttrib4ivARB = __indirect_glVertexAttrib4ivARB;
@@ -716,8 +543,209 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->GetProgramLocalParameterfvARB = __indirect_glGetProgramLocalParameterfvARB;
glAPI->GetProgramivARB = __indirect_glGetProgramivARB;
glAPI->GetProgramStringARB = __indirect_glGetProgramStringARB;
glAPI->GetVertexAttribdvARB = __indirect_glGetVertexAttribdvARB;
glAPI->GetVertexAttribfvARB = __indirect_glGetVertexAttribfvARB;
glAPI->GetVertexAttribivARB = __indirect_glGetVertexAttribivARB;
glAPI->VertexAttrib1dARB = __indirect_glVertexAttrib1dARB;
glAPI->VertexAttrib1dvARB = __indirect_glVertexAttrib1dvARB;
glAPI->VertexAttrib1fARB = __indirect_glVertexAttrib1fARB;
glAPI->VertexAttrib1fvARB = __indirect_glVertexAttrib1fvARB;
glAPI->VertexAttrib1sARB = __indirect_glVertexAttrib1sARB;
glAPI->VertexAttrib1svARB = __indirect_glVertexAttrib1svARB;
glAPI->VertexAttrib2dARB = __indirect_glVertexAttrib2dARB;
glAPI->VertexAttrib2dvARB = __indirect_glVertexAttrib2dvARB;
glAPI->VertexAttrib2fARB = __indirect_glVertexAttrib2fARB;
glAPI->VertexAttrib2fvARB = __indirect_glVertexAttrib2fvARB;
glAPI->VertexAttrib2sARB = __indirect_glVertexAttrib2sARB;
glAPI->VertexAttrib2svARB = __indirect_glVertexAttrib2svARB;
glAPI->VertexAttrib3dARB = __indirect_glVertexAttrib3dARB;
glAPI->VertexAttrib3dvARB = __indirect_glVertexAttrib3dvARB;
glAPI->VertexAttrib3fARB = __indirect_glVertexAttrib3fARB;
glAPI->VertexAttrib3fvARB = __indirect_glVertexAttrib3fvARB;
glAPI->VertexAttrib3sARB = __indirect_glVertexAttrib3sARB;
glAPI->VertexAttrib3svARB = __indirect_glVertexAttrib3svARB;
glAPI->VertexAttrib4dARB = __indirect_glVertexAttrib4dARB;
glAPI->VertexAttrib4dvARB = __indirect_glVertexAttrib4dvARB;
glAPI->VertexAttrib4fARB = __indirect_glVertexAttrib4fARB;
glAPI->VertexAttrib4fvARB = __indirect_glVertexAttrib4fvARB;
glAPI->VertexAttrib4sARB = __indirect_glVertexAttrib4sARB;
glAPI->VertexAttrib4svARB = __indirect_glVertexAttrib4svARB;
glAPI->VertexAttrib4NubARB = __indirect_glVertexAttrib4NubARB;
glAPI->VertexAttrib4NubvARB = __indirect_glVertexAttrib4NubvARB;
/* GL_NV_fragment_program */
/* 29. GL_ARB_occlusion_query */
glAPI->EndQueryARB = __indirect_glEndQueryARB;
glAPI->GetQueryivARB = __indirect_glGetQueryivARB;
glAPI->GetQueryObjectivARB = __indirect_glGetQueryObjectivARB;
glAPI->GetQueryObjectuivARB = __indirect_glGetQueryObjectuivARB;
glAPI->GenQueriesARB = __indirect_glGenQueriesARB;
glAPI->DeleteQueriesARB = __indirect_glDeleteQueriesARB;
glAPI->IsQueryARB = __indirect_glIsQueryARB;
glAPI->BeginQueryARB = __indirect_glBeginQueryARB;
/* 37. GL_ARB_draw_buffers */
glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB;
/* 20. GL_EXT_texture_object */
glAPI->GenTexturesEXT = __indirect_glGenTexturesEXT;
glAPI->IsTextureEXT = __indirect_glIsTextureEXT;
glAPI->AreTexturesResidentEXT = __indirect_glAreTexturesResidentEXT;
/* 25. GL_SGIS_multisample */
glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS;
glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS;
/* 30. GL_EXT_vertex_array */
glAPI->ColorPointerEXT = __indirect_glColorPointerEXT;
glAPI->EdgeFlagPointerEXT = __indirect_glEdgeFlagPointerEXT;
glAPI->IndexPointerEXT = __indirect_glIndexPointerEXT;
glAPI->NormalPointerEXT = __indirect_glNormalPointerEXT;
glAPI->TexCoordPointerEXT = __indirect_glTexCoordPointerEXT;
glAPI->VertexPointerEXT = __indirect_glVertexPointerEXT;
/* 54. GL_EXT_point_parameters */
glAPI->PointParameterfEXT = __indirect_glPointParameterfEXT;
glAPI->PointParameterfvEXT = __indirect_glPointParameterfvEXT;
/* 145. GL_EXT_secondary_color */
glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usvEXT;
glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointerEXT;
glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3bEXT;
glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bvEXT;
glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3dEXT;
glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dvEXT;
glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3fEXT;
glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fvEXT;
glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3iEXT;
glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3ivEXT;
glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3sEXT;
glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3svEXT;
glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ubEXT;
glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubvEXT;
glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3uiEXT;
glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uivEXT;
glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3usEXT;
/* 148. GL_EXT_multi_draw_arrays */
glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT;
glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT;
/* 149. GL_EXT_fog_coord */
glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT;
glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT;
glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT;
glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT;
glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT;
/* 173. GL_EXT_blend_func_separate */
glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparateEXT;
/* 197. GL_MESA_window_pos */
glAPI->WindowPos2dMESA = __indirect_glWindowPos2dMESA;
glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvMESA;
glAPI->WindowPos2fMESA = __indirect_glWindowPos2fMESA;
glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvMESA;
glAPI->WindowPos2iMESA = __indirect_glWindowPos2iMESA;
glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivMESA;
glAPI->WindowPos2sMESA = __indirect_glWindowPos2sMESA;
glAPI->WindowPos2svMESA = __indirect_glWindowPos2svMESA;
glAPI->WindowPos3dMESA = __indirect_glWindowPos3dMESA;
glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvMESA;
glAPI->WindowPos3fMESA = __indirect_glWindowPos3fMESA;
glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvMESA;
glAPI->WindowPos3iMESA = __indirect_glWindowPos3iMESA;
glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivMESA;
glAPI->WindowPos3sMESA = __indirect_glWindowPos3sMESA;
glAPI->WindowPos3svMESA = __indirect_glWindowPos3svMESA;
/* 233. GL_NV_vertex_program */
glAPI->VertexAttribs4svNV = __indirect_glVertexAttribs4svNV;
glAPI->VertexAttribs4ubvNV = __indirect_glVertexAttribs4ubvNV;
glAPI->VertexAttrib3fNV = __indirect_glVertexAttrib3fNV;
glAPI->VertexAttrib3fvNV = __indirect_glVertexAttrib3fvNV;
glAPI->VertexAttrib3sNV = __indirect_glVertexAttrib3sNV;
glAPI->VertexAttrib3svNV = __indirect_glVertexAttrib3svNV;
glAPI->VertexAttrib4dNV = __indirect_glVertexAttrib4dNV;
glAPI->VertexAttrib3dvNV = __indirect_glVertexAttrib3dvNV;
glAPI->VertexAttrib4fNV = __indirect_glVertexAttrib4fNV;
glAPI->VertexAttrib4fvNV = __indirect_glVertexAttrib4fvNV;
glAPI->VertexAttrib4sNV = __indirect_glVertexAttrib4sNV;
glAPI->VertexAttrib4svNV = __indirect_glVertexAttrib4svNV;
glAPI->VertexAttrib4ubNV = __indirect_glVertexAttrib4ubNV;
glAPI->VertexAttrib4ubvNV = __indirect_glVertexAttrib4ubvNV;
glAPI->VertexAttrib1fvNV = __indirect_glVertexAttrib1fvNV;
glAPI->VertexAttrib3dNV = __indirect_glVertexAttrib3dNV;
glAPI->VertexAttrib4dvNV = __indirect_glVertexAttrib4dvNV;
glAPI->VertexAttrib1sNV = __indirect_glVertexAttrib1sNV;
glAPI->VertexAttrib1fNV = __indirect_glVertexAttrib1fNV;
glAPI->VertexAttrib1svNV = __indirect_glVertexAttrib1svNV;
glAPI->VertexAttrib1dvNV = __indirect_glVertexAttrib1dvNV;
glAPI->AreProgramsResidentNV = __indirect_glAreProgramsResidentNV;
glAPI->BindProgramNV = __indirect_glBindProgramNV;
glAPI->DeleteProgramsNV = __indirect_glDeleteProgramsNV;
glAPI->ExecuteProgramNV = __indirect_glExecuteProgramNV;
glAPI->GenProgramsNV = __indirect_glGenProgramsNV;
glAPI->GetProgramParameterdvNV = __indirect_glGetProgramParameterdvNV;
glAPI->GetProgramParameterfvNV = __indirect_glGetProgramParameterfvNV;
glAPI->GetProgramivNV = __indirect_glGetProgramivNV;
glAPI->GetProgramStringNV = __indirect_glGetProgramStringNV;
glAPI->GetTrackMatrixivNV = __indirect_glGetTrackMatrixivNV;
glAPI->GetVertexAttribPointervNV = __indirect_glGetVertexAttribPointervNV;
glAPI->IsProgramNV = __indirect_glIsProgramNV;
glAPI->LoadProgramNV = __indirect_glLoadProgramNV;
glAPI->ProgramParameter4dNV = __indirect_glProgramParameter4dNV;
glAPI->ProgramParameter4dvNV = __indirect_glProgramParameter4dvNV;
glAPI->ProgramParameter4fNV = __indirect_glProgramParameter4fNV;
glAPI->ProgramParameter4fvNV = __indirect_glProgramParameter4fvNV;
glAPI->ProgramParameters4dvNV = __indirect_glProgramParameters4dvNV;
glAPI->ProgramParameters4fvNV = __indirect_glProgramParameters4fvNV;
glAPI->RequestResidentProgramsNV = __indirect_glRequestResidentProgramsNV;
glAPI->TrackMatrixNV = __indirect_glTrackMatrixNV;
glAPI->VertexAttribPointerNV = __indirect_glVertexAttribPointerNV;
glAPI->VertexAttrib2dNV = __indirect_glVertexAttrib2dNV;
glAPI->VertexAttrib2sNV = __indirect_glVertexAttrib2sNV;
glAPI->VertexAttrib2dvNV = __indirect_glVertexAttrib2dvNV;
glAPI->VertexAttrib2fNV = __indirect_glVertexAttrib2fNV;
glAPI->VertexAttrib2svNV = __indirect_glVertexAttrib2svNV;
glAPI->VertexAttrib2fvNV = __indirect_glVertexAttrib2fvNV;
glAPI->GetVertexAttribdvNV = __indirect_glGetVertexAttribdvNV;
glAPI->GetVertexAttribfvNV = __indirect_glGetVertexAttribfvNV;
glAPI->GetVertexAttribivNV = __indirect_glGetVertexAttribivNV;
glAPI->VertexAttrib1dNV = __indirect_glVertexAttrib1dNV;
glAPI->VertexAttribs1dvNV = __indirect_glVertexAttribs1dvNV;
glAPI->VertexAttribs1fvNV = __indirect_glVertexAttribs1fvNV;
glAPI->VertexAttribs1svNV = __indirect_glVertexAttribs1svNV;
glAPI->VertexAttribs2dvNV = __indirect_glVertexAttribs2dvNV;
glAPI->VertexAttribs2fvNV = __indirect_glVertexAttribs2fvNV;
glAPI->VertexAttribs2svNV = __indirect_glVertexAttribs2svNV;
glAPI->VertexAttribs3dvNV = __indirect_glVertexAttribs3dvNV;
glAPI->VertexAttribs3fvNV = __indirect_glVertexAttribs3fvNV;
glAPI->VertexAttribs3svNV = __indirect_glVertexAttribs3svNV;
glAPI->VertexAttribs4dvNV = __indirect_glVertexAttribs4dvNV;
glAPI->VertexAttribs4fvNV = __indirect_glVertexAttribs4fvNV;
/* 262. GL_NV_point_sprite */
glAPI->PointParameteriNV = __indirect_glPointParameteriNV;
glAPI->PointParameterivNV = __indirect_glPointParameterivNV;
/* 268. GL_EXT_stencil_two_side */
glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
/* 282. GL_NV_fragment_program */
glAPI->ProgramNamedParameter4fNV = __indirect_glProgramNamedParameter4fNV;
glAPI->ProgramNamedParameter4dNV = __indirect_glProgramNamedParameter4dNV;
@@ -726,48 +754,25 @@ __GLapi * __glXNewIndirectAPI( void )
glAPI->GetProgramNamedParameterfvNV = __indirect_glGetProgramNamedParameterfvNV;
glAPI->GetProgramNamedParameterdvNV = __indirect_glGetProgramNamedParameterdvNV;
/* GL_ARB_occlusion_query */
/* 310. GL_EXT_framebuffer_object */
glAPI->GenQueriesARB = __indirect_glGenQueriesARB;
glAPI->DeleteQueriesARB = __indirect_glDeleteQueriesARB;
glAPI->IsQueryARB = __indirect_glIsQueryARB;
glAPI->BeginQueryARB = __indirect_glBeginQueryARB;
glAPI->EndQueryARB = __indirect_glEndQueryARB;
glAPI->GetQueryivARB = __indirect_glGetQueryivARB;
glAPI->GetQueryObjectivARB = __indirect_glGetQueryObjectivARB;
glAPI->GetQueryObjectuivARB = __indirect_glGetQueryObjectuivARB;
/* GL_NV_vertex_program */
glAPI->GetVertexAttribdvNV = __indirect_glGetVertexAttribdvNV;
glAPI->GetVertexAttribfvNV = __indirect_glGetVertexAttribfvNV;
glAPI->GetVertexAttribivNV = __indirect_glGetVertexAttribivNV;
glAPI->VertexAttrib1dNV = __indirect_glVertexAttrib1dNV;
glAPI->VertexAttrib1dvNV = __indirect_glVertexAttrib1dvNV;
glAPI->VertexAttrib1fNV = __indirect_glVertexAttrib1fNV;
glAPI->VertexAttrib1fvNV = __indirect_glVertexAttrib1fvNV;
glAPI->VertexAttrib1sNV = __indirect_glVertexAttrib1sNV;
glAPI->VertexAttrib1svNV = __indirect_glVertexAttrib1svNV;
glAPI->VertexAttrib2dNV = __indirect_glVertexAttrib2dNV;
glAPI->VertexAttrib2dvNV = __indirect_glVertexAttrib2dvNV;
glAPI->VertexAttrib2fNV = __indirect_glVertexAttrib2fNV;
glAPI->VertexAttrib2fvNV = __indirect_glVertexAttrib2fvNV;
glAPI->VertexAttrib2sNV = __indirect_glVertexAttrib2sNV;
glAPI->VertexAttrib2svNV = __indirect_glVertexAttrib2svNV;
glAPI->VertexAttrib3dNV = __indirect_glVertexAttrib3dNV;
glAPI->VertexAttrib3dvNV = __indirect_glVertexAttrib3dvNV;
glAPI->VertexAttrib3fNV = __indirect_glVertexAttrib3fNV;
glAPI->VertexAttrib3fvNV = __indirect_glVertexAttrib3fvNV;
glAPI->VertexAttrib3sNV = __indirect_glVertexAttrib3sNV;
glAPI->VertexAttrib3svNV = __indirect_glVertexAttrib3svNV;
glAPI->VertexAttrib4dNV = __indirect_glVertexAttrib4dNV;
glAPI->VertexAttrib4dvNV = __indirect_glVertexAttrib4dvNV;
glAPI->VertexAttrib4fNV = __indirect_glVertexAttrib4fNV;
glAPI->VertexAttrib4fvNV = __indirect_glVertexAttrib4fvNV;
glAPI->VertexAttrib4sNV = __indirect_glVertexAttrib4sNV;
glAPI->VertexAttrib4svNV = __indirect_glVertexAttrib4svNV;
glAPI->VertexAttrib4ubNV = __indirect_glVertexAttrib4ubNV;
glAPI->VertexAttrib4ubvNV = __indirect_glVertexAttrib4ubvNV;
glAPI->RenderbufferStorageEXT = __indirect_glRenderbufferStorageEXT;
glAPI->GetRenderbufferParameterivEXT = __indirect_glGetRenderbufferParameterivEXT;
glAPI->IsFramebufferEXT = __indirect_glIsFramebufferEXT;
glAPI->BindFramebufferEXT = __indirect_glBindFramebufferEXT;
glAPI->DeleteFramebuffersEXT = __indirect_glDeleteFramebuffersEXT;
glAPI->GenFramebuffersEXT = __indirect_glGenFramebuffersEXT;
glAPI->CheckFramebufferStatusEXT = __indirect_glCheckFramebufferStatusEXT;
glAPI->FramebufferTexture1DEXT = __indirect_glFramebufferTexture1DEXT;
glAPI->FramebufferTexture2DEXT = __indirect_glFramebufferTexture2DEXT;
glAPI->FramebufferTexture3DEXT = __indirect_glFramebufferTexture3DEXT;
glAPI->FramebufferRenderbufferEXT = __indirect_glFramebufferRenderbufferEXT;
glAPI->GetFramebufferAttachmentParameterivEXT = __indirect_glGetFramebufferAttachmentParameterivEXT;
glAPI->GenerateMipmapEXT = __indirect_glGenerateMipmapEXT;
glAPI->IsRenderbufferEXT = __indirect_glIsRenderbufferEXT;
glAPI->BindRenderbufferEXT = __indirect_glBindRenderbufferEXT;
glAPI->DeleteRenderbuffersEXT = __indirect_glDeleteRenderbuffersEXT;
glAPI->GenRenderbuffersEXT = __indirect_glGenRenderbuffersEXT;
return glAPI;
}

View File

@@ -334,22 +334,18 @@ __glPointParameterfvEXT_size( GLenum e )
switch( e ) {
case GL_POINT_SIZE_MIN:
/* case GL_POINT_SIZE_MIN_ARB:*/
/* case GL_POINT_SIZE_MIN_EXT:*/
/* case GL_POINT_SIZE_MIN_SGIS:*/
case GL_POINT_SIZE_MAX:
/* case GL_POINT_SIZE_MAX_ARB:*/
/* case GL_POINT_SIZE_MAX_EXT:*/
/* case GL_POINT_SIZE_MAX_SGIS:*/
case GL_POINT_FADE_THRESHOLD_SIZE:
/* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/
/* case GL_POINT_FADE_THRESHOLD_SIZE_EXT:*/
/* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/
case GL_POINT_SPRITE_R_MODE_NV:
case GL_POINT_SPRITE_COORD_ORIGIN:
return 1;
case GL_POINT_DISTANCE_ATTENUATION:
/* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/
/* case GL_POINT_DISTANCE_ATTENUATION_EXT:*/
/* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/
return 3;
default: return 0;
@@ -369,3 +365,8 @@ ALIAS( Map2f, Map2d )
ALIAS( ColorTableParameteriv, ColorTableParameterfv )
ALIAS( ConvolutionParameteriv, ConvolutionParameterfv )
ALIAS( PointParameterivNV, PointParameterfvEXT )
# undef HAVE_ALIAS
# undef PURE
# undef FASTCALL
# undef INTERNAL

View File

@@ -45,7 +45,8 @@ install:
echo "*** Installation aborted."; \
exit 1; \
fi;
install -m 0755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/
test -d $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ || mkdir $(DFB_MODULEDIR)/interfaces/IDirectFBGL/
install -m 755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/
clean:

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004 Claudio Ciccani <klan@users.sf.net>
* Copyright (C) 2004-2005 Claudio Ciccani <klan@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -38,6 +38,8 @@
#include "buffers.h"
#include "context.h"
#include "extensions.h"
#include "framebuffer.h"
#include "renderbuffer.h"
#include "imports.h"
#include "texformat.h"
#include "teximage.h"
@@ -84,6 +86,7 @@ typedef struct {
GLvisual visual;
GLframebuffer framebuffer;
GLcontext context;
struct gl_renderbuffer render;
} IDirectFBGL_data;
@@ -93,7 +96,7 @@ static bool dfb_mesa_create_context ( GLcontext *context,
GLframebuffer *framebuffer,
GLvisual *visual,
DFBSurfacePixelFormat format,
void *data );
IDirectFBGL_data *data );
static void dfb_mesa_destroy_context( GLcontext *context,
GLframebuffer *framebuffer );
@@ -155,6 +158,8 @@ IDirectFBGL_Lock( IDirectFBGL *thiz )
return err;
}
data->video.end = data->video.start + (height-1) * data->video.pitch;
data->render.Data = data->video.start;
if (data->width != width || data->height != height) {
data->width = width;
@@ -248,7 +253,7 @@ Construct( IDirectFBGL *thiz,
/* Create context. */
if (!dfb_mesa_create_context( &data->context, &data->framebuffer,
&data->visual, data->format, (void*) data )) {
&data->visual, data->format, data )) {
D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" );
surface->Release( surface );
return DFB_UNSUPPORTED;
@@ -312,134 +317,144 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
return;
}
static void
delete_renderbuffer( struct gl_renderbuffer *render )
{
return;
}
static GLboolean
renderbuffer_storage( GLcontext *ctx, struct gl_renderbuffer *render,
GLenum internalFormat, GLuint width, GLuint height )
{
return GL_TRUE;
}
/* RGB332 */
#define NAME(PREFIX) PREFIX##_RGB332
#define FORMAT GL_RGBA8
#define SPAN_VARS \
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
#define INIT_PIXEL_PTR(P, X, Y) \
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X)
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X);
#define INC_PIXEL_PTR(P) P += 1
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
*P = ( (((R) & 0xe0)) | (((G) & 0xe0) >> 3) | ((B) >> 6) )
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
*P = ( (((R) & 0xe0)) | (((G) & 0xe0) >> 3) | ((B) >> 6) )
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
R = ((*P & 0xe0) ); \
G = ((*P & 0x1c) << 3); \
B = ((*P & 0x03) << 6); \
A = CHAN_MAX
#define STORE_PIXEL(P, X, Y, S) \
*P = ( (((S[RCOMP]) & 0xe0)) | (((S[GCOMP]) & 0xe0) >> 3) | ((S[BCOMP]) >> 6) )
#define FETCH_PIXEL(D, P) \
D[RCOMP] = ((*P & 0xe0) ); \
D[GCOMP] = ((*P & 0x1c) << 3); \
D[BCOMP] = ((*P & 0x03) << 6); \
D[ACOMP] = 0xff
#include "swrast/s_spantemp.h"
/* ARGB1555 */
#define NAME(PREFIX) PREFIX##_ARGB1555
#define FORMAT GL_RGBA8
#define SPAN_VARS \
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
#define INIT_PIXEL_PTR(P, X, Y) \
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2)
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
#define INC_PIXEL_PTR(P) P += 1
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
*P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) )
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
*P = ( (((A) & 0x80) << 8) | (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) )
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
R = ((*P & 0x7c00) >> 7); \
G = ((*P & 0x03e0) >> 2); \
B = ((*P & 0x001f) << 3); \
A = ((*P & 0x8000) ? 0xff : 0)
#define STORE_PIXEL(P, X, Y, S) \
*P = ( (((S[RCOMP]) & 0xf8) << 7) | (((S[GCOMP]) & 0xf8) << 2) | ((S[BCOMP]) >> 3) )
#define FETCH_PIXEL(D, P) \
D[RCOMP] = ((*P & 0x7c00) >> 7); \
D[GCOMP] = ((*P & 0x03e0) >> 2); \
D[BCOMP] = ((*P & 0x001f) << 3); \
D[ACOMP] = ((*P & 0x8000) ? 0xff : 0)
#include "swrast/s_spantemp.h"
/* RGB16 */
#define NAME(PREFIX) PREFIX##_RGB16
#define FORMAT GL_RGBA8
#define SPAN_VARS \
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
#define INIT_PIXEL_PTR(P, X, Y) \
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2)
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
#define INC_PIXEL_PTR(P) P += 1
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
*P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
*P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
R = ((*P & 0xf800) >> 8); \
G = ((*P & 0x07e0) >> 3); \
B = ((*P & 0x001f) << 3); \
A = CHAN_MAX
#define STORE_PIXEL(P, X, Y, S) \
*P = ( (((S[RCOMP]) & 0xf8) << 8) | (((S[GCOMP]) & 0xfc) << 3) | ((S[BCOMP]) >> 3) )
#define FETCH_PIXEL(D, P) \
D[RCOMP] = ((*P & 0xf800) >> 8); \
D[GCOMP] = ((*P & 0x07e0) >> 3); \
D[BCOMP] = ((*P & 0x001f) << 3); \
D[ACOMP] = 0xff
#include "swrast/s_spantemp.h"
/* RGB24 */
#define NAME(PREFIX) PREFIX##_RGB24
#define FORMAT GL_RGBA8
#define SPAN_VARS \
IDirectFBGL_data *data = ctx->DriverCtx;
#define INIT_PIXEL_PTR(P, X, Y) \
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3;
#define INC_PIXEL_PTR(P) P += 3
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
P[0] = B; P[1] = G; P[2] = R
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
P[0] = B; P[1] = G; P[2] = R
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
R = P[2]; G = P[1]; B = P[0]; A = CHAN_MAX
#define STORE_PIXEL(P, X, Y, S) \
P[0] = S[BCOMP]; P[1] = S[GCOMP]; P[2] = S[BCOMP]
#define FETCH_PIXEL(D, P) \
D[RCOMP] = P[2]; D[GCOMP] = P[1]; D[BCOMP] = P[0]; D[ACOMP] = 0xff
#include "swrast/s_spantemp.h"
/* RGB32 */
#define NAME(PREFIX) PREFIX##_RGB32
#define FORMAT GL_RGBA8
#define SPAN_VARS \
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
#define INIT_PIXEL_PTR(P, X, Y) \
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4)
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
#define INC_PIXEL_PTR(P) P += 1
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
*P = ( ((R) << 16) | ((G) << 8) | (B) )
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
*P = ( ((R) << 16) | ((G) << 8) | (B) )
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
R = ((*P & 0x00ff0000) >> 16); \
G = ((*P & 0x0000ff00) >> 8); \
B = ((*P & 0x000000ff) ); \
A = CHAN_MAX
#define STORE_PIXEL(P, X, Y, S) \
*P = ( ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
#define FETCH_PIXEL(D, P) \
D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
D[BCOMP] = ((*P & 0x000000ff) ); \
D[ACOMP] = 0xff
#include "swrast/s_spantemp.h"
/* ARGB */
#define NAME(PREFIX) PREFIX##_ARGB
#define FORMAT GL_RGBA8
#define SPAN_VARS \
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
#define INIT_PIXEL_PTR(P, X, Y) \
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4)
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
#define INC_PIXEL_PTR(P) P += 1
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
*P = ( 0xff000000 | ((R) << 16) | ((G) << 8) | (B) )
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
*P = ( ((A) << 24) | ((R) << 16) | ((G) << 8) | (B) )
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
R = ((*P & 0x00ff0000) >> 16); \
G = ((*P & 0x0000ff00) >> 8); \
B = ((*P & 0x000000ff) ); \
A = ((*P & 0xff000000) >> 24)
#define STORE_PIXEL_RGB(P, X, Y, S) \
*P = ( 0xff000000 | ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
#define STORE_PIXEL(P, X, Y, S) \
*P = ( ((S[ACOMP]) << 24) | ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
#define FETCH_PIXEL(D, P) \
D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
D[BCOMP] = ((*P & 0x000000ff) ); \
D[ACOMP] = ((*P & 0xff000000) >> 24)
#include "swrast/s_spantemp.h"
/* AiRGB */
#define NAME(PREFIX) PREFIX##_AiRGB
#define FORMAT GL_RGBA8
#define SPAN_VARS \
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
#define INIT_PIXEL_PTR(P, X, Y) \
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4)
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
#define INC_PIXEL_PTR(P) P += 1
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
*P = ( ((R) << 16) | ((G) << 8) | (B) )
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
*P = ( ((0xff - (A)) << 24) | ((R) << 16) | ((G) << 8) | (B) )
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
R = ((*P & 0x00ff0000) >> 16); \
G = ((*P & 0x0000ff00) >> 8); \
B = ((*P & 0x000000ff) ); \
A = (0xff - ((*P & 0xff000000) >> 24))
#define STORE_PIXEL_RGB(P, X, Y, S) \
*P = ( ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
#define STORE_PIXEL(P, X, Y, S) \
*P = ( ((0xff - (S[ACOMP])) << 24) | ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
#define FETCH_PIXEL(D, P) \
D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
D[BCOMP] = ((*P & 0x000000ff) ); \
D[ACOMP] = (0xff - ((*P & 0xff000000) >> 24))
#include "swrast/s_spantemp.h"
@@ -520,16 +535,12 @@ dfb_mesa_create_context( GLcontext *context,
GLframebuffer *framebuffer,
GLvisual *visual,
DFBSurfacePixelFormat format,
void *data )
IDirectFBGL_data *data )
{
struct dd_function_table functions;
struct swrast_device_driver *swdd;
_mesa_initialize_framebuffer( framebuffer, visual,
visual->haveDepthBuffer,
visual->haveStencilBuffer,
visual->haveAccumBuffer,
visual->accumAlphaBits > 0 );
_mesa_initialize_framebuffer( framebuffer, visual );
_mesa_init_driver_functions( &functions );
functions.GetString = get_string;
@@ -538,7 +549,7 @@ dfb_mesa_create_context( GLcontext *context,
functions.Viewport = set_viewport;
if (!_mesa_initialize_context( context, visual, NULL,
&functions, data )) {
&functions, (void*) data )) {
D_DEBUG( "DirectFBGL/Mesa: _mesa_initialize_context() failed.\n" );
_mesa_free_framebuffer_data( framebuffer );
return false;
@@ -552,80 +563,92 @@ dfb_mesa_create_context( GLcontext *context,
swdd = _swrast_GetDeviceDriverReference( context );
swdd->SetBuffer = set_buffer;
_mesa_init_renderbuffer( &data->render, 0 );
data->render.InternalFormat = GL_RGBA;
data->render._BaseFormat = GL_RGBA;
data->render.DataType = GL_UNSIGNED_BYTE;
data->render.Data = data->video.start;
data->render.Delete = delete_renderbuffer;
data->render.AllocStorage = renderbuffer_storage;
switch (format) {
case DSPF_RGB332:
swdd->WriteRGBASpan = write_rgba_span_RGB332;
swdd->WriteRGBSpan = write_rgb_span_RGB332;
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB332;
swdd->WriteRGBAPixels = write_rgba_pixels_RGB332;
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB332;
swdd->ReadRGBASpan = read_rgba_span_RGB332;
swdd->ReadRGBAPixels = read_rgba_pixels_RGB332;
case DSPF_RGB332:
data->render.GetRow = get_row_RGB332;
data->render.GetValues = get_values_RGB332;
data->render.PutRow = put_row_RGB332;
data->render.PutMonoRow = put_mono_row_RGB332;
data->render.PutValues = put_values_RGB332;
data->render.PutMonoValues = put_mono_values_RGB332;
break;
case DSPF_ARGB1555:
swdd->WriteRGBASpan = write_rgba_span_ARGB1555;
swdd->WriteRGBSpan = write_rgb_span_ARGB1555;
swdd->WriteMonoRGBASpan = write_monorgba_span_ARGB1555;
swdd->WriteRGBAPixels = write_rgba_pixels_ARGB1555;
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_ARGB1555;
swdd->ReadRGBASpan = read_rgba_span_ARGB1555;
swdd->ReadRGBAPixels = read_rgba_pixels_ARGB1555;
data->render.GetRow = get_row_ARGB1555;
data->render.GetValues = get_values_ARGB1555;
data->render.PutRow = put_row_ARGB1555;
data->render.PutMonoRow = put_mono_row_ARGB1555;
data->render.PutValues = put_values_ARGB1555;
data->render.PutMonoValues = put_mono_values_ARGB1555;
break;
case DSPF_RGB16:
swdd->WriteRGBASpan = write_rgba_span_RGB16;
swdd->WriteRGBSpan = write_rgb_span_RGB16;
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB16;
swdd->WriteRGBAPixels = write_rgba_pixels_RGB16;
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB16;
swdd->ReadRGBASpan = read_rgba_span_RGB16;
swdd->ReadRGBAPixels = read_rgba_pixels_RGB16;
data->render.GetRow = get_row_RGB16;
data->render.GetValues = get_values_RGB16;
data->render.PutRow = put_row_RGB16;
data->render.PutMonoRow = put_mono_row_RGB16;
data->render.PutValues = put_values_RGB16;
data->render.PutMonoValues = put_mono_values_RGB16;
break;
case DSPF_RGB24:
swdd->WriteRGBASpan = write_rgba_span_RGB24;
swdd->WriteRGBSpan = write_rgb_span_RGB24;
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB24;
swdd->WriteRGBAPixels = write_rgba_pixels_RGB24;
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB24;
swdd->ReadRGBASpan = read_rgba_span_RGB24;
swdd->ReadRGBAPixels = read_rgba_pixels_RGB24;
case DSPF_RGB24:
data->render.GetRow = get_row_RGB24;
data->render.GetValues = get_values_RGB24;
data->render.PutRow = put_row_RGB24;
data->render.PutMonoRow = put_mono_row_RGB24;
data->render.PutValues = put_values_RGB24;
data->render.PutMonoValues = put_mono_values_RGB24;
break;
case DSPF_RGB32:
swdd->WriteRGBASpan = write_rgba_span_RGB32;
swdd->WriteRGBSpan = write_rgb_span_RGB32;
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB32;
swdd->WriteRGBAPixels = write_rgba_pixels_RGB32;
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB32;
swdd->ReadRGBASpan = read_rgba_span_RGB32;
swdd->ReadRGBAPixels = read_rgba_pixels_RGB32;
data->render.GetRow = get_row_RGB32;
data->render.GetValues = get_values_RGB32;
data->render.PutRow = put_row_RGB32;
data->render.PutMonoRow = put_mono_row_RGB32;
data->render.PutValues = put_values_RGB32;
data->render.PutMonoValues = put_mono_values_RGB32;
break;
case DSPF_ARGB:
swdd->WriteRGBASpan = write_rgba_span_ARGB;
swdd->WriteRGBSpan = write_rgb_span_ARGB;
swdd->WriteMonoRGBASpan = write_monorgba_span_ARGB;
swdd->WriteRGBAPixels = write_rgba_pixels_ARGB;
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_ARGB;
swdd->ReadRGBASpan = read_rgba_span_ARGB;
swdd->ReadRGBAPixels = read_rgba_pixels_ARGB;
data->render.GetRow = get_row_ARGB;
data->render.GetValues = get_values_ARGB;
data->render.PutRow = put_row_ARGB;
data->render.PutMonoRow = put_mono_row_ARGB;
data->render.PutValues = put_values_ARGB;
data->render.PutMonoValues = put_mono_values_ARGB;
break;
case DSPF_AiRGB:
swdd->WriteRGBASpan = write_rgba_span_AiRGB;
swdd->WriteRGBSpan = write_rgb_span_AiRGB;
swdd->WriteMonoRGBASpan = write_monorgba_span_AiRGB;
swdd->WriteRGBAPixels = write_rgba_pixels_AiRGB;
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_AiRGB;
swdd->ReadRGBASpan = read_rgba_span_AiRGB;
swdd->ReadRGBAPixels = read_rgba_pixels_AiRGB;
data->render.GetRow = get_row_AiRGB;
data->render.GetValues = get_values_AiRGB;
data->render.PutRow = put_row_AiRGB;
data->render.PutMonoRow = put_mono_row_AiRGB;
data->render.PutValues = put_values_AiRGB;
data->render.PutMonoValues = put_mono_values_AiRGB;
break;
default:
D_BUG( "unexpected pixelformat" );
return false;
}
_mesa_add_renderbuffer( framebuffer, BUFFER_FRONT_LEFT, &data->render );
_mesa_add_soft_renderbuffers( framebuffer,
GL_FALSE,
visual->haveDepthBuffer,
visual->haveStencilBuffer,
visual->haveAccumBuffer,
GL_FALSE,
GL_FALSE );
TNL_CONTEXT( context )->Driver.RunPipeline = _tnl_run_pipeline;
_mesa_enable_sw_extensions( context );
_mesa_make_current( context, framebuffer );
_mesa_make_current( context, framebuffer, framebuffer );
return true;
}
@@ -634,7 +657,7 @@ static void
dfb_mesa_destroy_context( GLcontext *context,
GLframebuffer *framebuffer )
{
_mesa_make_current( NULL, NULL );
_mesa_make_current( NULL, NULL, NULL );
_mesa_free_framebuffer_data( framebuffer );
_mesa_notifyDestroy( context );
_mesa_free_context_data( context );

View File

@@ -38,9 +38,6 @@ OBJECTS = $(C_SOURCES:.c=.o) \
endif
### Include directories
SHARED_INCLUDES = \
-I. \
@@ -78,9 +75,10 @@ default: depend symlinks $(LIBNAME) $(LIB_DIR)/$(LIBNAME)
# $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
# $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
# XXX we should use the mklib script here
$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
rm -f $@
gcc $(ARCH_FLAGS) -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
$(CC) $(ARCH_FLAGS) -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
$(LIB_DIR)/$(LIBNAME): $(LIBNAME)

View File

@@ -7,25 +7,20 @@
*/
#include "spantmp_common.h"
#ifndef DBG
#define DBG 0
#endif
#ifndef HAVE_HW_DEPTH_SPANS
#define HAVE_HW_DEPTH_SPANS 0
#endif
#ifndef HAVE_HW_DEPTH_PIXELS
#define HAVE_HW_DEPTH_PIXELS 0
#endif
#ifndef HW_READ_LOCK
#define HW_READ_LOCK() HW_LOCK()
#endif
#ifndef HW_READ_UNLOCK
#define HW_READ_UNLOCK() HW_UNLOCK()
#endif
static void TAG(WriteDepthSpan)( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,

File diff suppressed because it is too large Load Diff

View File

@@ -27,26 +27,12 @@
* Gareth Hughes <gareth@nvidia.com>
*/
#include "spantmp_common.h"
#ifndef DBG
#define DBG 0
#endif
#ifndef HW_WRITE_LOCK
#define HW_WRITE_LOCK() HW_LOCK()
#endif
#ifndef HW_WRITE_UNLOCK
#define HW_WRITE_UNLOCK() HW_UNLOCK()
#endif
#ifndef HW_READ_LOCK
#define HW_READ_LOCK() HW_LOCK()
#endif
#ifndef HW_READ_UNLOCK
#define HW_READ_UNLOCK() HW_UNLOCK()
#endif
#ifndef HW_READ_CLIPLOOP
#define HW_READ_CLIPLOOP() HW_CLIPLOOP()
#endif

View File

@@ -34,27 +34,12 @@
*/
#include "colormac.h"
#include "spantmp_common.h"
#ifndef DBG
#define DBG 0
#endif
#ifndef HW_WRITE_LOCK
#define HW_WRITE_LOCK() HW_LOCK()
#endif
#ifndef HW_WRITE_UNLOCK
#define HW_WRITE_UNLOCK() HW_UNLOCK()
#endif
#ifndef HW_READ_LOCK
#define HW_READ_LOCK() HW_LOCK()
#endif
#ifndef HW_READ_UNLOCK
#define HW_READ_UNLOCK() HW_UNLOCK()
#endif
#ifndef HW_READ_CLIPLOOP
#define HW_READ_CLIPLOOP() HW_CLIPLOOP()
#endif
@@ -65,6 +50,14 @@
#if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
#ifndef GET_SRC_PTR
#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 2 + (_y) * pitch)
#endif
#ifndef GET_DST_PTR
#define GET_DST_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * pitch)
#endif
#define INIT_MONO_PIXEL(p, color) \
p = PACK_COLOR_565( color[0], color[1], color[2] )
@@ -92,9 +85,17 @@
#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
#ifndef GET_SRC_PTR
#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 4 + (_y) * pitch)
#endif
#ifndef GET_DST_PTR
#define GET_DST_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
#endif
# define INIT_MONO_PIXEL(p, color) \
p = PACK_COLOR_8888(color[3], color[0], color[1], color[2])
# define WRITE_RGBA(_x, _y, r, g, b, a) \
do { \
GLuint * _p = (GLuint *) GET_DST_PTR(_x, _y); \

View File

@@ -0,0 +1,81 @@
/*
* Copyright 2000-2001 VA Linux Systems, Inc.
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file spantmp_common.h
*
* common macros for span read / write functions to be used in the depth,
* stencil and pixel span templates.
*/
#ifndef HW_WRITE_LOCK
#define HW_WRITE_LOCK() HW_LOCK()
#endif
#ifndef HW_WRITE_UNLOCK
#define HW_WRITE_UNLOCK() HW_UNLOCK()
#endif
#ifndef HW_READ_LOCK
#define HW_READ_LOCK() HW_LOCK()
#endif
#ifndef HW_READ_UNLOCK
#define HW_READ_UNLOCK() HW_UNLOCK()
#endif
#ifndef HW_CLIPLOOP
#define HW_CLIPLOOP() \
do { \
int _nc = dPriv->numClipRects; \
while ( _nc-- ) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#endif
#ifndef HW_ENDCLIPLOOP
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#endif
#ifndef CLIPPIXEL
#define CLIPPIXEL( _x, _y ) \
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
#endif
#ifndef CLIPSPAN
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy /*|| _x + n < minx || _x >=maxx*/ ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#endif

View File

@@ -1,23 +1,11 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/common/stenciltmp.h,v 1.3 2001/03/21 16:14:20 dawes Exp $ */
#include "spantmp_common.h"
#ifndef DBG
#define DBG 0
#endif
#ifndef HW_WRITE_LOCK
#define HW_WRITE_LOCK() HW_LOCK()
#endif
#ifndef HW_WRITE_UNLOCK
#define HW_WRITE_UNLOCK() HW_UNLOCK()
#endif
#ifndef HW_READ_LOCK
#define HW_READ_LOCK() HW_LOCK()
#endif
#ifndef HW_READ_UNLOCK
#define HW_READ_UNLOCK() HW_UNLOCK()
#endif
static void TAG(WriteStencilSpan)( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,

View File

@@ -180,9 +180,18 @@ driGetRendererString( char * buffer, const char * hardware_name,
/**
* Enable extensions supported by the driver.
*
* \bug
* ARB_imaging isn't handled properly. In Mesa, enabling ARB_imaging also
* enables all the sub-extensions that are folded into it. This means that
* we need to add entry-points (via \c driInitSingleExtension) for those
* new functions here.
*/
void driInitExtensions( GLcontext * ctx,
const char * const extensions_to_enable[],
GLboolean enable_imaging )
const struct dri_extension * extensions_to_enable,
GLboolean enable_imaging )
{
unsigned i;
@@ -190,14 +199,84 @@ void driInitExtensions( GLcontext * ctx,
_mesa_enable_imaging_extensions( ctx );
}
for ( i = 0 ; extensions_to_enable[i] != NULL ; i++ ) {
_mesa_enable_extension( ctx, extensions_to_enable[i] );
for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) {
driInitSingleExtension( ctx, & extensions_to_enable[i] );
}
}
/**
* Enable and add dispatch functions for a single extension
*
* \param ctx Context where extension is to be enabled.
* \param ext Extension that is to be enabled.
*
* \sa driInitExtensions, _mesa_enable_extension, _glapi_add_entrypoint
*
* \todo
* Determine if it would be better to use \c strlen instead of the hardcoded
* for-loops.
*/
void driInitSingleExtension( GLcontext * ctx,
const struct dri_extension * ext )
{
unsigned i;
if ( ext->functions != NULL ) {
for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) {
const char * functions[16];
const char * parameter_signature;
const char * str = ext->functions[i].strings;
unsigned j;
/* Separate the parameter signature from the rest of the string.
* If the parameter signature is empty (i.e., the string starts
* with a NUL character), then the function has a void parameter
* list.
*/
parameter_signature = str;
while ( str[0] != '\0' ) {
str++;
}
str++;
/* Divide the string into the substrings that name each
* entry-point for the function.
*/
for ( j = 0 ; j < 16 ; j++ ) {
if ( str[0] == '\0' ) {
functions[j] = NULL;
break;
}
functions[j] = str;
while ( str[0] != '\0' ) {
str++;
}
str++;
}
/* Add each entry-point to the dispatch table.
*/
for ( j = 0 ; functions[j] != NULL ; j++ ) {
_glapi_add_entrypoint( functions[j],
ext->functions[i].offset );
}
}
}
_mesa_enable_extension( ctx, ext->name );
}
#ifndef DRI_NEW_INTERFACE_ONLY
/**
* Utility function used by drivers to test the verions of other components.

View File

@@ -32,12 +32,52 @@
#include "context.h"
#include "dri_util.h"
struct dri_debug_control
{
struct dri_debug_control {
const char * string;
unsigned flag;
};
/**
* Description of the entry-points and parameters for an OpenGL function.
*/
struct dri_extension_function {
/**
* \brief
* Packed string describing the parameter signature and the entry-point
* names.
*
* The parameter signature and the names of the entry-points for this
* function are packed into a single string. The substrings are
* separated by NUL characters. The whole string is terminated by
* two consecutive NUL characters.
*/
const char * strings;
/**
* Offset of the function in the dispatch table.
*/
unsigned offset;
};
/**
* Description of the API for an extension to OpenGL.
*/
struct dri_extension {
/**
* Name of the extension.
*/
const char * name;
/**
* Pointer to a list of \c dri_extension_function structures. The list
* is terminated by a structure with a \c NULL
* \c dri_extension_function::strings pointer.
*/
const struct dri_extension_function * functions;
};
extern unsigned driParseDebugString( const char * debug,
const struct dri_debug_control * control );
@@ -45,7 +85,10 @@ extern unsigned driGetRendererString( char * buffer,
const char * hardware_name, const char * driver_date, GLuint agp_mode );
extern void driInitExtensions( GLcontext * ctx,
const char * const card_extensions[], GLboolean enable_imaging );
const struct dri_extension * card_extensions, GLboolean enable_imaging );
extern void driInitSingleExtension( GLcontext * ctx,
const struct dri_extension * ext );
#ifndef DRI_NEW_INTERFACE_ONLY
extern GLboolean driCheckDriDdxDrmVersions( __DRIscreenPrivate *sPriv,

View File

@@ -836,7 +836,9 @@ fbSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
else {
/* XXX this shouldn't be an error but we can't handle it for now */
_mesa_problem(NULL, "fbSwapBuffers: drawable has no context!\n");
return EGL_FALSE;
}
return EGL_TRUE;
}

View File

@@ -40,21 +40,6 @@
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL( _x, _y ) \
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP( _y ) (height - _y - 1)
#define HW_LOCK() \
@@ -63,21 +48,6 @@
gammaGetLock( gmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT ); \
GAMMAHW_LOCK( gmesa );
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = gmesa->driDrawable; \
int _nc = dPriv->numClipRects; \
\
while ( _nc-- ) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK() GAMMAHW_UNLOCK( gmesa )
@@ -156,7 +126,6 @@ do { \
#include "depthtmp.h"
#if 0 /* Unused */
/* 32 bit depthbuffer functions.
*/

View File

@@ -61,6 +61,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i810ioctl.h"
#include "utils.h"
#define need_GL_ARB_multisample
#include "extension_helper.h"
#ifndef I810_DEBUG
int I810_DEBUG = (0);
#endif
@@ -97,17 +101,18 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
/* Extension strings exported by the i810 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multitexture",
"GL_ARB_texture_env_add",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_lod_bias",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _i810_render_stage;

View File

@@ -41,39 +41,10 @@
#define INIT_MONO_PIXEL(p, color) \
p = PACK_COLOR_565( color[0], color[1], color[2] )
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP(_y) (height - _y - 1)
#define HW_LOCK()
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = imesa->driDrawable; \
int _nc = dPriv->numClipRects; \
while (_nc--) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK()
/* 16 bit, 565 rgb color spanline and pixel functions
@@ -97,8 +68,6 @@ do { \
#define TAG(x) i810##x##_565
#include "spantmp.h"
/* 16 bit depthbuffer functions.
*/
#define WRITE_DEPTH( _x, _y, d ) \

View File

@@ -65,6 +65,17 @@
#include "utils.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#include "xmlpool.h" /* for symbolic values of enum-type options */
#ifndef I830_DEBUG
int I830_DEBUG = (0);
@@ -138,35 +149,35 @@ static void i830BufferSize(GLframebuffer *buffer,
/* Extension strings exported by the i830 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_crossbar",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_blend_color",
"GL_EXT_blend_equation_separate",
"GL_EXT_blend_func_separate",
"GL_EXT_blend_minmax",
"GL_EXT_blend_subtract",
"GL_EXT_fog_coord",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_EXT_texture_rectangle",
"GL_NV_blend_square",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_blend_subtract", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_texture_rectangle", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};

View File

@@ -81,39 +81,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define INIT_MONO_PIXEL(p,color)\
p = PACK_COLOR_565(color[0],color[1],color[2])
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP(_y) (height - _y - 1)
#define HW_LOCK()
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = imesa->driDrawable; \
int _nc = dPriv->numClipRects; \
while (_nc--) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK()
/* 16 bit, 565 rgb color spanline and pixel functions
@@ -137,9 +108,6 @@ do { \
#define TAG(x) i830##x##_565
#include "spantmp.h"
/* 15 bit, 555 rgb color spanline and pixel functions
*/
#define WRITE_RGBA( _x, _y, r, g, b, a ) \

View File

@@ -38,10 +38,10 @@
* Mesa's Driver Functions
***************************************/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_texture_env_crossbar",
NULL
{ "GL_ARB_texture_env_crossbar", NULL },
{ NULL, NULL }
};

View File

@@ -45,14 +45,15 @@
* Mesa's Driver Functions
***************************************/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_depth_texture", /* New: alanh 06-Jan-2005 */
"GL_ARB_fragment_program",
"GL_ARB_shadow", /* New: alanh 06-Jan-2005 */
"GL_EXT_shadow_funcs", /* New: alanh 06-Jan-2005 */
"GL_SGIX_depth_texture", /* ARB extn won't work if not enabled */
NULL
{ "GL_ARB_depth_texture", NULL },
{ "GL_ARB_fragment_program", NULL },
{ "GL_ARB_shadow", NULL },
{ "GL_EXT_shadow_funcs", NULL },
/* ARB extn won't work if not enabled */
{ "GL_SGIX_depth_texture", NULL },
{ NULL, NULL }
};
/* Override intel default.

View File

@@ -60,6 +60,23 @@
int INTEL_DEBUG = (0);
#endif
#define need_GL_ARB_multisample
#define need_GL_ARB_point_parameters
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_ARB_window_pos
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_cull_vertex
#define need_GL_EXT_fog_coord
#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#ifndef VERBOSE
int VERBOSE = 0;
#endif
@@ -136,48 +153,46 @@ static void intelBufferSize(GLframebuffer *buffer,
* It appears that ARB_texture_env_crossbar has "disappeared" compared to the
* old i830-specific driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_point_parameters",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_cube_map",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_ARB_texture_rectangle",
"GL_ARB_vertex_buffer_object",
"GL_ARB_vertex_program",
"GL_ARB_window_pos",
"GL_EXT_abgr",
"GL_EXT_bgra",
"GL_EXT_blend_color",
"GL_EXT_blend_equation_separate",
"GL_EXT_blend_func_separate",
"GL_EXT_blend_minmax",
"GL_EXT_blend_subtract",
"GL_EXT_cull_vertex", /* New: alanh 06-Jan-2005 */
"GL_EXT_fog_coord",
"GL_EXT_multi_draw_arrays",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_3DFX_texture_compression_FXT1",
"GL_APPLE_client_storage",
"GL_MESA_pack_invert",
"GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
"GL_NV_vertex_program",
"GL_NV_vertex_program1_1",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_cube_map", NULL },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_texture_rectangle", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
{ "GL_ARB_window_pos", GL_ARB_window_pos_functions },
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_blend_subtract", NULL },
{ "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_3DFX_texture_compression_FXT1", NULL },
{ "GL_APPLE_client_storage", NULL },
{ "GL_MESA_pack_invert", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_vertex_program1_1", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _intel_render_stage;

View File

@@ -69,39 +69,10 @@
#define INIT_MONO_PIXEL(p,color)\
p = INTEL_PACKCOLOR565(color[0],color[1],color[2])
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP(_y) (height - _y - 1)
#define HW_LOCK()
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = intel->driDrawable; \
int _nc = dPriv->numClipRects; \
while (_nc--) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK()
/* 16 bit, 565 rgb color spanline and pixel functions
@@ -125,9 +96,6 @@ do { \
#define TAG(x) intel##x##_565
#include "spantmp.h"
/* 15 bit, 555 rgb color spanline and pixel functions
*/
#define WRITE_RGBA( _x, _y, r, g, b, a ) \

View File

@@ -57,6 +57,9 @@
#include "utils.h"
#include "vblank.h"
#define need_GL_ARB_multisample
#include "extension_helper.h"
#ifndef MACH64_DEBUG
int MACH64_DEBUG = (0);
#endif
@@ -76,14 +79,14 @@ static const struct dri_debug_control debug_control[] =
{ NULL, 0 }
};
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multitexture",
"GL_EXT_texture_edge_clamp",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
"GL_SGIS_texture_edge_clamp",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};

View File

@@ -26,14 +26,13 @@
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Leif Delgass <ldelgass@retinalburn.net>
* Jos<6F> Fonseca <j_r_fonseca@yahoo.co.uk>
* Jos<6F>Fonseca <j_r_fonseca@yahoo.co.uk>
*/
#include "mach64_context.h"
#include "mach64_ioctl.h"
#include "mach64_state.h"
#include "mach64_span.h"
#include "mach64_tex.h"
#include "swrast/swrast.h"
@@ -71,25 +70,11 @@
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL( _x, _y ) \
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if (( _y < miny) || (_y >= maxy)) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if (_x1 < minx) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if (_x1 + _n1 >= maxx) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP( _y ) (height - _y - 1)
#define HW_LOCK()
/* FIXME could/should we use dPriv->numClipRects like the other drivers? */
#define HW_CLIPLOOP() \
do { \
int _nc = mmesa->numClipRects; \
@@ -114,8 +99,6 @@
/* 16 bit, RGB565 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 2 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 2 + _y * pitch)
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
@@ -126,8 +109,8 @@
/* 32 bit, ARGB8888 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 4 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 4 + _y * pitch)
/* FIXME the old code always read back alpha as 0xff, i.e. fully opaque.
Was there a reason to do so ? If so that'll won't work with that template... */
#define SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
@@ -197,63 +180,9 @@ static void mach64SpanRenderFinish( GLcontext *ctx )
void mach64DDInitSpanFuncs( GLcontext *ctx )
{
#if 0
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
#endif
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
swdd->SetBuffer = mach64DDSetBuffer;
#if 0
switch ( mmesa->mach64Screen->cpp ) {
case 2:
swdd->WriteRGBASpan = mach64WriteRGBASpan_RGB565;
swdd->WriteRGBSpan = mach64WriteRGBSpan_RGB565;
swdd->WriteMonoRGBASpan = mach64WriteMonoRGBASpan_RGB565;
swdd->WriteRGBAPixels = mach64WriteRGBAPixels_RGB565;
swdd->WriteMonoRGBAPixels = mach64WriteMonoRGBAPixels_RGB565;
swdd->ReadRGBASpan = mach64ReadRGBASpan_RGB565;
swdd->ReadRGBAPixels = mach64ReadRGBAPixels_RGB565;
break;
case 4:
swdd->WriteRGBASpan = mach64WriteRGBASpan_ARGB8888;
swdd->WriteRGBSpan = mach64WriteRGBSpan_ARGB8888;
swdd->WriteMonoRGBASpan = mach64WriteMonoRGBASpan_ARGB8888;
swdd->WriteRGBAPixels = mach64WriteRGBAPixels_ARGB8888;
swdd->WriteMonoRGBAPixels = mach64WriteMonoRGBAPixels_ARGB8888;
swdd->ReadRGBASpan = mach64ReadRGBASpan_ARGB8888;
swdd->ReadRGBAPixels = mach64ReadRGBAPixels_ARGB8888;
break;
default:
break;
}
#endif
/* Depth buffer is always 16 bit */
#if 0
swdd->ReadDepthSpan = mach64ReadDepthSpan_16;
swdd->WriteDepthSpan = mach64WriteDepthSpan_16;
swdd->ReadDepthPixels = mach64ReadDepthPixels_16;
swdd->WriteDepthPixels = mach64WriteDepthPixels_16;
#endif
#if 0
/* No hardware stencil buffer */
swdd->ReadStencilSpan = NULL;
swdd->WriteStencilSpan = NULL;
swdd->ReadStencilPixels = NULL;
swdd->WriteStencilPixels = NULL;
swdd->WriteCI8Span = NULL;
swdd->WriteCI32Span = NULL;
swdd->WriteMonoCISpan = NULL;
swdd->WriteCI32Pixels = NULL;
swdd->WriteMonoCIPixels = NULL;
swdd->ReadCI32Span = NULL;
swdd->ReadCI32Pixels = NULL;
#endif
swdd->SpanRenderStart = mach64SpanRenderStart;
swdd->SpanRenderFinish = mach64SpanRenderFinish;
}

View File

@@ -31,6 +31,7 @@
*/
#include <stdlib.h>
#include <stdint.h>
#include "drm.h"
#include "mga_drm.h"
#include "mga_xmesa.h"
@@ -68,6 +69,18 @@
#include "GL/internal/dri_interface.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_program
#define need_GL_EXT_fog_coord
#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#if 0
#define need_GL_EXT_paletted_texture
#endif
#define need_GL_NV_vertex_program
#include "extension_helper.h"
/* MGA configuration
*/
#include "xmlpool.h"
@@ -264,22 +277,30 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
* primary DMA region base address needs to be known is so that the driver
* can busy wait for certain DMA operations to complete (see
* mgaWaitForFrameCompletion in mgaioctl.c).
*
* Starting with MGA DRM version 3.2, these are completely unneeded as
* there is a new, in-kernel mechanism for handling the wait.
*/
mgaScreen->mmio.handle = serverInfo->registers.handle;
mgaScreen->mmio.size = serverInfo->registers.size;
if ( drmMap( sPriv->fd,
mgaScreen->mmio.handle, mgaScreen->mmio.size,
&mgaScreen->mmio.map ) < 0 ) {
FREE( mgaScreen );
sPriv->private = NULL;
__driUtilMessage( "Couldn't map MMIO registers" );
return GL_FALSE;
if (mgaScreen->sPriv->drmMinor < 2) {
mgaScreen->mmio.handle = serverInfo->registers.handle;
mgaScreen->mmio.size = serverInfo->registers.size;
if ( drmMap( sPriv->fd,
mgaScreen->mmio.handle, mgaScreen->mmio.size,
&mgaScreen->mmio.map ) < 0 ) {
FREE( mgaScreen );
sPriv->private = NULL;
__driUtilMessage( "Couldn't map MMIO registers" );
return GL_FALSE;
}
mgaScreen->primary.handle = serverInfo->primary.handle;
mgaScreen->primary.size = serverInfo->primary.size;
}
else {
(void) memset( & mgaScreen->primary, 0, sizeof( mgaScreen->primary ) );
(void) memset( & mgaScreen->mmio, 0, sizeof( mgaScreen->mmio ) );
}
mgaScreen->primary.handle = serverInfo->primary.handle;
mgaScreen->primary.size = serverInfo->primary.size;
mgaScreen->textureOffset[MGA_CARD_HEAP] = serverInfo->textureOffset;
mgaScreen->textureOffset[MGA_AGP_HEAP] = (serverInfo->agpTextureOffset |
@@ -371,39 +392,47 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = {
};
static const char * const g400_extensions[] =
static const struct dri_extension g400_extensions[] =
{
"GL_ARB_multitexture",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_crossbar",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_edge_clamp",
"GL_ATI_texture_env_combine3",
#if defined (MESA_packed_depth_stencil)
"GL_MESA_packed_depth_stencil",
#endif
NULL
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_ATI_texture_env_combine3", NULL },
{ NULL, NULL }
};
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_texture_compression",
"GL_ARB_texture_rectangle",
"GL_EXT_blend_logic_op",
"GL_EXT_fog_coord",
"GL_EXT_multi_draw_arrays",
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_rectangle", NULL },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
/* paletted_textures currently doesn't work, but we could fix them later */
#if 0
"GL_EXT_shared_texture_palette",
"GL_EXT_paletted_texture",
#if defined( need_GL_EXT_paletted_texture )
{ "GL_EXT_shared_texture_palette", NULL },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
#endif
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
static const struct dri_extension ARB_vp_extension[] = {
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
{ NULL, NULL }
};
static const struct dri_extension NV_vp_extensions[] = {
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_vertex_program1_1", NULL },
{ NULL, NULL }
};
static const struct dri_debug_control debug_control[] =
@@ -608,12 +637,11 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
}
if ( driQueryOptionb( &mmesa->optionCache, "arb_vertex_program" ) ) {
_mesa_enable_extension( ctx, "GL_ARB_vertex_program" );
driInitSingleExtension( ctx, ARB_vp_extension );
}
if ( driQueryOptionb( &mmesa->optionCache, "nv_vertex_program" ) ) {
_mesa_enable_extension( ctx, "GL_NV_vertex_program" );
_mesa_enable_extension( ctx, "GL_NV_vertex_program1_1" );
driInitExtensions( ctx, NV_vp_extensions, GL_FALSE );
}

View File

@@ -29,6 +29,7 @@
#ifndef MGALIB_INC
#define MGALIB_INC
#include <stdint.h>
#include "drm.h"
#include "mga_drm.h"
#include "dri_util.h"
@@ -268,6 +269,8 @@ struct mga_context_t {
GLuint swap_count;
GLuint swap_missed_count;
uint32_t last_frame_fence;
PFNGLXGETUSTPROC get_ust;
/* Drawable, cliprect and scissor information

View File

@@ -41,7 +41,7 @@
#include "mga_xmesa.h"
#include "utils.h"
#define DRIVER_DATE "20030328"
#define DRIVER_DATE "20050609"
/***************************************

View File

@@ -50,6 +50,49 @@
#include "vblank.h"
int
mgaSetFence( mgaContextPtr mmesa, uint32_t * fence )
{
int ret = ENOSYS;
if ( mmesa->driScreen->drmMinor >= 2 ) {
ret = drmCommandWriteRead( mmesa->driScreen->fd, DRM_MGA_SET_FENCE,
fence, sizeof( uint32_t ));
if (ret) {
fprintf(stderr, "drmMgaSetFence: %d\n", ret);
exit(1);
}
}
return ret;
}
int
mgaWaitFence( mgaContextPtr mmesa, uint32_t fence, uint32_t * curr_fence )
{
int ret = ENOSYS;
if ( mmesa->driScreen->drmMinor >= 2 ) {
uint32_t temp = fence;
ret = drmCommandWriteRead( mmesa->driScreen->fd,
DRM_MGA_WAIT_FENCE,
& temp, sizeof( uint32_t ));
if (ret) {
fprintf(stderr, "drmMgaSetFence: %d\n", ret);
exit(1);
}
if ( curr_fence ) {
*curr_fence = temp;
}
}
return ret;
}
static void mga_iload_dma_ioctl(mgaContextPtr mmesa,
unsigned long dest,
int length)
@@ -294,58 +337,64 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
* \bug
* The loop in this function should have some sort of a timeout mechanism.
*
* \todo
* This routine should be modified to wait on a semaphore. To do this,
* the DRM would have to queue an interrupt when the swap command was
* put in the DMA buffer. When the interrupt occured, the DRM would UP
* the semaphore. This function would then just DOWN the semaphore.
* \warning
* This routine used to assume that the hardware lock was held on entry. It
* now assumes that the lock is \b not held on entry.
*/
static void mgaWaitForFrameCompletion( mgaContextPtr mmesa )
{
unsigned wait = 0;
const GLuint last_frame = mmesa->sarea->last_frame.head;
const GLuint last_wrap = mmesa->sarea->last_frame.wrap;
if ( mgaWaitFence( mmesa, mmesa->last_frame_fence, NULL ) == ENOSYS ) {
unsigned wait = 0;
GLuint last_frame;
GLuint last_wrap;
/* The DMA routines in the kernel track a couple values in the SAREA that
* we use here. The number of times that the primary DMA buffer has
* "wrapped" around is tracked in last_wrap. In addition, the wrap count
* and the buffer position at the end of the last frame are stored in
* last_frame.wrap and last_frame.head.
*
* By comparing the wrap counts and the current DMA pointer value (read
* directly from the hardware) to last_frame.head, we can determine when
* the graphics processor has processed all of the commands for the last
* frame.
*
* In this case "last frame" means the frame of the *previous* swap-
* buffers call. This is done to prevent queuing a second buffer swap
* before the previous swap is executed.
*/
while ( 1 ) {
if ( last_wrap < mmesa->sarea->last_wrap ||
( last_wrap == mmesa->sarea->last_wrap &&
last_frame <= (MGA_READ( MGAREG_PRIMADDRESS ) -
mmesa->primary_offset) ) ) {
break;
}
if ( 0 ) {
wait++;
fprintf( stderr, " last: head=0x%06x wrap=%d\n",
last_frame, last_wrap );
fprintf( stderr, " head: head=0x%06lx wrap=%d\n",
(long)(MGA_READ( MGAREG_PRIMADDRESS ) - mmesa->primary_offset),
mmesa->sarea->last_wrap );
}
UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH );
LOCK_HARDWARE( mmesa );
last_frame = mmesa->sarea->last_frame.head;
last_wrap = mmesa->sarea->last_frame.wrap;
UNLOCK_HARDWARE( mmesa );
DO_USLEEP( 1 );
LOCK_HARDWARE( mmesa );
}
if ( wait )
fprintf( stderr, "\n" );
/* The DMA routines in the kernel track a couple values in the SAREA
* that we use here. The number of times that the primary DMA buffer
* has "wrapped" around is tracked in last_wrap. In addition, the
* wrap count and the buffer position at the end of the last frame are
* stored in last_frame.wrap and last_frame.head.
*
* By comparing the wrap counts and the current DMA pointer value
* (read directly from the hardware) to last_frame.head, we can
* determine when the graphics processor has processed all of the
* commands for the last frame.
*
* In this case "last frame" means the frame of the *previous* swap-
* buffers call. This is done to prevent queuing a second buffer swap
* before the previous swap is executed.
*/
while ( 1 ) {
if ( last_wrap < mmesa->sarea->last_wrap ||
( last_wrap == mmesa->sarea->last_wrap &&
last_frame <= (MGA_READ( MGAREG_PRIMADDRESS ) -
mmesa->primary_offset) ) ) {
break;
}
if ( 0 ) {
wait++;
fprintf( stderr, " last: head=0x%06x wrap=%d\n",
last_frame, last_wrap );
fprintf( stderr, " head: head=0x%06lx wrap=%d\n",
(long)(MGA_READ( MGAREG_PRIMADDRESS ) - mmesa->primary_offset),
mmesa->sarea->last_wrap );
}
UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH );
UNLOCK_HARDWARE( mmesa );
DO_USLEEP( 1 );
LOCK_HARDWARE( mmesa );
}
if ( wait )
fprintf( stderr, "\n" );
UNLOCK_HARDWARE( mmesa );
}
}
@@ -370,9 +419,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
FLUSH_BATCH( mmesa );
LOCK_HARDWARE( mmesa );
mgaWaitForFrameCompletion( mmesa );
UNLOCK_HARDWARE( mmesa );
driWaitForVBlank( dPriv, & mmesa->vbl_seq, mmesa->vblank_flags,
& missed_target );
if ( missed_target ) {
@@ -410,6 +457,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
}
}
(void) mgaSetFence( mmesa, & mmesa->last_frame_fence );
UNLOCK_HARDWARE( mmesa );
mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
@@ -425,17 +473,12 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
*
* \param ctx Context where the \c glFinish command was issued.
*
* \todo
* This is overkill. The lock, update-lock, unlock sequence grabs the
* hardware, waits for \b all hardware activity to finish, then releases the
* hardware. A better way would be to flush the pending DMA buffers, emit
* a SOFTRAP, and wait for the SOFTRAP.
*
* \sa glFinish, mgaFlush, mgaFlushDMA
*/
static void mgaFinish( GLcontext *ctx )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
uint32_t fence;
LOCK_HARDWARE( mmesa );
@@ -443,12 +486,18 @@ static void mgaFinish( GLcontext *ctx )
mgaFlushVerticesLocked( mmesa );
}
if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL) {
fprintf(stderr, "mgaRegetLockQuiescent\n");
if ( mgaSetFence( mmesa, & fence ) == 0 ) {
UNLOCK_HARDWARE( mmesa );
(void) mgaWaitFence( mmesa, fence, NULL );
}
else {
if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL) {
fprintf(stderr, "mgaRegetLockQuiescent\n");
}
UPDATE_LOCK( mmesa, DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH );
UNLOCK_HARDWARE( mmesa );
UPDATE_LOCK( mmesa, DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH );
UNLOCK_HARDWARE( mmesa );
}
}

View File

@@ -52,7 +52,7 @@
dPriv->y * pitch); \
GLuint p; \
(void) read_buf; (void) buf; (void) p
#define LOCAL_DEPTH_VARS \
@@ -69,22 +69,9 @@
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define HW_LOCK()
/* FIXME could/should we use dPriv->numClipRects like the other drivers? */
#define HW_CLIPLOOP() \
do { \
int _nc = mmesa->numClipRects; \
@@ -102,14 +89,10 @@
#define Y_FLIP(_y) (height - _y - 1)
/* 16 bit, RGB565 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 2 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 2 + _y * pitch)
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
@@ -119,9 +102,6 @@
/* 32 bit, ARGB8888 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 4 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 4 + _y * pitch)
#define SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
@@ -258,7 +238,7 @@ void mgaDDInitSpanFuncs( GLcontext *ctx )
case 4:
#if 0
mgaInitPointers_8888( swdd );
if (!mmesa->hw_stencil) {
swdd->ReadDepthSpan = mgaReadDepthSpan_32;
swdd->WriteDepthSpan = mgaWriteDepthSpan_32;

View File

@@ -33,6 +33,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include "driver.h"
#include "drm.h"

View File

@@ -66,19 +66,24 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
int R128_DEBUG = 0;
#endif
static const char * const card_extensions[] =
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_EXT_blend_minmax
#include "extension_helper.h"
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_blend_subtract",
"GL_EXT_texture_edge_clamp",
"GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
static const struct dri_debug_control debug_control[] =

View File

@@ -75,41 +75,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL( _x, _y ) \
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP( _y ) (height - _y - 1)
#define HW_LOCK()
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = rmesa->driDrawable; \
int _nc = dPriv->numClipRects; \
\
while ( _nc-- ) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK()
@@ -120,8 +89,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/* 16 bit, RGB565 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 2 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 2 + _y * pitch)
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
@@ -132,8 +99,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/* 32 bit, ARGB8888 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 4 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 4 + _y * pitch)
#define SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV

View File

@@ -63,6 +63,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_vtxfmt.h"
#include "r200_maos.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#define DRIVER_DATE "20041207"
#include "vblank.h"
@@ -119,35 +131,49 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
/* Extension strings exported by the R200 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_ARB_vertex_buffer_object",
"GL_EXT_blend_minmax",
"GL_EXT_blend_subtract",
"GL_EXT_fog_coord",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_EXT_texture_mirror_clamp",
"GL_EXT_texture_rectangle",
"GL_ATI_texture_env_combine3",
"GL_ATI_texture_mirror_once",
"GL_MESA_pack_invert",
"GL_NV_blend_square",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_blend_subtract", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_texture_mirror_clamp", NULL },
{ "GL_EXT_texture_rectangle", NULL },
{ "GL_ATI_texture_env_combine3", NULL },
{ "GL_ATI_texture_mirror_once", NULL },
{ "GL_MESA_pack_invert", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
static const struct dri_extension blend_extensions[] = {
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ NULL, NULL }
};
static const struct dri_extension ARB_vp_extension[] = {
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }
};
static const struct dri_extension NV_vp_extension[] = {
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions }
};
extern const struct tnl_pipeline_stage _r200_render_stage;
@@ -439,13 +465,12 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
if (rmesa->r200Screen->drmSupportsCubeMaps)
_mesa_enable_extension( ctx, "GL_ARB_texture_cube_map" );
if (rmesa->r200Screen->drmSupportsBlendColor) {
_mesa_enable_extension( ctx, "GL_EXT_blend_equation_separate" );
_mesa_enable_extension( ctx, "GL_EXT_blend_func_separate" );
driInitExtensions( ctx, blend_extensions, GL_FALSE );
}
if(driQueryOptionb(&rmesa->optionCache, "arb_vertex_program"))
_mesa_enable_extension( ctx, "GL_ARB_vertex_program");
driInitSingleExtension( ctx, ARB_vp_extension );
if(driQueryOptionb(&rmesa->optionCache, "nv_vertex_program"))
_mesa_enable_extension( ctx, "GL_NV_vertex_program");
driInitSingleExtension( ctx, NV_vp_extension );
#if 0
r200InitDriverFuncs( ctx );
@@ -456,9 +481,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
/* plug in a few more device driver functions */
/* XXX these should really go right after _mesa_init_driver_functions() */
r200InitPixelFuncs( ctx );
#if 0
r200InitSpanFuncs( ctx );
#endif
r200InitTnlFuncs( ctx );
r200InitState( rmesa );
r200InitSwtcl( ctx );

View File

@@ -77,41 +77,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL( _x, _y ) \
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP( _y ) (height - _y - 1)
#define HW_LOCK()
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
int _nc = dPriv->numClipRects; \
\
while ( _nc-- ) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK()
@@ -122,9 +91,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* 16 bit, RGB565 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 2 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 2 + _y * pitch)
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
@@ -134,9 +100,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* 32 bit, ARGB8888 color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 4 + _y * pitch)
#define GET_DST_PTR(_x, _y) ( buf + _x * 4 + _y * pitch)
#define SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
@@ -354,55 +317,9 @@ static void r200SpanRenderFinish( GLcontext *ctx )
void r200InitSpanFuncs( GLcontext *ctx )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
swdd->SetBuffer = r200SetBuffer;
switch ( rmesa->r200Screen->cpp ) {
case 2:
#if 0
r200InitPointers_RGB565( swdd );
#endif
break;
case 4:
#if 0
r200InitPointers_ARGB8888( swdd );
#endif
break;
default:
break;
}
switch ( rmesa->glCtx->Visual.depthBits ) {
case 16:
#if 0
swdd->ReadDepthSpan = r200ReadDepthSpan_16;
swdd->WriteDepthSpan = r200WriteDepthSpan_16;
swdd->ReadDepthPixels = r200ReadDepthPixels_16;
swdd->WriteDepthPixels = r200WriteDepthPixels_16;
#endif
break;
case 24:
#if 0
swdd->ReadDepthSpan = r200ReadDepthSpan_24_8;
swdd->WriteDepthSpan = r200WriteDepthSpan_24_8;
swdd->ReadDepthPixels = r200ReadDepthPixels_24_8;
swdd->WriteDepthPixels = r200WriteDepthPixels_24_8;
swdd->ReadStencilSpan = r200ReadStencilSpan_24_8;
swdd->WriteStencilSpan = r200WriteStencilSpan_24_8;
swdd->ReadStencilPixels = r200ReadStencilPixels_24_8;
swdd->WriteStencilPixels = r200WriteStencilPixels_24_8;
#endif
break;
default:
break;
}
swdd->SpanRenderStart = r200SpanRenderStart;
swdd->SpanRenderFinish = r200SpanRenderFinish;
}

View File

@@ -220,6 +220,13 @@ void r200ChooseVertexState( GLcontext *ctx )
r200ContextPtr rmesa = R200_CONTEXT( ctx );
TNLcontext *tnl = TNL_CONTEXT(ctx);
/* We must ensure that we don't do _tnl_need_projected_coords while in a
* rasterization fallback. As this function will be called again when we
* leave a rasterization fallback, we can just skip it for now.
*/
if (rmesa->Fallback != 0)
return;
GLuint vte = rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL];
GLuint vap = rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL];
@@ -675,7 +682,6 @@ void r200Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
R200_FIREVERTICES( rmesa );
TCL_FALLBACK( ctx, R200_TCL_FALLBACK_RASTER, GL_TRUE );
_swsetup_Wakeup( ctx );
_tnl_need_projected_coords( ctx, GL_TRUE );
rmesa->swtcl.RenderIndex = ~0;
if (R200_DEBUG & DEBUG_FALLBACKS) {
fprintf(stderr, "R200 begin rasterization fallback: 0x%x %s\n",

View File

@@ -66,9 +66,10 @@ int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller)
drm_radeon_cmd_buffer_t cmd;
int start;
if (r300->radeon.lost_context)
if (r300->radeon.lost_context) {
start = 0;
else
r300->radeon.lost_context = GL_FALSE;
} else
start = r300->cmdbuf.count_reemit;
if (RADEON_DEBUG & DEBUG_IOCTL) {
@@ -169,6 +170,19 @@ static __inline__ void r300DoEmitState(r300ContextPtr r300, GLboolean dirty)
}
}
/* Emit WAIT */
*dest = cmdwait(R300_WAIT_3D | R300_WAIT_3D_CLEAN);
dest ++;
r300->cmdbuf.count_used ++;
/* Emit END3D */
*dest = cmdpacify();
dest ++;
r300->cmdbuf.count_used ++;
/* Emit actual atoms */
foreach(atom, &r300->hw.atomlist) {
if ((atom->dirty || r300->hw.all_dirty) == dirty) {
int dwords = (*atom->check)(r300, atom);
@@ -222,33 +236,6 @@ void r300EmitState(r300ContextPtr r300)
r300->hw.all_dirty = GL_FALSE;
}
#if 0
static __inline__ uint32_t cmducs(int reg, int count)
{
drm_r300_cmd_header_t cmd;
cmd.unchecked_state.cmd_type = R300_CMD_UNCHECKED_STATE;
cmd.unchecked_state.count = count;
cmd.unchecked_state.reghi = ((unsigned int)reg & 0xFF00) >> 8;
cmd.unchecked_state.reglo = ((unsigned int)reg & 0x00FF);
return cmd.u;
}
static __inline__ uint32_t cmdvpu(int addr, int count)
{
drm_r300_cmd_header_t cmd;
cmd.vpu.cmd_type = R300_CMD_VPU;
cmd.vpu.count = count;
cmd.vpu.adrhi = ((unsigned int)addr & 0xFF00) >> 8;
cmd.vpu.adrlo = ((unsigned int)addr & 0x00FF);
return cmd.u;
}
#endif
#define CHECK( NM, COUNT ) \
static int check_##NM( r300ContextPtr r300, \
struct r300_state_atom* atom ) \
@@ -257,15 +244,16 @@ static int check_##NM( r300ContextPtr r300, \
return (COUNT); \
}
#define ucscount(ptr) (((drm_r300_cmd_header_t*)(ptr))->unchecked_state.count)
#define vpucount(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count)
#define packet0_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->packet0.count)
#define vpu_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count)
CHECK( always, atom->cmd_size )
CHECK( never, 0 )
CHECK( variable, ucscount(atom->cmd) ? (1 + ucscount(atom->cmd)) : 0 )
CHECK( vpu, vpucount(atom->cmd) ? (1 + vpucount(atom->cmd)*4) : 0 )
CHECK( variable, packet0_count(atom->cmd) ? (1 + packet0_count(atom->cmd)) : 0 )
CHECK( vpu, vpu_count(atom->cmd) ? (1 + vpu_count(atom->cmd)*4) : 0 )
#undef ucscount
#undef packet0_count
#undef vpu_count
#define ALLOC_STATE( ATOM, CHK, SZ, NM, IDX ) \
do { \
@@ -286,8 +274,8 @@ CHECK( vpu, vpucount(atom->cmd) ? (1 + vpucount(atom->cmd)*4) : 0 )
void r300InitCmdBuf(r300ContextPtr r300)
{
int size, i, mtu;
r300->hw.max_state_size = 0;
r300->hw.max_state_size = 2; /* reserve extra space for WAIT_IDLE */
mtu = r300->radeon.glCtx->Const.MaxTextureUnits;
if (RADEON_DEBUG & DEBUG_TEXTURE) {
@@ -296,131 +284,131 @@ void r300InitCmdBuf(r300ContextPtr r300)
/* Initialize state atoms */
ALLOC_STATE( vpt, always, R300_VPT_CMDSIZE, "vpt", 0 );
r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmducs(R300_SE_VPORT_XSCALE, 6);
r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6);
ALLOC_STATE( unk2080, always, 2, "unk2080", 0 );
r300->hw.unk2080.cmd[0] = cmducs(0x2080, 1);
r300->hw.unk2080.cmd[0] = cmdpacket0(0x2080, 1);
ALLOC_STATE( vte, always, 3, "vte", 0 );
r300->hw.vte.cmd[0] = cmducs(R300_SE_VTE_CNTL, 2);
r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2);
ALLOC_STATE( unk2134, always, 3, "unk2134", 0 );
r300->hw.unk2134.cmd[0] = cmducs(0x2134, 2);
r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2);
ALLOC_STATE( unk2140, always, 2, "unk2140", 0 );
r300->hw.unk2140.cmd[0] = cmducs(0x2140, 1);
r300->hw.unk2140.cmd[0] = cmdpacket0(0x2140, 1);
ALLOC_STATE( vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0 );
r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmducs(R300_VAP_INPUT_ROUTE_0_0, 1);
r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1);
ALLOC_STATE( vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1 );
r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmducs(R300_VAP_INPUT_ROUTE_1_0, 1);
r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1);
ALLOC_STATE( vic, always, R300_VIC_CMDSIZE, "vic", 0 );
r300->hw.vic.cmd[R300_VIC_CMD_0] = cmducs(R300_VAP_INPUT_CNTL_0, 2);
r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2);
ALLOC_STATE( unk21DC, always, 2, "unk21DC", 0 );
r300->hw.unk21DC.cmd[0] = cmducs(0x21DC, 1);
r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1);
ALLOC_STATE( unk221C, always, 2, "unk221C", 0 );
r300->hw.unk221C.cmd[0] = cmducs(0x221C, 1);
r300->hw.unk221C.cmd[0] = cmdpacket0(0x221C, 1);
ALLOC_STATE( unk2220, always, 5, "unk2220", 0 );
r300->hw.unk2220.cmd[0] = cmducs(0x2220, 4);
r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4);
ALLOC_STATE( unk2288, always, 2, "unk2288", 0 );
r300->hw.unk2288.cmd[0] = cmducs(0x2288, 1);
r300->hw.unk2288.cmd[0] = cmdpacket0(0x2288, 1);
ALLOC_STATE( vof, always, R300_VOF_CMDSIZE, "vof", 0 );
r300->hw.vof.cmd[R300_VOF_CMD_0] = cmducs(R300_VAP_OUTPUT_VTX_FMT_0, 2);
r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2);
ALLOC_STATE( pvs, always, R300_PVS_CMDSIZE, "pvs", 0 );
r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmducs(R300_VAP_PVS_CNTL_1, 3);
r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3);
ALLOC_STATE( gb_enable, always, 2, "gb_enable", 0 );
r300->hw.gb_enable.cmd[0] = cmducs(R300_GB_ENABLE, 1);
r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1);
ALLOC_STATE( gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0 );
r300->hw.gb_misc.cmd[0] = cmducs(R300_GB_MSPOS0, 5);
r300->hw.gb_misc.cmd[0] = cmdpacket0(R300_GB_MSPOS0, 5);
ALLOC_STATE( txe, always, R300_TXE_CMDSIZE, "txe", 0 );
r300->hw.txe.cmd[R300_TXE_CMD_0] = cmducs(R300_TX_ENABLE, 1);
r300->hw.txe.cmd[R300_TXE_CMD_0] = cmdpacket0(R300_TX_ENABLE, 1);
ALLOC_STATE( unk4200, always, 5, "unk4200", 0 );
r300->hw.unk4200.cmd[0] = cmducs(0x4200, 4);
r300->hw.unk4200.cmd[0] = cmdpacket0(0x4200, 4);
ALLOC_STATE( unk4214, always, 2, "unk4214", 0 );
r300->hw.unk4214.cmd[0] = cmducs(0x4214, 1);
r300->hw.unk4214.cmd[0] = cmdpacket0(0x4214, 1);
ALLOC_STATE( ps, always, R300_PS_CMDSIZE, "ps", 0 );
r300->hw.ps.cmd[0] = cmducs(R300_RE_POINTSIZE, 1);
r300->hw.ps.cmd[0] = cmdpacket0(R300_RE_POINTSIZE, 1);
ALLOC_STATE( unk4230, always, 4, "unk4230", 0 );
r300->hw.unk4230.cmd[0] = cmducs(0x4230, 3);
r300->hw.unk4230.cmd[0] = cmdpacket0(0x4230, 3);
ALLOC_STATE( lcntl, always, 2, "lcntl", 0 );
r300->hw.lcntl.cmd[0] = cmducs(R300_RE_LINE_CNT, 1);
r300->hw.lcntl.cmd[0] = cmdpacket0(R300_RE_LINE_CNT, 1);
ALLOC_STATE( unk4260, always, 4, "unk4260", 0 );
r300->hw.unk4260.cmd[0] = cmducs(0x4260, 3);
r300->hw.unk4260.cmd[0] = cmdpacket0(0x4260, 3);
ALLOC_STATE( unk4274, always, 5, "unk4274", 0 );
r300->hw.unk4274.cmd[0] = cmducs(0x4274, 4);
r300->hw.unk4274.cmd[0] = cmdpacket0(0x4274, 4);
ALLOC_STATE( unk4288, always, 6, "unk4288", 0 );
r300->hw.unk4288.cmd[0] = cmducs(0x4288, 5);
r300->hw.unk4288.cmd[0] = cmdpacket0(0x4288, 5);
ALLOC_STATE( unk42A0, always, 2, "unk42A0", 0 );
r300->hw.unk42A0.cmd[0] = cmducs(0x42A0, 1);
r300->hw.unk42A0.cmd[0] = cmdpacket0(0x42A0, 1);
ALLOC_STATE( zbs, always, R300_ZBS_CMDSIZE, "zbs", 0 );
r300->hw.zbs.cmd[R300_ZBS_CMD_0] = cmducs(R300_RE_ZBIAS_T_FACTOR, 4);
r300->hw.zbs.cmd[R300_ZBS_CMD_0] = cmdpacket0(R300_RE_ZBIAS_T_FACTOR, 4);
ALLOC_STATE( unk42B4, always, 2, "unk42B4", 0 );
r300->hw.unk42B4.cmd[0] = cmducs(0x42B4, 1);
r300->hw.unk42B4.cmd[0] = cmdpacket0(0x42B4, 1);
ALLOC_STATE( cul, always, R300_CUL_CMDSIZE, "cul", 0 );
r300->hw.cul.cmd[R300_CUL_CMD_0] = cmducs(R300_RE_CULL_CNTL, 1);
r300->hw.cul.cmd[R300_CUL_CMD_0] = cmdpacket0(R300_RE_CULL_CNTL, 1);
ALLOC_STATE( unk42C0, always, 3, "unk42C0", 0 );
r300->hw.unk42C0.cmd[0] = cmducs(0x42C0, 2);
r300->hw.unk42C0.cmd[0] = cmdpacket0(0x42C0, 2);
ALLOC_STATE( rc, always, R300_RC_CMDSIZE, "rc", 0 );
r300->hw.rc.cmd[R300_RC_CMD_0] = cmducs(R300_RS_CNTL_0, 2);
r300->hw.rc.cmd[R300_RC_CMD_0] = cmdpacket0(R300_RS_CNTL_0, 2);
ALLOC_STATE( ri, always, R300_RI_CMDSIZE, "ri", 0 );
r300->hw.ri.cmd[R300_RI_CMD_0] = cmducs(R300_RS_INTERP_0, 8);
r300->hw.ri.cmd[R300_RI_CMD_0] = cmdpacket0(R300_RS_INTERP_0, 8);
ALLOC_STATE( rr, variable, R300_RR_CMDSIZE, "rr", 0 );
r300->hw.rr.cmd[R300_RR_CMD_0] = cmducs(R300_RS_ROUTE_0, 1);
r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1);
ALLOC_STATE( unk43A4, always, 3, "unk43A4", 0 );
r300->hw.unk43A4.cmd[0] = cmducs(0x43A4, 2);
r300->hw.unk43A4.cmd[0] = cmdpacket0(0x43A4, 2);
ALLOC_STATE( unk43E8, always, 2, "unk43E8", 0 );
r300->hw.unk43E8.cmd[0] = cmducs(0x43E8, 1);
r300->hw.unk43E8.cmd[0] = cmdpacket0(0x43E8, 1);
ALLOC_STATE( fp, always, R300_FP_CMDSIZE, "fp", 0 );
r300->hw.fp.cmd[R300_FP_CMD_0] = cmducs(R300_PFS_CNTL_0, 3);
r300->hw.fp.cmd[R300_FP_CMD_1] = cmducs(R300_PFS_NODE_0, 4);
r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(R300_PFS_CNTL_0, 3);
r300->hw.fp.cmd[R300_FP_CMD_1] = cmdpacket0(R300_PFS_NODE_0, 4);
ALLOC_STATE( fpt, variable, R300_FPT_CMDSIZE, "fpt", 0 );
r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmducs(R300_PFS_TEXI_0, 0);
r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, 0);
ALLOC_STATE( unk46A4, always, 6, "unk46A4", 0 );
r300->hw.unk46A4.cmd[0] = cmducs(0x46A4, 5);
r300->hw.unk46A4.cmd[0] = cmdpacket0(0x46A4, 5);
ALLOC_STATE( fpi[0], variable, R300_FPI_CMDSIZE, "fpi/0", 0 );
r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmducs(R300_PFS_INSTR0_0, 1);
r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, 1);
ALLOC_STATE( fpi[1], variable, R300_FPI_CMDSIZE, "fpi/1", 1 );
r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmducs(R300_PFS_INSTR1_0, 1);
r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, 1);
ALLOC_STATE( fpi[2], variable, R300_FPI_CMDSIZE, "fpi/2", 2 );
r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmducs(R300_PFS_INSTR2_0, 1);
r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, 1);
ALLOC_STATE( fpi[3], variable, R300_FPI_CMDSIZE, "fpi/3", 3 );
r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmducs(R300_PFS_INSTR3_0, 1);
r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, 1);
ALLOC_STATE( unk4BC0, always, 2, "unk4BC0", 0 );
r300->hw.unk4BC0.cmd[0] = cmducs(0x4BC0, 1);
r300->hw.unk4BC0.cmd[0] = cmdpacket0(0x4BC0, 1);
ALLOC_STATE( unk4BC8, always, 4, "unk4BC8", 0 );
r300->hw.unk4BC8.cmd[0] = cmducs(0x4BC8, 3);
r300->hw.unk4BC8.cmd[0] = cmdpacket0(0x4BC8, 3);
ALLOC_STATE( at, always, R300_AT_CMDSIZE, "at", 0 );
r300->hw.at.cmd[R300_AT_CMD_0] = cmducs(R300_PP_ALPHA_TEST, 2);
r300->hw.at.cmd[R300_AT_CMD_0] = cmdpacket0(R300_PP_ALPHA_TEST, 2);
ALLOC_STATE( unk4BD8, always, 2, "unk4BD8", 0 );
r300->hw.unk4BD8.cmd[0] = cmducs(0x4BD8, 1);
r300->hw.unk4BD8.cmd[0] = cmdpacket0(0x4BD8, 1);
ALLOC_STATE( fpp, variable, R300_FPP_CMDSIZE, "fpp", 0 );
r300->hw.fpp.cmd[R300_FPP_CMD_0] = cmducs(R300_PFS_PARAM_0_X, 0);
r300->hw.fpp.cmd[R300_FPP_CMD_0] = cmdpacket0(R300_PFS_PARAM_0_X, 0);
ALLOC_STATE( unk4E00, always, 2, "unk4E00", 0 );
r300->hw.unk4E00.cmd[0] = cmducs(0x4E00, 1);
r300->hw.unk4E00.cmd[0] = cmdpacket0(0x4E00, 1);
ALLOC_STATE( bld, always, R300_BLD_CMDSIZE, "bld", 0 );
r300->hw.bld.cmd[R300_BLD_CMD_0] = cmducs(R300_RB3D_CBLEND, 2);
r300->hw.bld.cmd[R300_BLD_CMD_0] = cmdpacket0(R300_RB3D_CBLEND, 2);
ALLOC_STATE( cmk, always, R300_CMK_CMDSIZE, "cmk", 0 );
r300->hw.cmk.cmd[R300_CMK_CMD_0] = cmducs(R300_RB3D_COLORMASK, 1);
r300->hw.cmk.cmd[R300_CMK_CMD_0] = cmdpacket0(R300_RB3D_COLORMASK, 1);
ALLOC_STATE( unk4E10, always, 4, "unk4E10", 0 );
r300->hw.unk4E10.cmd[0] = cmducs(0x4E10, 3);
r300->hw.unk4E10.cmd[0] = cmdpacket0(0x4E10, 3);
ALLOC_STATE( cb, always, R300_CB_CMDSIZE, "cb", 0 );
r300->hw.cb.cmd[R300_CB_CMD_0] = cmducs(R300_RB3D_COLOROFFSET0, 1);
r300->hw.cb.cmd[R300_CB_CMD_1] = cmducs(R300_RB3D_COLORPITCH0, 1);
r300->hw.cb.cmd[R300_CB_CMD_0] = cmdpacket0(R300_RB3D_COLOROFFSET0, 1);
r300->hw.cb.cmd[R300_CB_CMD_1] = cmdpacket0(R300_RB3D_COLORPITCH0, 1);
ALLOC_STATE( unk4E50, always, 10, "unk4E50", 0 );
r300->hw.unk4E50.cmd[0] = cmducs(0x4E50, 9);
r300->hw.unk4E50.cmd[0] = cmdpacket0(0x4E50, 9);
ALLOC_STATE( unk4E88, always, 2, "unk4E88", 0 );
r300->hw.unk4E88.cmd[0] = cmducs(0x4E88, 1);
r300->hw.unk4E88.cmd[0] = cmdpacket0(0x4E88, 1);
ALLOC_STATE( unk4EA0, always, 3, "unk4EA0 R350 only", 0 );
r300->hw.unk4EA0.cmd[0] = cmducs(0x4EA0, 2);
r300->hw.unk4EA0.cmd[0] = cmdpacket0(0x4EA0, 2);
ALLOC_STATE( zs, always, R300_ZS_CMDSIZE, "zstencil", 0 );
r300->hw.zs.cmd[R300_ZS_CMD_0] = cmducs(R300_RB3D_ZSTENCIL_CNTL_0, 3);
r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3);
ALLOC_STATE( unk4F10, always, 5, "unk4F10", 0 );
r300->hw.unk4F10.cmd[0] = cmducs(0x4F10, 4);
r300->hw.unk4F10.cmd[0] = cmdpacket0(0x4F10, 4);
ALLOC_STATE( zb, always, R300_ZB_CMDSIZE, "zb", 0 );
r300->hw.zb.cmd[R300_ZB_CMD_0] = cmducs(R300_RB3D_DEPTHOFFSET, 2);
r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2);
ALLOC_STATE( unk4F28, always, 2, "unk4F28", 0 );
r300->hw.unk4F28.cmd[0] = cmducs(0x4F28, 1);
r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1);
ALLOC_STATE( unk4F30, always, 3, "unk4F30", 0 );
r300->hw.unk4F30.cmd[0] = cmducs(0x4F30, 2);
r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2);
ALLOC_STATE( unk4F44, always, 2, "unk4F44", 0 );
r300->hw.unk4F44.cmd[0] = cmducs(0x4F44, 1);
r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1);
ALLOC_STATE( unk4F54, always, 2, "unk4F54", 0 );
r300->hw.unk4F54.cmd[0] = cmducs(0x4F54, 1);
r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1);
ALLOC_STATE( vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0 );
r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0);
@@ -431,25 +419,25 @@ void r300InitCmdBuf(r300ContextPtr r300)
/* Textures */
ALLOC_STATE( tex.filter, variable, mtu+1, "tex_filter", 0 );
r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmducs(R300_TX_FILTER_0, 0);
r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0);
ALLOC_STATE( tex.unknown1, variable, mtu+1, "tex_unknown1", 0 );
r300->hw.tex.unknown1.cmd[R300_TEX_CMD_0] = cmducs(R300_TX_UNK1_0, 0);
r300->hw.tex.unknown1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_UNK1_0, 0);
ALLOC_STATE( tex.size, variable, mtu+1, "tex_size", 0 );
r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmducs(R300_TX_SIZE_0, 0);
r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0);
ALLOC_STATE( tex.format, variable, mtu+1, "tex_format", 0 );
r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmducs(R300_TX_FORMAT_0, 0);
r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0);
ALLOC_STATE( tex.offset, variable, mtu+1, "tex_offset", 0 );
r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmducs(R300_TX_OFFSET_0, 0);
r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0);
ALLOC_STATE( tex.unknown4, variable, mtu+1, "tex_unknown4", 0 );
r300->hw.tex.unknown4.cmd[R300_TEX_CMD_0] = cmducs(R300_TX_UNK4_0, 0);
r300->hw.tex.unknown4.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_UNK4_0, 0);
ALLOC_STATE( tex.border_color, variable, mtu+1, "tex_border_color", 0 );
r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmducs(R300_TX_BORDER_COLOR_0, 0);
r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0);
/* Setup the atom linked list */

View File

@@ -66,6 +66,53 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int future_hw_tcl_on=0;
int hw_tcl_on=0;
#if 1
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_EXT_blend_minmax
#include "extension_helper.h"
static const struct dri_extension card_extensions[] = {
{"GL_ARB_multisample", GL_ARB_multisample_functions},
{"GL_ARB_multitexture", NULL},
{"GL_ARB_texture_border_clamp", NULL},
{"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
/* disable until we support it, fixes a few things in ut2004 */
/* {"GL_ARB_texture_cube_map", NULL}, */
{"GL_ARB_texture_env_add", NULL},
{"GL_ARB_texture_env_combine", NULL},
{"GL_ARB_texture_env_crossbar", NULL},
{"GL_ARB_texture_env_dot3", NULL},
{"GL_ARB_texture_mirrored_repeat", NULL},
{"GL_ARB_vertex_buffer_object", NULL},
{"GL_ARB_vertex_program", NULL},
#if USE_ARB_F_P == 1
{"GL_ARB_fragment_program", NULL},
#endif
{"GL_EXT_blend_equation_separate", NULL},
{"GL_EXT_blend_func_separate", NULL},
{"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
{"GL_EXT_blend_subtract", NULL},
{"GL_EXT_secondary_color", NULL},
{"GL_EXT_stencil_wrap", NULL},
{"GL_EXT_texture_edge_clamp", NULL},
{"GL_EXT_texture_env_combine", NULL},
{"GL_EXT_texture_env_dot3", NULL},
{"GL_EXT_texture_filter_anisotropic", NULL},
{"GL_EXT_texture_lod_bias", NULL},
{"GL_EXT_texture_mirror_clamp", NULL},
{"GL_EXT_texture_rectangle", NULL},
{"GL_ATI_texture_env_combine3", NULL},
{"GL_ATI_texture_mirror_once", NULL},
{"GL_MESA_pack_invert", NULL},
{"GL_MESA_ycbcr_texture", NULL},
{"GL_NV_blend_square", NULL},
{"GL_NV_vertex_program", NULL},
{"GL_SGIS_generate_mipmap", NULL},
{NULL, NULL}
};
#else
/* Extension strings exported by the R300 driver.
*/
static const char *const card_extensions[] = {
@@ -107,7 +154,7 @@ static const char *const card_extensions[] = {
"GL_SGIS_generate_mipmap",
NULL
};
#endif
extern struct tnl_pipeline_stage _r300_render_stage;
extern struct tnl_pipeline_stage _r300_tcl_stage;
@@ -151,21 +198,42 @@ void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
drm_radeon_mem_alloc_t alloc;
int offset, ret;
/* Free previous buffer */
if (obj->OnCard) {
drm_radeon_mem_free_t memfree;
memfree.region = RADEON_MEM_REGION_GART;
memfree.region_offset = (char *)obj->Data - (char *)rmesa->radeon.radeonScreen->gartTextures.map;
ret = drmCommandWrite(rmesa->radeon.radeonScreen->driScreen->fd,
DRM_RADEON_FREE, &memfree, sizeof(memfree));
if (ret) {
WARN_ONCE("Failed to free GART memroy!\n");
}
obj->OnCard = GL_FALSE;
}
alloc.region = RADEON_MEM_REGION_GART;
alloc.alignment = 4;
alloc.size = size;
alloc.region_offset = &offset;
ret = drmCommandWriteRead( rmesa->radeon.dri.fd, DRM_RADEON_ALLOC, &alloc, sizeof(alloc));
if(ret){
if (ret) {
WARN_ONCE("Ran out of GART memory!\n");
obj->Data = NULL;
_mesa_buffer_data(ctx, target, size, data, usage, obj);
return ;
}
obj->Data = ((char *)rmesa->radeon.radeonScreen->gartTextures.map) + offset;
memcpy(obj->Data, data, size);
if (data)
memcpy(obj->Data, data, size);
obj->Size = size;
obj->Usage = usage;
obj->OnCard = GL_TRUE;
#if 0
fprintf(stderr, "allocated %d bytes at %p, offset=%d\n", size, obj->Data, offset);
#endif
@@ -230,10 +298,13 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
r300InitStateFuncs(&functions);
r300InitTextureFuncs(&functions);
r300InitShaderFuncs(&functions);
if(hw_tcl_on){
#if 0 /* Needs various Mesa changes... */
if (hw_tcl_on) {
functions.BufferData = r300BufferData;
functions.DeleteBuffer = r300DeleteBuffer;
}
#endif
if (!radeonInitContext(&r300->radeon, &functions,
glVisual, driContextPriv, sharedContextPrivate)) {

View File

@@ -174,7 +174,7 @@ struct r300_tex_obj {
GLuint pitch; /* one of the unknown registers.. unknown 1 ?*/
GLuint size; /* npot only */
GLuint format;
GLuint offset; /* Image location in texmem.
GLuint offset; /* Image location in the card's address space.
All cube faces follow. */
GLuint unknown4;
GLuint unknown5;

View File

@@ -64,14 +64,14 @@ void static inline check_space(int dwords)
{
}
static __inline__ uint32_t cmducs(int reg, int count)
static __inline__ uint32_t cmdpacket0(int reg, int count)
{
drm_r300_cmd_header_t cmd;
cmd.unchecked_state.cmd_type = R300_CMD_UNCHECKED_STATE;
cmd.unchecked_state.count = count;
cmd.unchecked_state.reghi = ((unsigned int)reg & 0xFF00) >> 8;
cmd.unchecked_state.reglo = ((unsigned int)reg & 0x00FF);
cmd.packet0.cmd_type = R300_CMD_PACKET0;
cmd.packet0.count = count;
cmd.packet0.reghi = ((unsigned int)reg & 0xFF00) >> 8;
cmd.packet0.reglo = ((unsigned int)reg & 0x00FF);
return cmd.u;
}
@@ -139,7 +139,7 @@ static __inline__ uint32_t cmdpacify(void)
__FUNCTION__); \
cmd_reserved=_n+2; \
cmd_written=1; \
cmd[0].i=cmducs((reg), _n+1); \
cmd[0].i=cmdpacket0((reg), _n+1); \
}
/* Prepare to write a register value to register at address reg.
@@ -201,14 +201,14 @@ static __inline__ uint32_t cmdpacify(void)
}
/* must be sent to switch to 2d commands */
/*
void static inline end_3d(PREFIX_VOID)
{
LOCAL_VARS
(void)cmd_reserved; (void)cmd_written;
cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
0, \ // ??!
1, \
__FUNCTION__); \
cmd[0].header.cmd_type=R300_CMD_END3D;
@@ -220,12 +220,23 @@ LOCAL_VARS
(void)cmd_reserved; (void)cmd_written;
cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
0, \ // ??!
1, \
__FUNCTION__); \
cmd[0].i=cmdcpdelay(count);
}
*/
void static inline cp_wait(PREFIX unsigned char flags)
{
LOCAL_VARS
(void)cmd_reserved; (void)cmd_written;
cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
1, \
__FUNCTION__); \
cmd[0].i=cmdwait(flags);
}
/* fire vertex buffer */
static void inline fire_AOS(PREFIX int vertex_count, int type)

View File

@@ -91,11 +91,11 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
#ifndef CB_DPATH
R300_STATECHANGE(r300, vir[0]);
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
r300->hw.vir[0].cmd[1] = 0x21030003;
R300_STATECHANGE(r300, vir[1]);
((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->packet0.count = 1;
r300->hw.vir[1].cmd[1] = 0xF688F688;
R300_STATECHANGE(r300, vic);
@@ -125,9 +125,17 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
r300->hw.bld.cmd[R300_BLD_CBLEND] = 0;
r300->hw.bld.cmd[R300_BLD_ABLEND] = 0;
if (r300->radeon.radeonScreen->cpp == 4)
cbpitch |= R300_COLOR_FORMAT_ARGB8888;
else
cbpitch |= R300_COLOR_FORMAT_RGB565;
if (r300->radeon.sarea->tiling_enabled)
cbpitch |= R300_COLOR_TILE_ENABLE;
R300_STATECHANGE(r300, cb);
r300->hw.cb.cmd[R300_CB_OFFSET] = cboffset;
r300->hw.cb.cmd[R300_CB_PITCH] = cbpitch | R300_COLOR_UNKNOWN_22_23;
r300->hw.cb.cmd[R300_CB_PITCH] = cbpitch;
R300_STATECHANGE(r300, unk221C);
r300->hw.unk221C.cmd[1] = R300_221C_CLEAR;
@@ -147,7 +155,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
r300->hw.rc.cmd[2] = 0;
R300_STATECHANGE(r300, rr);
((drm_r300_cmd_header_t*)r300->hw.rr.cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.rr.cmd)->packet0.count = 1;
r300->hw.rr.cmd[1] = 0x00004000;
R300_STATECHANGE(r300, cmk);
@@ -174,10 +182,10 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
R300_STATECHANGE(r300, fpi[1]);
R300_STATECHANGE(r300, fpi[2]);
R300_STATECHANGE(r300, fpi[3]);
((drm_r300_cmd_header_t*)r300->hw.fpi[0].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.fpi[1].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.fpi[2].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.fpi[3].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.fpi[0].cmd)->packet0.count = 1;
((drm_r300_cmd_header_t*)r300->hw.fpi[1].cmd)->packet0.count = 1;
((drm_r300_cmd_header_t*)r300->hw.fpi[2].cmd)->packet0.count = 1;
((drm_r300_cmd_header_t*)r300->hw.fpi[3].cmd)->packet0.count = 1;
/* MOV o0, t0 */
r300->hw.fpi[0].cmd[1] = FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO));
@@ -195,7 +203,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT);
R300_STATECHANGE(r300, vpi);
((drm_r300_cmd_header_t*)r300->hw.vpi.cmd)->unchecked_state.count = 8;
((drm_r300_cmd_header_t*)r300->hw.vpi.cmd)->packet0.count = 8;
/* MOV o0, i0; */
r300->hw.vpi.cmd[1] = VP_OUT(ADD,OUT,0,XYZW);
@@ -257,8 +265,13 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
reg_start(R300_RB3D_COLOROFFSET0, 0);
e32(cboffset);
if (r300->radeon.radeonScreen->cpp == 4)
cbpitch |= R300_COLOR_FORMAT_ARGB8888;
else
cbpitch |= R300_COLOR_FORMAT_RGB565;
reg_start(R300_RB3D_COLORPITCH0, 0);
e32(cbpitch | R300_COLOR_UNKNOWN_22_23);
e32(cbpitch);
R300_STATECHANGE(r300, cmk);
reg_start(R300_RB3D_COLORMASK, 0);
@@ -338,6 +351,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
cmd2[6].u = r300PackFloat32(ctx->Color.ClearColor[1]);
cmd2[7].u = r300PackFloat32(ctx->Color.ClearColor[2]);
cmd2[8].u = r300PackFloat32(ctx->Color.ClearColor[3]);
}
#ifdef CB_DPATH

View File

@@ -438,7 +438,7 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd)
}
/* Set the rest of INPUT_ROUTE_0 to 0 */
//for(i=((count+1)>>1); i<8; i++)r300->hw.vir[0].cmd[R300_VIR_CNTL_0+i]=(0x0);
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->unchecked_state.count = (nr+1)>>1;
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = (nr+1)>>1;
/* Mesa assumes that all missing components are from (0, 0, 0, 1) */
@@ -481,7 +481,7 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd)
}
/* Set the rest of INPUT_ROUTE_1 to 0 */
//for(i=((count+1)>>1); i<8; i++)r300->hw.vir[1].cmd[R300_VIR_CNTL_0+i]=0x0;
((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->unchecked_state.count = (nr+1)>>1;
((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->packet0.count = (nr+1)>>1;
/* Set up input_cntl */
/* I don't think this is needed for vertex buffers, but it doesn't hurt anything */

View File

@@ -1,6 +1,27 @@
#ifndef _R300_REG_H
#define _R300_REG_H
#define R300_MC_INIT_MISC_LAT_TIMER 0x180
# define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0
# define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4
# define R300_MC_MISC__MC_DISP0R_INIT_LAT_SHIFT 8
# define R300_MC_MISC__MC_DISP1R_INIT_LAT_SHIFT 12
# define R300_MC_MISC__MC_FIXED_INIT_LAT_SHIFT 16
# define R300_MC_MISC__MC_E2R_INIT_LAT_SHIFT 20
# define R300_MC_MISC__MC_SAME_PAGE_PRIO_SHIFT 24
# define R300_MC_MISC__MC_GLOBW_INIT_LAT_SHIFT 28
#define R300_MC_INIT_GFX_LAT_TIMER 0x154
# define R300_MC_MISC__MC_G3D0R_INIT_LAT_SHIFT 0
# define R300_MC_MISC__MC_G3D1R_INIT_LAT_SHIFT 4
# define R300_MC_MISC__MC_G3D2R_INIT_LAT_SHIFT 8
# define R300_MC_MISC__MC_G3D3R_INIT_LAT_SHIFT 12
# define R300_MC_MISC__MC_TX0R_INIT_LAT_SHIFT 16
# define R300_MC_MISC__MC_TX1R_INIT_LAT_SHIFT 20
# define R300_MC_MISC__MC_GLOBR_INIT_LAT_SHIFT 24
# define R300_MC_MISC__MC_GLOBW_FULL_LAT_SHIFT 28
/*
This file contains registers and constants for the R300. They have been
found mostly by examining command buffers captured using glxtest, as well
@@ -1126,7 +1147,8 @@ I am fairly certain that they are correct unless stated otherwise in comments.
# define R300_COLOR_ENDIAN_NO_SWAP (0 << 18) /* GUESS */
# define R300_COLOR_ENDIAN_WORD_SWAP (1 << 18) /* GUESS */
# define R300_COLOR_ENDIAN_DWORD_SWAP (2 << 18) /* GUESS */
# define R300_COLOR_UNKNOWN_22_23 (3 << 22) /* GUESS: Format? - (6<<21) for RGBA? */
# define R300_COLOR_FORMAT_RGB565 (2 << 22)
# define R300_COLOR_FORMAT_ARGB8888 (3 << 22)
#define R300_RB3D_COLORPITCH1 0x4E3C /* GUESS */
#define R300_RB3D_COLORPITCH2 0x4E40 /* GUESS */
#define R300_RB3D_COLORPITCH3 0x4E44 /* GUESS */
@@ -1194,6 +1216,12 @@ I am fairly certain that they are correct unless stated otherwise in comments.
# define R300_RB3D_ZS2_STENCIL_MASK_SHIFT 8
# define R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT 16
/* gap */
#define R300_RB3D_ZSTENCIL_FORMAT 0x4F10
# define R300_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
# define R300_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)
/* gap */
#define R300_RB3D_DEPTHOFFSET 0x4F20
#define R300_RB3D_DEPTHPITCH 0x4F24

View File

@@ -211,16 +211,19 @@ static int r300_get_num_verts(r300ContextPtr rmesa,
static GLfloat default_vector[4]={0.0, 0.0, 0.0, 1.0};
#define output_vector(v, i) \
{ \
#define output_vector(v, i) { \
int _i; \
for(_i=0;_i<v->size;_i++){ \
efloat(VEC_ELT(v, GLfloat, i)[_i]); \
if(VB->Elts){ \
efloat(VEC_ELT(v, GLfloat, VB->Elts[i])[_i]); \
}else{ \
efloat(VEC_ELT(v, GLfloat, i)[_i]); \
} \
} \
for(_i=v->size;_i<4;_i++){ \
efloat(default_vector[_i]); \
} \
}
efloat(default_vector[_i]); \
} \
}
/* Immediate implementation - vertex data is sent via command stream */
@@ -506,9 +509,6 @@ static GLboolean r300_run_vb_render(GLcontext *ctx,
e32(0x00000003);
r300EmitState(rmesa);
if(hw_tcl_on) /* FIXME */
r300FlushCmdBuf(rmesa, __FUNCTION__);
rmesa->state.Elts = VB->Elts;
for(i=0; i < VB->PrimitiveCount; i++){
@@ -613,6 +613,8 @@ static void r300_check_render(GLcontext *ctx, struct tnl_pipeline_stage *stage)
//FALLBACK_IF(ctx->Polygon.SmoothFlag); // GL_POLYGON_SMOOTH disabling to get blender going
FALLBACK_IF(ctx->Polygon.StippleFlag); // GL_POLYGON_STIPPLE
FALLBACK_IF(ctx->Multisample.Enabled); // GL_MULTISAMPLE_ARB
FALLBACK_IF(ctx->RenderMode != GL_RENDER); // We do not do SELECT or FEEDBACK (yet ?)
#if 0 /* ut2k3 fails to start if this is on */
/* One step at a time - let one texture pass.. */

View File

@@ -1077,19 +1077,19 @@ void r300_setup_textures(GLcontext *ctx)
r300->hw.tex.size.cmd[R300_TEX_VALUE_0+i]=t->size;
r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=t->format;
//fprintf(stderr, "t->format=%08x\n", t->format);
r300->hw.tex.offset.cmd[R300_TEX_VALUE_0+i]=r300->radeon.radeonScreen->fbLocation+t->offset;
r300->hw.tex.offset.cmd[R300_TEX_VALUE_0+i]=t->offset;
r300->hw.tex.unknown4.cmd[R300_TEX_VALUE_0+i]=0x0;
r300->hw.tex.border_color.cmd[R300_TEX_VALUE_0+i]=t->pp_border_color;
}
}
((drm_r300_cmd_header_t*)r300->hw.tex.filter.cmd)->unchecked_state.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.unknown1.cmd)->unchecked_state.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.size.cmd)->unchecked_state.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.format.cmd)->unchecked_state.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.offset.cmd)->unchecked_state.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.unknown4.cmd)->unchecked_state.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.border_color.cmd)->unchecked_state.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.filter.cmd)->packet0.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.unknown1.cmd)->packet0.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.size.cmd)->packet0.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.format.cmd)->packet0.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.offset.cmd)->packet0.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.unknown4.cmd)->packet0.count = max_texture_unit+1;
((drm_r300_cmd_header_t*)r300->hw.tex.border_color.cmd)->packet0.count = max_texture_unit+1;
if (RADEON_DEBUG & DEBUG_STATE)
fprintf(stderr, "TX_ENABLE: %08x max_texture_unit=%d\n", r300->hw.txe.cmd[R300_TXE_ENABLE], max_texture_unit);
@@ -1146,7 +1146,7 @@ void r300_setup_rs_unit(GLcontext *ctx)
| interp_magic[i];
if (InputsRead & (FRAG_BIT_TEX0<<i)) {
assert(r300->state.texture.tc_count != 0);
//assert(r300->state.texture.tc_count != 0);
r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0
| R300_RS_ROUTE_ENABLE
| i /* source INTERP */
@@ -1195,7 +1195,7 @@ void r300_setup_rs_unit(GLcontext *ctx)
| R300_RS_CNTL_0_UNKNOWN_18;
assert(high_rr >= 0);
r300->hw.rr.cmd[R300_RR_CMD_0] = cmducs(R300_RS_ROUTE_0, high_rr+1);
r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, high_rr+1);
r300->hw.rc.cmd[2] = 0xC0 | high_rr;
if (InputsRead)
@@ -1261,10 +1261,10 @@ void r300_setup_rs_unit(GLcontext *ctx)
| R300_RS_CNTL_0_UNKNOWN_18;
if (r300->state.texture.tc_count > 0) {
r300->hw.rr.cmd[R300_RR_CMD_0] = cmducs(R300_RS_ROUTE_0, cur_reg);
r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, cur_reg);
r300->hw.rc.cmd[2] = 0xC0 | (cur_reg-1); /* index of highest */
} else {
r300->hw.rr.cmd[R300_RR_CMD_0] = cmducs(R300_RS_ROUTE_0, 1);
r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1);
r300->hw.rc.cmd[2] = 0x0;
}
@@ -1602,13 +1602,13 @@ void r300SetupPixelShader(r300ContextPtr rmesa)
R300_STATECHANGE(rmesa, fpt);
for(i=0;i<rp->tex.length;i++)
rmesa->hw.fpt.cmd[R300_FPT_INSTR_0+i]=rp->tex.inst[i];
rmesa->hw.fpt.cmd[R300_FPT_CMD_0]=cmducs(R300_PFS_TEXI_0, rp->tex.length);
rmesa->hw.fpt.cmd[R300_FPT_CMD_0]=cmdpacket0(R300_PFS_TEXI_0, rp->tex.length);
#define OUTPUT_FIELD(st, reg, field) \
R300_STATECHANGE(rmesa, st); \
for(i=0;i<=rp->alu_end;i++) \
rmesa->hw.st.cmd[R300_FPI_INSTR_0+i]=rp->alu.inst[i].field;\
rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmducs(reg, rp->alu_end+1);
rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmdpacket0(reg, rp->alu_end+1);
OUTPUT_FIELD(fpi[0], R300_PFS_INSTR0_0, inst0);
OUTPUT_FIELD(fpi[1], R300_PFS_INSTR1_0, inst1);
@@ -1651,7 +1651,7 @@ void r300SetupPixelShader(r300ContextPtr rmesa)
rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+2]=r300PackFloat24(rp->constant[i][2]);
rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+3]=r300PackFloat24(rp->constant[i][3]);
}
rmesa->hw.fpp.cmd[R300_FPP_CMD_0]=cmducs(R300_PFS_PARAM_0_X, rp->const_nr*4);
rmesa->hw.fpp.cmd[R300_FPP_CMD_0]=cmdpacket0(R300_PFS_PARAM_0_X, rp->const_nr*4);
}
#else
/* just a skeleton for now.. */
@@ -1781,13 +1781,13 @@ int i,k;
R300_STATECHANGE(rmesa, fpt);
for(i=0;i<rmesa->state.pixel_shader.program.tex.length;i++)
rmesa->hw.fpt.cmd[R300_FPT_INSTR_0+i]=rmesa->state.pixel_shader.program.tex.inst[i];
rmesa->hw.fpt.cmd[R300_FPT_CMD_0]=cmducs(R300_PFS_TEXI_0, rmesa->state.pixel_shader.program.tex.length);
rmesa->hw.fpt.cmd[R300_FPT_CMD_0]=cmdpacket0(R300_PFS_TEXI_0, rmesa->state.pixel_shader.program.tex.length);
#define OUTPUT_FIELD(st, reg, field) \
R300_STATECHANGE(rmesa, st); \
for(i=0;i<rmesa->state.pixel_shader.program.alu.length;i++) \
rmesa->hw.st.cmd[R300_FPI_INSTR_0+i]=rmesa->state.pixel_shader.program.alu.inst[i].field;\
rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmducs(reg, rmesa->state.pixel_shader.program.alu.length);
rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmdpacket0(reg, rmesa->state.pixel_shader.program.alu.length);
OUTPUT_FIELD(fpi[0], R300_PFS_INSTR0_0, inst0);
OUTPUT_FIELD(fpi[1], R300_PFS_INSTR1_0, inst1);
@@ -1825,7 +1825,7 @@ int i,k;
rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+2]=r300PackFloat32(rmesa->state.pixel_shader.param[i].z);
rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+3]=r300PackFloat32(rmesa->state.pixel_shader.param[i].w);
}
rmesa->hw.fpp.cmd[R300_FPP_CMD_0]=cmducs(R300_PFS_PARAM_0_X, rmesa->state.pixel_shader.param_length);
rmesa->hw.fpp.cmd[R300_FPP_CMD_0]=cmdpacket0(R300_PFS_PARAM_0_X, rmesa->state.pixel_shader.param_length);
}
#endif
@@ -1873,7 +1873,7 @@ void verify_r300ResetHwState(r300ContextPtr r300, int stage)
foreach(atom, &r300->hw.atomlist) {
cmd.u=atom->cmd[0];
switch(cmd.header.cmd_type){
case R300_CMD_UNCHECKED_STATE:
case R300_CMD_PACKET0:
case R300_CMD_VPU:
case R300_CMD_PACKET3:
case R300_CMD_END3D:
@@ -1987,10 +1987,10 @@ void r300ResetHwState(r300ContextPtr r300)
#endif
#if 0 /* Done in setup routing */
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
r300->hw.vir[0].cmd[1] = 0x21030003;
((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->unchecked_state.count = 1;
((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->packet0.count = 1;
r300->hw.vir[1].cmd[1] = 0xF688F688;
r300->hw.vic.cmd[R300_VIR_CNTL_0] = 0x00000001;
@@ -2142,20 +2142,17 @@ void r300ResetHwState(r300ContextPtr r300)
r300->hw.unk4E10.cmd[3] = 0;
/* Again, r300ClearBuffer uses this */
if(ctx->Visual.doubleBufferMode){
r300->hw.cb.cmd[R300_CB_OFFSET] =
r300->radeon.radeonScreen->backOffset +
r300->radeon.radeonScreen->fbLocation;
r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.radeonScreen->backPitch
| R300_COLOR_UNKNOWN_22_23;
} else {
r300->hw.cb.cmd[R300_CB_OFFSET] =
r300->radeon.radeonScreen->frontOffset +
r300->radeon.radeonScreen->fbLocation;
r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.radeonScreen->frontPitch
| R300_COLOR_UNKNOWN_22_23;
}
r300->hw.cb.cmd[R300_CB_OFFSET] = r300->radeon.state.color.drawOffset +
r300->radeon.radeonScreen->fbLocation;
r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.state.color.drawPitch;
if (r300->radeon.radeonScreen->cpp == 4)
r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888;
else
r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565;
if (r300->radeon.sarea->tiling_enabled)
r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_TILE_ENABLE;
r300->hw.unk4E50.cmd[1] = 0;
r300->hw.unk4E50.cmd[2] = 0;
@@ -2172,19 +2169,35 @@ void r300ResetHwState(r300ContextPtr r300)
r300->hw.unk4EA0.cmd[1] = 0x00000000;
r300->hw.unk4EA0.cmd[2] = 0xffffffff;
r300->hw.unk4F10.cmd[1] = 0x00000002; // depthbuffer format?
//r300->hw.unk4F10.cmd[2] = 0x00000000;
switch (ctx->Visual.depthBits) {
case 16:
r300->hw.unk4F10.cmd[1] = R300_DEPTH_FORMAT_16BIT_INT_Z;
break;
case 24:
r300->hw.unk4F10.cmd[1] = R300_DEPTH_FORMAT_24BIT_INT_Z;
break;
default:
fprintf(stderr, "Error: Unsupported depth %d... exiting\n",
ctx->Visual.depthBits);
exit(-1);
}
r300->hw.unk4F10.cmd[3] = 0x00000003;
r300->hw.unk4F10.cmd[4] = 0x00000000;
/* experiment a bit */
//r300->hw.unk4F10.cmd[2] = 0x00000001; // depthbuffer format?
r300->hw.zb.cmd[R300_ZB_OFFSET] =
r300->radeon.radeonScreen->depthOffset +
r300->radeon.radeonScreen->fbLocation;
r300->hw.zb.cmd[R300_ZB_PITCH] = r300->radeon.radeonScreen->depthPitch;
if (r300->radeon.sarea->tiling_enabled) {
/* Turn off when clearing buffers ? */
r300->hw.zb.cmd[R300_ZB_PITCH] |= R300_DEPTH_TILE_ENABLE;
if (ctx->Visual.depthBits == 24)
r300->hw.zb.cmd[R300_ZB_PITCH] |= R300_DEPTH_MICROTILE_ENABLE;
}
r300->hw.unk4F28.cmd[1] = 0;
r300->hw.unk4F30.cmd[1] = 0;
@@ -2259,6 +2272,13 @@ void r300InitState(r300ContextPtr r300)
r300ResetHwState(r300);
}
static void r300RenderMode( GLcontext *ctx, GLenum mode )
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
WARN_ONCE("TODO: fallback properly when rendering mode is not GL_RENDER\n"
"\tThe way things are now neither selection nor feedback modes work\n")
// FALLBACK( rmesa, R300_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
}
/**
* Initialize driver's state callback functions
@@ -2294,5 +2314,7 @@ void r300InitStateFuncs(struct dd_function_table* functions)
functions->PolygonOffset = r300PolygonOffset;
functions->PolygonMode = r300PolygonMode;
functions->RenderMode = r300RenderMode;
}

View File

@@ -673,6 +673,25 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
goto next;
case VP_OPCODE_SUB://ADD RESULT 1.X Y Z W TMP 0{} {X Y Z W} PARAM 1{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W
#if 1
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
o_inst->src1=t_src(vp, &src[0]);
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
SWIZZLE_ONE, SWIZZLE_ONE,
SWIZZLE_ONE, SWIZZLE_ONE,
t_src_class(src[0].File), VSF_FLAG_NONE);
o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
t_swizzle(GET_SWZ(src[1].Swizzle, 2)),
t_swizzle(GET_SWZ(src[1].Swizzle, 3)),
t_src_class(src[1].File),
(!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
#else
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
@@ -685,6 +704,7 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
t_src_class(src[1].File),
(!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
o_inst->src3=0;
#endif
goto next;
case VP_OPCODE_ABS://MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W

View File

@@ -48,6 +48,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r300_ioctl.h"
#include "r200_tcl.h"
#include "r200_sanity.h"
#include "r300_state.h"
#include "radeon_reg.h"
#include "vblank.h"
@@ -237,6 +238,8 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
if (IS_FAMILY_R200(radeon))
R200_FIREVERTICES((r200ContextPtr)radeon);
else
r300Flush(radeon->glCtx);
LOCK_HARDWARE(radeon);
if (!dPriv->numClipRects) {
@@ -295,6 +298,21 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
+ radeon->radeonScreen->fbLocation;
r200->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = radeon->state.color.drawPitch;
}
if (IS_FAMILY_R300(radeon)) {
r300ContextPtr r300 = (r300ContextPtr)radeon;
R300_STATECHANGE(r300, cb);
r300->hw.cb.cmd[R300_CB_OFFSET] = r300->radeon.state.color.drawOffset +
r300->radeon.radeonScreen->fbLocation;
r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.state.color.drawPitch;
if (r300->radeon.radeonScreen->cpp == 4)
r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888;
else
r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565;
if (r300->radeon.sarea->tiling_enabled)
r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_TILE_ENABLE;
}
}
void radeonWaitForIdleLocked(radeonContextPtr radeon)

View File

@@ -202,6 +202,7 @@ static const struct dri_debug_control debug_control[] = {
#define PCI_CHIP_RV350_AP 0x4150
#define PCI_CHIP_RV350_AR 0x4152
#define PCI_CHIP_RV350_AS 0x4153
#define PCI_CHIP_RV350_NJ 0x4E4A
#define PCI_CHIP_RV350_NP 0x4E50
#define PCI_CHIP_RV350_NQ 0x4E51 /* Saphire 9600 256MB card */
#define PCI_CHIP_RV350_NT 0x4E54
@@ -211,6 +212,7 @@ static const struct dri_debug_control debug_control[] = {
#define PCI_CHIP_R300_NF 0x4E46
#define PCI_CHIP_R300_NG 0x4E47
#define PCI_CHIP_R350_NH 0x4E48
#define PCI_CHIP_R420_JI 0x4A49
#define PCI_CHIP_R420_JK 0x4a4b
#endif
@@ -378,6 +380,7 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
case PCI_CHIP_RV350_AP:
case PCI_CHIP_RV350_AR:
case PCI_CHIP_RV350_AS:
case PCI_CHIP_RV350_NJ:
case PCI_CHIP_RV350_NP:
case PCI_CHIP_RV350_NT:
case PCI_CHIP_RV350_NQ:
@@ -393,6 +396,7 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
screen->chipset = RADEON_CHIP_R300;
break;
case PCI_CHIP_R420_JI:
case PCI_CHIP_R420_JK:
screen->chipset = RADEON_CHIP_R420;
break;
@@ -833,11 +837,11 @@ void *__driCreateNewScreen(__DRInativeDisplay * dpy, int scrn,
__GLcontextModes ** driver_modes)
{
__DRIscreenPrivate *psp;
static const __DRIversion ddx_expected = { 4, 0, 0 };
static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 11, 1 };
if (!driCheckDriDdxDrmVersions2("R300",
if (!driCheckDriDdxDrmVersions3("R300",
dri_version, &dri_expected,
ddx_version, &ddx_expected,
drm_version, &drm_expected)) {

View File

@@ -63,6 +63,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_vtxfmt.h"
#include "radeon_maos.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#define DRIVER_DATE "20050528"
#include "vblank.h"
@@ -119,33 +125,33 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
/* Extension strings exported by the R100 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_crossbar",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_blend_logic_op",
"GL_EXT_blend_subtract",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_EXT_texture_mirror_clamp",
"GL_ATI_texture_env_combine3",
"GL_ATI_texture_mirror_once",
"GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_texture_mirror_clamp", NULL },
{ "GL_ATI_texture_env_combine3", NULL },
{ "GL_ATI_texture_mirror_once", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _radeon_texrect_stage;

View File

@@ -78,41 +78,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL( _x, _y ) \
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP( _y ) (height - _y - 1)
#define HW_LOCK()
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
int _nc = dPriv->numClipRects; \
\
while ( _nc-- ) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK()
@@ -123,61 +92,21 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* 16 bit, RGB565 color spanline and pixel functions
*/
#define INIT_MONO_PIXEL(p, color) \
p = PACK_COLOR_565( color[0], color[1], color[2] )
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
*(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \
(((int)g & 0xfc) << 3) | \
(((int)b & 0xf8) >> 3))
#define WRITE_PIXEL( _x, _y, p ) \
*(GLushort *)(buf + _x*2 + _y*pitch) = p
#define READ_RGBA( rgba, _x, _y ) \
do { \
GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
rgba[3] = 0xff; \
} while (0)
#define TAG(x) radeon##x##_RGB565
#include "spantmp.h"
#define TAG(x) radeon##x##_RGB565
#define TAG2(x,y) radeon##x##_RGB565##y
#include "spantmp2.h"
/* 32 bit, ARGB8888 color spanline and pixel functions
*/
#undef INIT_MONO_PIXEL
#define INIT_MONO_PIXEL(p, color) \
p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] )
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
do { \
*(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \
(g << 8) | \
(r << 16) | \
(a << 24) ); \
} while (0)
#define WRITE_PIXEL( _x, _y, p ) \
do { \
*(GLuint *)(buf + _x*4 + _y*pitch) = p; \
} while (0)
#define READ_RGBA( rgba, _x, _y ) \
do { \
volatile GLuint *ptr = (volatile GLuint *)(read_buf + _x*4 + _y*pitch); \
GLuint p = *ptr; \
rgba[0] = (p >> 16) & 0xff; \
rgba[1] = (p >> 8) & 0xff; \
rgba[2] = (p >> 0) & 0xff; \
rgba[3] = (p >> 24) & 0xff; \
} while (0)
#define TAG(x) radeon##x##_ARGB8888
#include "spantmp.h"
#define SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
#define TAG(x) radeon##x##_ARGB8888
#define TAG2(x,y) radeon##x##_ARGB8888##y
#include "spantmp2.h"
/* ================================================================
@@ -368,68 +297,9 @@ static void radeonSpanRenderFinish( GLcontext *ctx )
void radeonInitSpanFuncs( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
swdd->SetBuffer = radeonSetBuffer;
switch ( rmesa->radeonScreen->cpp ) {
case 2:
#if 0
swdd->WriteRGBASpan = radeonWriteRGBASpan_RGB565;
swdd->WriteRGBSpan = radeonWriteRGBSpan_RGB565;
swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_RGB565;
swdd->WriteRGBAPixels = radeonWriteRGBAPixels_RGB565;
swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_RGB565;
swdd->ReadRGBASpan = radeonReadRGBASpan_RGB565;
swdd->ReadRGBAPixels = radeonReadRGBAPixels_RGB565;
#endif
break;
case 4:
#if 0
swdd->WriteRGBASpan = radeonWriteRGBASpan_ARGB8888;
swdd->WriteRGBSpan = radeonWriteRGBSpan_ARGB8888;
swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_ARGB8888;
swdd->WriteRGBAPixels = radeonWriteRGBAPixels_ARGB8888;
swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_ARGB8888;
swdd->ReadRGBASpan = radeonReadRGBASpan_ARGB8888;
swdd->ReadRGBAPixels = radeonReadRGBAPixels_ARGB8888;
#endif
break;
default:
break;
}
switch ( rmesa->glCtx->Visual.depthBits ) {
case 16:
#if 0
swdd->ReadDepthSpan = radeonReadDepthSpan_16;
swdd->WriteDepthSpan = radeonWriteDepthSpan_16;
swdd->ReadDepthPixels = radeonReadDepthPixels_16;
swdd->WriteDepthPixels = radeonWriteDepthPixels_16;
#endif
break;
case 24:
#if 0
swdd->ReadDepthSpan = radeonReadDepthSpan_24_8;
swdd->WriteDepthSpan = radeonWriteDepthSpan_24_8;
swdd->ReadDepthPixels = radeonReadDepthPixels_24_8;
swdd->WriteDepthPixels = radeonWriteDepthPixels_24_8;
swdd->ReadStencilSpan = radeonReadStencilSpan_24_8;
swdd->WriteStencilSpan = radeonWriteStencilSpan_24_8;
swdd->ReadStencilPixels = radeonReadStencilPixels_24_8;
swdd->WriteStencilPixels = radeonWriteStencilPixels_24_8;
#endif
break;
default:
break;
}
swdd->SpanRenderStart = radeonSpanRenderStart;
swdd->SpanRenderFinish = radeonSpanRenderFinish;
}
@@ -443,22 +313,10 @@ radeonSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
{
if (drb->Base.InternalFormat == GL_RGBA) {
if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
drb->Base.GetRow = radeonReadRGBASpan_RGB565;
drb->Base.GetValues = radeonReadRGBAPixels_RGB565;
drb->Base.PutRow = radeonWriteRGBASpan_RGB565;
drb->Base.PutRowRGB = radeonWriteRGBSpan_RGB565;
drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_RGB565;
drb->Base.PutValues = radeonWriteRGBAPixels_RGB565;
drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_RGB565;
radeonInitPointers_RGB565(&drb->Base);
}
else {
drb->Base.GetRow = radeonReadRGBASpan_ARGB8888;
drb->Base.GetValues = radeonReadRGBAPixels_ARGB8888;
drb->Base.PutRow = radeonWriteRGBASpan_ARGB8888;
drb->Base.PutRowRGB = radeonWriteRGBSpan_ARGB8888;
drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_ARGB8888;
drb->Base.PutValues = radeonWriteRGBAPixels_ARGB8888;
drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_ARGB8888;
radeonInitPointers_ARGB8888(&drb->Base);
}
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {

View File

@@ -241,6 +241,13 @@ void radeonChooseVertexState( GLcontext *ctx )
GLuint se_coord_fmt;
/* We must ensure that we don't do _tnl_need_projected_coords while in a
* rasterization fallback. As this function will be called again when we
* leave a rasterization fallback, we can just skip it for now.
*/
if (rmesa->Fallback != 0)
return;
/* HW perspective divide is a win, but tiny vertex formats are a
* bigger one.
*/
@@ -887,7 +894,6 @@ void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
RADEON_FIREVERTICES( rmesa );
TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_TRUE );
_swsetup_Wakeup( ctx );
_tnl_need_projected_coords( ctx, GL_TRUE );
rmesa->swtcl.RenderIndex = ~0;
if (RADEON_DEBUG & DEBUG_FALLBACKS) {
fprintf(stderr, "Radeon begin rasterization fallback: 0x%x %s\n",

View File

@@ -444,7 +444,10 @@ static char *fallbackStrings[] = {
"Texgen unit 0",
"Texgen unit 1",
"Texgen unit 2",
"User disable"
"User disable",
"texture rectangle unit 0",
"texture rectangle unit 1",
"texture rectangle unit 2"
};

View File

@@ -925,7 +925,8 @@ static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
default:
/* Unsupported mode, fallback:
*/
/* fprintf(stderr, "fallback unsupported texgen\n"); */
if (RADEON_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "fallback GL_SPHERE_MAP\n");
return GL_FALSE;
}

View File

@@ -45,23 +45,6 @@
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL( _x, _y ) \
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) \
_i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) \
n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP( _y ) (height - _y - 1)
#if _SPANLOCK /* OK, we lock */
@@ -83,21 +66,6 @@
#endif
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
int _nc = dPriv->numClipRects; \
\
while ( _nc-- ) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
/* ================================================================
* Color buffer

View File

@@ -58,6 +58,10 @@
#include "texmem.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#include "extension_helper.h"
#include "xmlpool.h"
/* Driver-specific options
@@ -127,17 +131,19 @@ unsigned long time_sum=0;
struct timeval tv_s1,tv_f1;
#endif
static const char *const common_extensions[] =
static const struct dri_extension common_extensions[] =
{
"GL_ARB_multitexture",
"GL_EXT_texture_lod_bias",
"GL_ARB_texture_compression",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_EXT_texture_lod_bias", NULL },
{ NULL, NULL }
};
static const char *const s4_extensions[] =
static const struct dri_extension s4_extensions[] =
{
"GL_EXT_texture_env_add",
NULL
{ "GL_ARB_texture_env_add", NULL },
{ NULL, NULL }
};
extern struct tnl_pipeline_stage _savage_texnorm_stage;

View File

@@ -42,6 +42,7 @@
GLubyte *buf = map + \
dPriv->x * cpp + \
dPriv->y * pitch; \
char *read_buf = buf; \
GLuint p; \
(void) p
@@ -58,20 +59,6 @@
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define Y_FLIP(_y) (height - _y - 1)
#define HW_LOCK()
@@ -86,26 +73,9 @@
savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
GLubyte *map = imesa->readMap;
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = imesa->driDrawable; \
int _nc = dPriv->numClipRects; \
while (_nc--) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
/* 16 bit, 565 rgb color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (buf + (_x<<1) + _y*pitch)
#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y)
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
@@ -116,8 +86,6 @@
/* 32 bit, 8888 ARGB color spanline and pixel functions
*/
#define GET_SRC_PTR(_x, _y) (buf + (_x<<2) + _y*pitch)
#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y)
#define SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
@@ -148,7 +116,6 @@
/* 16 bit float depthbuffer functions
*/
#define WRITE_DEPTH( _x, _y, d ) \
@@ -166,7 +133,6 @@
/* 8-bit stencil /24-bit integer depth depthbuffer functions.
* Depth range is reversed. See also savageCalcViewport.
*/
@@ -186,7 +152,6 @@
/* 24 bit float depthbuffer functions
*/
#define WRITE_DEPTH( _x, _y, d ) do { \

View File

@@ -57,16 +57,20 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
#define need_GL_ARB_multisample
#include "extension_helper.h"
int GlobalCurrentHwcx = -1;
int GlobalHwcxCountBase = 1;
int GlobalCmdQueueLen = 0;
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multitexture",
"GL_EXT_texture_lod_bias",
"GL_NV_blend_square",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_NV_blend_square", NULL },
{ NULL, NULL }
};
void

View File

@@ -316,6 +316,8 @@ static void sisCopyBuffer( __DRIdrawablePrivate *dPriv )
int i;
ENGPACKET stEngPacket;
memset(&stEngPacket, 0, sizeof(ENGPACKET));
while ((*smesa->FrameCountPtr) - MMIO_READ(0x8a2c) > SIS_MAX_FRAME_LENGTH)
;

View File

@@ -43,6 +43,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LOCAL_VARS \
sisContextPtr smesa = SIS_CONTEXT(ctx); \
__DRIdrawablePrivate *dPriv = smesa->driDrawable; \
GLuint pitch = smesa->drawPitch; \
char *buf = (char *)(smesa->FbBase + smesa->drawOffset); \
char *read_buf = (char *)(smesa->FbBase + smesa->readOffset); \
GLuint p; \
@@ -50,94 +52,33 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LOCAL_DEPTH_VARS \
sisContextPtr smesa = SIS_CONTEXT(ctx); \
__DRIdrawablePrivate *dPriv = smesa->driDrawable; \
char *buf = smesa->depthbuffer; \
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
_y >= miny && _y < maxy)
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
if ( _y < miny || _y >= maxy ) { \
_n1 = 0, _x1 = x; \
} else { \
_n1 = _n; \
_x1 = _x; \
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
}
#define HW_LOCK() do {} while(0);
#define HW_CLIPLOOP() \
do { \
__DRIdrawablePrivate *dPriv = smesa->driDrawable; \
int _nc = dPriv->numClipRects; \
\
while ( _nc-- ) { \
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
#define HW_ENDCLIPLOOP() \
} \
} while (0)
#define HW_UNLOCK() do {} while(0);
/* RGB565 */
#define INIT_MONO_PIXEL(p, color) \
p = SISPACKCOLOR565( color[0], color[1], color[2] )
#define SPANTMP_PIXEL_FMT GL_RGB
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
*(GLushort *)(buf + _x*2 + _y*smesa->drawPitch) = \
(((r & 0xf8) << 8) | \
((g & 0xfc) << 3) | \
(b >> 3))
#define WRITE_PIXEL( _x, _y, p ) \
*(GLushort *)(buf + _x*2 + _y*smesa->drawPitch) = p
#define READ_RGBA( rgba, _x, _y ) \
do { \
GLushort p = *(GLushort *)(read_buf + _x*2 + _y*smesa->readPitch); \
rgba[0] = (p & 0xf800) >> 8; \
rgba[1] = (p & 0x07e0) >> 3; \
rgba[2] = (p & 0x001f) << 3; \
rgba[3] = 0xff; \
} while(0)
#define TAG(x) sis##x##_565
#include "spantmp.h"
#define TAG(x) sis##x##_RGB565
#define TAG2(x,y) sis##x##_RGB565##y
#include "spantmp2.h"
/* ARGB8888 */
#undef INIT_MONO_PIXEL
#define INIT_MONO_PIXEL(p, color) \
p = SISPACKCOLOR8888( color[0], color[1], color[2], color[3] )
/* FIXME the old code always read back alpha as 0xff, i.e. fully opaque.
Was there a reason to do so ? If so that'll won't work with that template... */
#define SPANTMP_PIXEL_FMT GL_BGRA
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
*(GLuint *)(buf + _x*4 + _y*smesa->drawPitch) = \
(((a) << 24) | \
((r) << 16) | \
((g) << 8) | \
((b)))
#define WRITE_PIXEL( _x, _y, p ) \
*(GLuint *)(buf + _x*4 + _y*smesa->drawPitch) = p
#define READ_RGBA( rgba, _x, _y ) \
do { \
GLuint p = *(GLuint *)(read_buf + _x*4 + _y*smesa->readPitch); \
rgba[0] = (p >> 16) & 0xff; \
rgba[1] = (p >> 8) & 0xff; \
rgba[2] = (p >> 0) & 0xff; \
rgba[3] = 0xff; \
} while(0)
#define TAG(x) sis##x##_8888
#include "spantmp.h"
#define TAG(x) sis##x##_ARGB8888
#define TAG2(x,y) sis##x##_ARGB8888##y
#include "spantmp2.h"
/* 16 bit depthbuffer functions.
@@ -238,89 +179,9 @@ void sisSpanRenderFinish( GLcontext *ctx )
void
sisDDInitSpanFuncs( GLcontext *ctx )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
swdd->SetBuffer = sisDDSetBuffer;
switch (smesa->zFormat)
{
case SiS_ZFORMAT_Z16:
#if 0
swdd->ReadDepthSpan = sisReadDepthSpan_16;
swdd->ReadDepthPixels = sisReadDepthPixels_16;
swdd->WriteDepthSpan = sisWriteDepthSpan_16;
swdd->WriteDepthPixels = sisWriteDepthPixels_16;
swdd->ReadStencilSpan = NULL;
swdd->ReadStencilPixels = NULL;
swdd->WriteStencilSpan = NULL;
swdd->WriteStencilPixels = NULL;
#endif
break;
case SiS_ZFORMAT_Z32:
#if 0
swdd->ReadDepthSpan = sisReadDepthSpan_32;
swdd->ReadDepthPixels = sisReadDepthPixels_32;
swdd->WriteDepthSpan = sisWriteDepthSpan_32;
swdd->WriteDepthPixels = sisWriteDepthPixels_32;
swdd->ReadStencilSpan = NULL;
swdd->ReadStencilPixels = NULL;
swdd->WriteStencilSpan = NULL;
swdd->WriteStencilPixels = NULL;
#endif
break;
case SiS_ZFORMAT_S8Z24:
#if 0
swdd->ReadDepthSpan = sisReadDepthSpan_24_8;
swdd->ReadDepthPixels = sisReadDepthPixels_24_8;
swdd->WriteDepthSpan = sisWriteDepthSpan_24_8;
swdd->WriteDepthPixels = sisWriteDepthPixels_24_8;
swdd->ReadStencilSpan = sisReadStencilSpan_24_8;
swdd->ReadStencilPixels = sisReadStencilPixels_24_8;
swdd->WriteStencilSpan = sisWriteStencilSpan_24_8;
swdd->WriteStencilPixels = sisWriteStencilPixels_24_8;
#endif
break;
}
#if 0
switch ( smesa->bytesPerPixel )
{
case 2:
swdd->WriteRGBASpan = sisWriteRGBASpan_565;
swdd->WriteRGBSpan = sisWriteRGBSpan_565;
swdd->WriteMonoRGBASpan = sisWriteMonoRGBASpan_565;
swdd->WriteRGBAPixels = sisWriteRGBAPixels_565;
swdd->WriteMonoRGBAPixels = sisWriteMonoRGBAPixels_565;
swdd->ReadRGBASpan = sisReadRGBASpan_565;
swdd->ReadRGBAPixels = sisReadRGBAPixels_565;
break;
case 4:
swdd->WriteRGBASpan = sisWriteRGBASpan_8888;
swdd->WriteRGBSpan = sisWriteRGBSpan_8888;
swdd->WriteMonoRGBASpan = sisWriteMonoRGBASpan_8888;
swdd->WriteRGBAPixels = sisWriteRGBAPixels_8888;
swdd->WriteMonoRGBAPixels = sisWriteMonoRGBAPixels_8888;
swdd->ReadRGBASpan = sisReadRGBASpan_8888;
swdd->ReadRGBAPixels = sisReadRGBAPixels_8888;
break;
default:
sis_fatal_error("Bad bytesPerPixel.\n");
break;
}
swdd->WriteCI8Span = NULL;
swdd->WriteCI32Span = NULL;
swdd->WriteMonoCISpan = NULL;
swdd->WriteCI32Pixels = NULL;
swdd->WriteMonoCIPixels = NULL;
swdd->ReadCI32Span = NULL;
swdd->ReadCI32Pixels = NULL;
#endif
swdd->SpanRenderStart = sisSpanRenderStart;
swdd->SpanRenderFinish = sisSpanRenderFinish;
}
@@ -335,22 +196,10 @@ sisSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
{
if (drb->Base.InternalFormat == GL_RGBA) {
if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
drb->Base.GetRow = sisReadRGBASpan_565;
drb->Base.GetValues = sisReadRGBAPixels_565;
drb->Base.PutRow = sisWriteRGBASpan_565;
drb->Base.PutRowRGB = sisWriteRGBSpan_565;
drb->Base.PutMonoRow = sisWriteMonoRGBASpan_565;
drb->Base.PutValues = sisWriteRGBAPixels_565;
drb->Base.PutMonoValues = sisWriteMonoRGBAPixels_565;
sisInitPointers_RGB565( &drb->Base );
}
else {
drb->Base.GetRow = sisReadRGBASpan_8888;
drb->Base.GetValues = sisReadRGBAPixels_8888;
drb->Base.PutRow = sisWriteRGBASpan_8888;
drb->Base.PutRowRGB = sisWriteRGBSpan_8888;
drb->Base.PutMonoRow = sisWriteMonoRGBASpan_8888;
drb->Base.PutValues = sisWriteRGBAPixels_8888;
drb->Base.PutMonoValues = sisWriteMonoRGBAPixels_8888;
sisInitPointers_ARGB8888( &drb->Base );
}
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {

Some files were not shown because too many files have changed in this diff Show More