Compare commits

...

1993 Commits

Author SHA1 Message Date
Ian Romanick
ba167f812c mesa: set version string to 7.7-rc1
Also modify the Makefile to use the correct version for the tarballs.
2009-12-07 17:18:56 -08:00
Ian Romanick
8fc433fa0f Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	progs/demos/projtex.c
	progs/xdemos/glxinfo.c
	src/mesa/main/version.h

To fix the confilicts in projtex.c and glxinfo.c I just took the code from
mesa_7_6_branch.  The conflicts seem to have occured from cherry-picks from
mesa_7_7_branch to mesa_7_6_branch followed by commmits just to
mesa_7_6_branch.
2009-12-07 17:16:10 -08:00
Ian Romanick
bb64c9bcdf Revert "intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers."
This reverts commit 4598942b1b.

XRGB8888 doesn't work as intended.  Revert this for now, and we'll revisit it
for 7.8 or something.
2009-12-07 17:06:07 -08:00
Ian Romanick
9dbd47fc6b mesa: set version string to 7.6.1-rc3 2009-12-07 16:59:59 -08:00
Maciej Cencora
9921b3048e radeon: fix cases when only first image where put directly into miptree.
Make sure that minimal width, height and depth of texture image is 1.
2009-12-07 22:33:11 +01:00
Maciej Cencora
013cf1d63d radeon: fix image migration for small compressed textures
memcpy would give incorrect results if src rowstride != dst rowstride
2009-12-07 22:29:11 +01:00
Vinson Lee
7d84169865 progs/demos: Fix memory leak in projtex.c. 2009-12-07 12:31:08 -08:00
Vinson Lee
7005f7cd1a st/egl: Fix memory leak in egl_tracker.c.
(cherry picked from commit 052b127842)
2009-12-06 01:15:24 -08:00
Vinson Lee
c994f08eb1 dri: Fix potential null pointer dereference in driBindContext.
(cherry picked from commit 919898e92f)
2009-12-06 01:01:55 -08:00
Vinson Lee
f622b649fb dri: Fix potential null pointer deference in dri_put_drawable.
(cherry picked from commit 364070b1f2)
2009-12-06 01:00:20 -08:00
Vinson Lee
76b3523d75 glx: Prevent potential null pointer deference in driCreateContext.
(cherry picked from commit 4b0b250aae)
2009-12-06 00:56:20 -08:00
Vinson Lee
978b80c8e3 progs/tests: Add tests to Makefile.
(cherry picked from commit 76d2ec3a0a)
2009-12-05 21:20:54 -08:00
Vinson Lee
3cd745515e draw: Initialize variable in draw_pt.c.
(cherry picked from commit ea98e9820d)
2009-12-05 15:11:41 -08:00
Vinson Lee
b2953ee1a6 mesa: Fix array out-of-bounds access by _mesa_TexGenf.
_mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument
as an array.
(cherry picked from commit ca5a7aadb4)
2009-12-05 13:00:35 -08:00
Vinson Lee
d74cd04e61 mesa: Fix array out-of-bounds access by _mesa_TexGeni.
_mesa_TexGeni calls _mesa_TexGeniv, which uses the params argument
as an array.
(cherry picked from commit d55fb7c835)
2009-12-05 12:59:34 -08:00
Vinson Lee
ca8a2150c7 mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameterf, which uses the params
argument as an array.
(cherry picked from commit 270d36da14)
2009-12-05 12:50:56 -08:00
Vinson Lee
4071d065c2 mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameteri, which uses the params
argument as an array.
(cherry picked from commit a201dfb6bf)
2009-12-05 12:47:40 -08:00
Vinson Lee
1446f30875 progs/samples: Fix memory leak if malloc fails in rgbtoppm.c. 2009-12-05 01:43:29 -08:00
Vinson Lee
412aeeed1c progs/samples: Fix memory leak if fopen fails in rgbtoppm.c. 2009-12-05 01:38:14 -08:00
Vinson Lee
6212c8103a progs/samples: Add rgbtoppm to Makefile. 2009-12-05 01:28:47 -08:00
Vinson Lee
2cd2341ce8 progs/tests: Removed unused variable from texdown.c. 2009-12-05 01:23:05 -08:00
Vinson Lee
d642edd2d1 progs/vpglsl: Assign glGetUniformLocationARB return value to GLint.
The return type of glGetUniformLocationARB is GLint, not GLuint.
2009-12-05 01:11:26 -08:00
Vinson Lee
8d2f3434c5 progs/fp: Redraw upon keypress. 2009-12-04 23:31:39 -08:00
Vinson Lee
fe8e18bcd4 mesa: Fix array out-of-bounds access in _mesa_TexEnvf.
_mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument
as an array.
(cherry picked from commit a11d60d14c)
2009-12-04 17:48:30 -08:00
Vinson Lee
4fb5ae7233 progs/util: Fix memory leak if fread returns 0 in CompileShaderFile.
(cherry picked from commit 11905da883)
2009-12-04 17:35:00 -08:00
Vinson Lee
5683d7d43f progs/util: Fix memory leak if fail to load/compile shader
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c475079ef2)
2009-12-04 17:32:48 -08:00
Vinson Lee
e5bc2a19bd progs/fp: Add tri-inv.c to Makefile. 2009-12-04 17:29:53 -08:00
Coleman Kane
225bc70b77 r300g: use $(MAKE) variable
Fixes bug 24501
2009-12-04 08:45:04 -07:00
Brian Paul
ca7cd3ade0 progs/xdemos: fix some visual/fbconfig logic in glxinfo.c
The fbAttribSingle/Double arrays had wrong GLX_DOUBLEBUFFER values.
We only need to use the glXChooseFBConfig() code when glXChooseVisual()
fails (but I don't know when that would happen).
Other recent commits errantly removed some code in this area too.
2009-12-04 08:09:57 -07:00
Brian Paul
fb83fa26c4 docs: a few more fixes for 7.6.1 2009-12-04 08:09:07 -07:00
Alex Deucher
8d8fd9776e radeon: fix polygon stipple
fixes fdo bug 25354

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-12-04 09:52:37 -05:00
Jakob Bornecrantz
1ef8c493b2 vmware/xorg: Use Write instead of WriteRead for cursor bypass 2009-12-04 10:33:34 +01:00
Jakob Bornecrantz
cd4d806a47 vmware/xorg: Give kernel infromation about cursor bypass 2009-12-04 09:54:51 +01:00
Jakob Bornecrantz
12fdef20b0 vmware/xorg: Handle no init of video in vmw_video_close 2009-12-04 09:54:50 +01:00
Jakob Bornecrantz
47e128331a vmware/core: Update vmwgfx_drm.h to include cursor bypass 2009-12-04 09:54:50 +01:00
Jakob Bornecrantz
bc0532b0ed gallium: DRI drivers enabled by default, Xorg drivers auto by default.
This change enabled gallium dri drivers by default under the
configure build system. Xorg drivers are built automaticaly
if a Xorg dev enviroment is installed and the Xorg version
is higher then 1.6.0.
2009-12-04 19:02:41 +00:00
Jakob Bornecrantz
8ac2503397 i915g: Do not build winsys and binaries by default
Using a hack in the configure script the gallium intel
drivers have 3 options. Off, nothing is built. On, the
driver and binaries are built. Auto, only the driver but
not the binaries and winsys is built.

Since the i915g driver builds everywhere its can enable
the driver per default, so we can get build coverage.
But building the binaries per default is a pain for
distributions and testers since they conflict on the
install target with the old mesa drivers. Which are more
stable/faster/better.

So this change gives us the best of both worlds.
2009-12-04 16:01:41 +00:00
Vinson Lee
c74afe0c46 glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore.
(cherry picked from commit 808f037660)
2009-12-04 00:14:31 -08:00
Vinson Lee
8df551c46b glu/sgi: Fix memory leak in gluBuild1DMipmapLevelsCore.
(cherry picked from commit 94bcb9f1a4)
2009-12-04 00:14:05 -08:00
Vinson Lee
ea487c6d0b glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore.
(cherry picked from commit 0d89f3dc7f)
2009-12-04 00:13:25 -08:00
Vinson Lee
7b5eba453e glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore.
(cherry picked from commit f895abbd97)
2009-12-04 00:12:49 -08:00
Vinson Lee
7ed749c062 glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore.
(cherry picked from commit 326b66d724)
2009-12-04 00:11:58 -08:00
Vinson Lee
80a3944a4d glu/sgi: Fix memory leak in bitmapBuild2DMipmaps.
(cherry picked from commit 5b925b7daa)
2009-12-04 00:11:02 -08:00
Vinson Lee
6c1fc2b2a5 glu/sgi: Fix memory leak in gluScaleImage3D.
(cherry picked from commit b611f639b4)
2009-12-04 00:10:22 -08:00
Vinson Lee
fe38c16021 glu/sgi: Fix memory leak in gluScaleImage.
(cherry picked from commit a9c540f5de)
2009-12-04 00:09:22 -08:00
Vinson Lee
d23bb22f62 glu: Fix memory leak in __gl_meshMakeEdge.
(cherry picked from commit d3b4c99c70)
2009-12-04 00:07:51 -08:00
Vinson Lee
12a440abfb progs/xdemos: Silence unused value warnings in sharedtex_mt.c.
(cherry picked from commit 8556fad751)
2009-12-04 00:04:38 -08:00
Vinson Lee
4bf96ebdae progs/xdemos: Fix memory leak in pbdemo.c.
(cherry picked from commit e0857962b9)
2009-12-04 00:03:14 -08:00
Vinson Lee
ba3fedf246 progs/xdemos: Add missing break statement in offset.c.
(cherry picked from commit 4ab8dbe593)
2009-12-04 00:01:20 -08:00
Vinson Lee
8350648401 progs/xdemos: Remove duplicate code in glxinfo.c.
(cherry picked from commit a4720a1a32)
2009-12-03 23:59:47 -08:00
Vinson Lee
7324c22024 progs/xdemos: Fix memory leak in glxinfo.c.
(cherry picked from commit f080567f4c)
2009-12-03 23:59:11 -08:00
Vinson Lee
68d206fafa progs/xdemos: Add assert in corender.c.
(cherry picked from commit 66a4ec14c3)
2009-12-03 23:22:47 -08:00
Vinson Lee
69ed1147a8 progs/vp: Fix memory leak in vp-tris.c.
(cherry picked from commit 760cf71572)
2009-12-03 23:20:18 -08:00
Vinson Lee
efb582fde7 progs/tests: Fix memory leak in texdown.c if malloc fails.
(cherry picked from commit e3cfd78969)
2009-12-03 23:17:26 -08:00
Vinson Lee
b210739aad progs/redbook: Fix memory leak in quadric.c.
(cherry picked from commit 47b5f584a6)
2009-12-03 23:12:59 -08:00
Vinson Lee
b1a87a3e0b progs/glsl: Fix memory leak in deriv.c.
(cherry picked from commit 0e783c7d03)
2009-12-03 22:54:35 -08:00
Vinson Lee
25fd168f03 progs/glsl: Change tangentAttrib from GLuint to GLint in bump.c.
tangentAtrrib is assigned the result of glGetAttribLocation.
The assertion 'assert(tangentAtrrib >= 0)' would be a no-op if
tangentAttrib is a GLuint.
(cherry picked from commit b8dcb79c53)
2009-12-03 22:51:43 -08:00
Vinson Lee
b803abbaad progs/demos: Fix memory leak in ray.c.
(cherry picked from commit 6b480dc21d)
2009-12-03 22:49:18 -08:00
Vinson Lee
5820dae4ec progs/demos: Fix memory leak in projtex.c.
(cherry picked from commit ee555e3d69)
2009-12-03 22:44:55 -08:00
Vinson Lee
fc5f07de1a progs/demos: Fix memory leak in ipers.c.
(cherry picked from commit a1afe303de)
2009-12-03 22:38:44 -08:00
Vinson Lee
d245a951f3 progs/demos: Fix memory leak in fslight.c.
(cherry picked from commit aef3218f0b)
2009-12-03 22:36:37 -08:00
Vinson Lee
905e12f3cc gallium/util: Initialize variables in u_pack_color.h.
(cherry picked from commit 36e2074b63)
2009-12-03 17:55:59 -08:00
Vinson Lee
56de7e222e progs/trivial: Redraw upon keypress.
(cherry picked from commit 9553a42f63)
2009-12-03 17:27:24 -08:00
Vinson Lee
34a0b22a74 progs/trivial: Redraw upon keypress.
(cherry picked from commit 3790c6a13b)
2009-12-03 17:25:00 -08:00
Vinson Lee
9e29242331 progs/glsl: Redraw upon keypress.
(cherry picked from commit 881f55236a)
2009-12-03 17:17:24 -08:00
Vinson Lee
a0ac8fc7d8 progs/util: Exit RawImageGetData early if malloc fails.
Prevents a null pointer deference later on.
(cherry picked from commit e26135a744)
2009-12-03 17:14:08 -08:00
Vinson Lee
0a6acecb35 progs/util: Fix memory leak if malloc fails in RawImageOpen.
(cherry picked from commit d36cb2396c)
2009-12-03 17:08:48 -08:00
Vinson Lee
305d4f147e progs/util: Fix memory leak if fopen fails in RawImageOpen.
(cherry picked from commit d9508e8df9)
2009-12-03 17:03:26 -08:00
Vinson Lee
772e004781 progs/util: Fix memory leak if malloc fails in tkRGBImageLoad.
(cherry picked from commit 786d539511)
2009-12-03 16:57:17 -08:00
Vinson Lee
f1172c4030 progs/util: Fix memory leak if LoadRGBImage fails.
(cherry picked from commit 041cd0e110)
2009-12-03 16:24:03 -08:00
Vinson Lee
84de1672d3 progs/util: Fix memory if LoadRGBMipmaps2 fails.
(cherry picked from commit 28b8e4bcd7)
2009-12-03 16:15:22 -08:00
Vinson Lee
4ca8e1680e progs/util: Fix memory leak if LoadYUVImage fails.
(cherry picked from commit 0e790ac353)
2009-12-03 16:03:22 -08:00
Vinson Lee
d6a993135f progs/fp: Redraw upon keypress.
(cherry picked from commit cde6643724)
2009-12-03 15:59:56 -08:00
Vinson Lee
005242f166 prog/tests: Fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9c3197ef0a)
2009-12-03 15:53:13 -08:00
Vinson Lee
d3208678c2 progs/tests: fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a8ed066858)
2009-12-03 15:50:36 -08:00
Vinson Lee
97cbf4943a progs/tests: Fix MSVC build.
(cherry picked from commit 50e113e375)
2009-12-03 15:45:18 -08:00
Vinson Lee
a99bf51bc8 progs/tests: Fix MSVC build.
(cherry picked from commit 952bf63e2c)
2009-12-03 15:35:10 -08:00
José Fonseca
28474e1225 progs/tests: Use rand() instead of random().
Forgot these on previous commit.
(cherry picked from commit 166957abeb)
2009-12-03 15:34:38 -08:00
José Fonseca
bb6e3af939 progs/tests: Use rand() instead of random().
More portable. Same implementation on Linux.
(cherry picked from commit 699260b195)
2009-12-03 15:32:45 -08:00
Vinson Lee
a38776419b progs/tests: Fix MSVC build.
(cherry picked from commit f7455ad7af)
2009-12-03 15:29:01 -08:00
Vinson Lee
791b754687 prog/tests: Fix MSVC build.
(cherry picked from commit 60b6c74583)
2009-12-03 15:24:43 -08:00
Vinson Lee
89e747920f prog/tests: Fix MSVC build.
(cherry picked from commit 96fd13c1a0)
2009-12-03 15:15:12 -08:00
Vinson Lee
5a25adb646 progs/tests: fix MSVC build.
(cherry picked from commit 9c778a90ea)
2009-12-03 15:11:25 -08:00
Vinson Lee
3910e88ebf prog/tests: Fix MSVC build.
(cherry picked from commit ea862ec8ff)
2009-12-03 15:05:44 -08:00
Maciej Cencora
6c41bb25a2 radeon: workaround an FBO issue
Fixes #21501
2009-12-03 20:23:22 +01:00
Maciej Cencora
8cde43eb19 radeon: properly check if image should be placed in the miptree
Fixes #25355
2009-12-03 20:23:22 +01:00
Alex Deucher
2b5618fc5b r200: fix polygon stipple
fixes fdo bug 25354

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-12-03 11:20:40 -05:00
Vinson Lee
c3b7f93e02 scons: Add Mac OS to target platform list.
(cherry picked from commit 2c307c7750)
2009-12-02 20:33:32 -08:00
Vinson Lee
235c0c8134 progs/vpglsl: Fix psiz-mul.glsl compilation error on Mac OS.
(cherry picked from commit b98db7bf69)
2009-12-02 20:28:54 -08:00
Vinson Lee
0a107d36c2 progs/glsl: Fix trirast GLSL compilation errors on Mac OS.
(cherry picked from commit 4b3ec2acf2)
2009-12-02 20:20:12 -08:00
Vinson Lee
b094683e7c progs/glsl: Fix noise GLSL compilation error on Mac OS.
(cherry picked from commit 0d31990b47)
2009-12-02 20:16:51 -08:00
Vinson Lee
592c8522a2 demos/glsl: Add missing break statement to noise test.
(cherry picked from commit 7dfea5c072)
2009-12-02 20:16:41 -08:00
Vinson Lee
8f4d3613da progs/glsl: Fix multinoise GLSL compilation errors on Mac OS.
(cherry picked from commit d4dc2e30da)
2009-12-02 20:06:20 -08:00
Vinson Lee
9ed77d12b1 progs/glsl: Add missing break statement in multinoise.c.
(cherry picked from commit 43080e40aa)
2009-12-02 20:06:11 -08:00
Vinson Lee
832593772d progs/glsl: Fix mandelbrot GLSL compilation error on Mac OS.
(cherry picked from commit 04442841fb)
2009-12-02 19:55:48 -08:00
Vinson Lee
2a5cd95e24 progs/glsl: Include local headers before installed headers during compilation.
Fixes compilation errors on platforms with insufficient older installed
GL headers.
(cherry picked from commit d17af7d1e1)
2009-12-02 19:39:25 -08:00
Brian Paul
ccea09cd3a progs/glsl: minor Makefile clean-ups
(cherry picked from commit 4df2f7af5e)
2009-12-02 19:39:11 -08:00
Vinson Lee
67a0628ab2 progs: Ignore Mac OS dSYM directories.
(cherry picked from commit a420056750)
2009-12-02 15:22:34 -08:00
Brian Paul
908a3e56cc cell: added tex_usage param to xm_surface_buffer_create() 2009-12-02 09:31:26 -07:00
Jakob Bornecrantz
0c75854cc1 Merge commit 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	src/mesa/main/version.h
2009-12-02 14:52:51 +01:00
Eric Anholt
4598942b1b intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. 2009-12-02 16:19:37 -08:00
Eric Anholt
db352f58fa mesa: Fix bad conversion in AL1616_REV texstore. 2009-12-02 16:19:36 -08:00
Eric Anholt
b47f7316da mesa: Fix copy'n'paste problem in al1616 texel fetch. 2009-12-02 16:19:36 -08:00
Brian Paul
ba97b98842 progs/demos: remove unused glFogCoordPointer_ext var 2009-12-01 12:23:07 -07:00
Tom Fogal
b9f4a0bd2b Simplify hackery added to fix AIX build.
Borrow an idiom from the GNU build system which can handle `for'
loops over empty lists.
2009-12-01 10:27:27 -08:00
Ian Romanick
d8da270a2b intel: Remove GL_NV_point_sprite from extension list
i830 does not (and cannot!) support the any of the non-default
GL_POINT_SPRITE_R_MODE_NV settings.  i915 and i965 could, but
currently do not.  In both cases it would require mucking about with
the fragment shader.
2009-12-01 10:25:44 -08:00
Jakob Bornecrantz
77ff3a5619 vmware/xorg: Add video support
By using the hooks st/xorg provides us we can create a driver
specific implementation that uses the svga overlay engines.
2009-12-01 17:29:42 +01:00
Jakob Bornecrantz
64102a5625 vmware/xorg: Create a small driver that sits ontop of st/xorg 2009-12-01 17:29:42 +01:00
Jakob Bornecrantz
bb80a93c9e st/xorg: Create winsys hooks that we call into 2009-12-01 17:29:41 +01:00
Jakob Bornecrantz
232e59ca6f vmware/core: Update vmwgfx_drm.h to latest version 2009-12-01 17:29:41 +01:00
Jakob Bornecrantz
9077ddaa25 svga: Add header files for overlay support 2009-12-01 17:29:40 +01:00
Eric Anholt
a7e4a311e9 intel: Fix more front-buffer rendering after Brian's less flushing patch.
bcbfda71b0 left out many blit paths.
This fixes up more of them to get Blender to work again.

Bug #25030.
2009-12-02 11:58:57 -08:00
José Fonseca
b2581dcab4 wgl: Call st_swapbuffers instead of st_notify_swapbuffers.
This will get single buffer, double buffer, and
joint single/double buffer (typical in CAD applications) done right,
at least as far as the frambuffer is concerned.

There are still problems with multiple contexts using the same
framebuffer because st_framebuffer_* calls assume the framebuffer
is bound to a single context.
2009-12-02 17:05:20 +00:00
Dave Airlie
e84dddde9b Revert "radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode"
This reverts commit 286bf89e5a.

This doesn't appear to be correct, regression so revert it.
http://bugs.freedesktop.org/show_bug.cgi?id=25193
2009-12-02 11:03:22 +10:00
Brian Paul
c8cdce6657 vbo: make flush recursion check code per-context
This fixes invalid failed assertions when running multi-threaded apps.
2009-12-01 13:27:32 -07:00
Brian Paul
8c26cefec7 st/mesa: updated emit_swz() comment 2009-12-01 12:23:28 -07:00
Ian Romanick
f17dbe256b mesa: set version string to 7.7-rc1 2009-11-30 17:56:07 -08:00
Ian Romanick
910aaed4da mesa: set version string to 7.6.1-rc2 2009-11-30 17:55:21 -08:00
Ian Romanick
650e02003f Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	progs/util/shaderutil.c
	src/mesa/drivers/dri/r600/r600_context.c
	src/mesa/main/version.h
2009-11-30 17:47:07 -08:00
Ian Romanick
587a52e95b i915: Actually put i915PointParameterfv in the driver function table. Duh. 2009-11-30 12:43:12 -08:00
Vinson Lee
270d36da14 mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameterf, which uses the params
argument as an array.
2009-11-29 21:17:44 -05:00
Ian Romanick
533b766007 i915: Fallback bit define missed on previous commit 2009-11-29 17:49:55 -08:00
Ian Romanick
718f31b830 i915: Round point sizes instead of truncate. 2009-11-29 17:43:38 -08:00
Ian Romanick
d8d49716cf i915: Enable point sprite coordinate generation
Support still isn't completely correct, but it's better.  piglit
point-sprite now passes.  However, glean's pointSprite test fails.  In
that test the texture on the sprite is somehow inverted as though
GL_POINT_SPRITE_COORD_ORIGIN were set to GL_LOWER_LEFT.  i915 hardware
shouldn't be able to do that!

I believe there are also problems when not all texture units have
GL_COORD_REPLACE set.  The hardware enable seems to be all or nothing.

Fixes bug #25313.
2009-11-29 17:40:02 -08:00
Vinson Lee
a201dfb6bf mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameteri, which uses the params
argument as an array.
2009-11-29 18:18:23 -05:00
Maciej Cencora
63c00c53a3 radeon: update miptree code a little
Simplify gl image level <-> miptree level mapping (are equal now).
Don't allocate miptree for images that won't fit in it (fixes #25230).
2009-11-29 17:27:48 +01:00
Maciej Cencora
2773556d55 radeon: don't check the same miptree many times when looking for matching miptrees 2009-11-29 17:27:47 +01:00
Maciej Cencora
e8f0c8ab9d radeon: add some debugging info 2009-11-29 17:27:47 +01:00
Vinson Lee
ca5a7aadb4 mesa: Fix array out-of-bounds access by _mesa_TexGenf.
_mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument
as an array.
2009-11-29 00:50:48 -05:00
Vinson Lee
d55fb7c835 mesa: Fix array out-of-bounds access by _mesa_TexGeni.
_mesa_TexGeni calls _mesa_TexGeniv, which uses the params argument
as an array.
2009-11-28 23:47:23 -05:00
Vinson Lee
919898e92f dri: Fix potential null pointer dereference in driBindContext. 2009-11-28 23:22:31 -05:00
Vinson Lee
a11d60d14c mesa: Fix array out-of-bounds access in _mesa_TexEnvf.
_mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument
as an array.
2009-11-28 22:08:20 -05:00
Maciej Cencora
e5159996a4 radeon: need to flush cs when moving images between mipmap trees 2009-11-28 21:36:59 +01:00
José Fonseca
2348f6d490 scons: Promote pointer arithmetic to error.
All code covered by scons is being built on multiple OSes, so pointer
arithmetic must really be addressed when spotted.
2009-11-27 17:06:12 +00:00
José Fonseca
5976d8e6f1 configs: Warn about pointer arithmetic.
It's not portable. Warn to help catching it early.
2009-11-27 17:06:12 +00:00
José Fonseca
f62f976e3f mesa: Avoid void pointer arithmetic. 2009-11-27 17:06:12 +00:00
Keith Whitwell
4236493899 st/xorg: proper fix for compositing after rounding up
Basically don't round up shared textures.  This fixes compiz,
but I'm afraid that rounding up texture sizes here in the driver
is doomed, as it will inevitably break texture wrap modes.
2009-11-27 15:30:18 +00:00
José Fonseca
1310811469 rbug: Mention where the GUI can be found. 2009-11-27 14:55:20 +00:00
José Fonseca
6dd9676a8f svga: Re-add shader dumping. 2009-11-27 14:04:47 +00:00
Keith Whitwell
6810ce005a Revert "st/xorg: fix composite after texture size changes"
This reverts commit 124ae59680.

Pushed by mistake
2009-11-27 14:03:10 +00:00
Keith Whitwell
124ae59680 st/xorg: fix composite after texture size changes 2009-11-27 13:59:22 +00:00
José Fonseca
dc86f4a20b wgl: Fix copy'n'paste typo in comment. 2009-11-27 13:35:04 +00:00
José Fonseca
135d7e1299 svga: Handle comment tokens when dumping. 2009-11-27 13:34:13 +00:00
José Fonseca
d3f26a8420 svga: Use consistent names for public symbol names of shader dumping facilities. 2009-11-27 13:34:07 +00:00
José Fonseca
178407f33c svga: Use consistent file names for dumping facilities. 2009-11-27 13:34:04 +00:00
Keith Whitwell
cf3cdda5cc st/xorg: speculatively round textures up to nearest POT
I'm not sure if this is a great change, but helps with caching.
Probably we want to turn this on/off on a driver-by-driver basis.
2009-11-27 12:24:57 +00:00
Keith Whitwell
e595dd4c17 st/xorg: free last fence 2009-11-27 12:24:57 +00:00
Keith Whitwell
b84b7f19df svga: flush our command buffer after the 8th distinct render target
This helps improve the surface cache behaviour in the face of the
large number of single-use render targets generated by EXA and the xorg
state tracker.  Without this we can reference hundreds of individual
render targets from a command buffer, which leaves little scope for
sharing or reuse of those targets.

Flushing early means we can start reusing textures much sooner.

This shouldn't have much effect on normal 3d rendering as it's pretty
rare to have a command buffer with >8 different render targets in that
world.
2009-11-27 12:24:57 +00:00
Keith Whitwell
b911688b87 svga: add DEBUG_CACHE option 2009-11-27 12:24:57 +00:00
Vinson Lee
69671df74c svga: Prevent potential null pointer dereference in vmw_surface.c. 2009-11-26 23:03:53 -05:00
Ian Romanick
0528f40e3b Improve implementation of GL_POINT_SPRITE_COORD_ORIGIN errors
This enum is only supported for OpenGL 2.0.  If a driver supports
OpenGL 1.4 and GL_ARB_point_sprite, using this enum should generate an
error.  This is important because, for example, i915 and i830 can
support GL_ARB_point_sprite, but they cannot support
GL_POINT_SPRITE_COORD_ORIGIN.

This commit just removes the check for NV_point_sprite, which is
completely wrong, and add some comments describing what the code
should do.  I don't see an easy way to check for version >= 2.0 from
inside Mesa.  Perhaps we should add an extension
GL_MESA_point_sprite_20 (like Intel's old GL_EXT_packed_pixels_12) to
indicate that this added bit of functionality is available.

Also note that glean's pointSprite test only checks for
GL_ARB_point_sprite before trying to use
GL_POINT_SPRITE_COORD_ORIGIN.  Naturally, that fails on
non-2.0 implementations (i.e., Mac OS X on GMA 950).
2009-11-25 16:31:28 -08:00
Dave Airlie
e4c5fe52c9 radeon: fix context destroy needing lock for flushing.
Thanks to Intel code which I've just stolen pretty much as usual.

This fixes fdo bug 22851 which is a dri1 regression since rewrite.

Tested by: fpiobaf (Fabio) on #radeon
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-11-25 20:29:56 +10:00
Jakob Bornecrantz
949d95e88a vmware/xorg: Remove gem include 2009-11-25 02:22:35 +01:00
Michel Dänzer
42db8c8cdb st/xorg: Use pipe clear hook for solid fills of whole pixmaps.
Can give a little boost e.g. for anti-aliased text rendering.
2009-11-26 16:46:13 +01:00
Keith Whitwell
b96218c656 svga: hash the whole key, not just the first four bytes 2009-11-26 15:25:42 +00:00
Michel Dänzer
3eb3bfb7c7 st/xorg: Make sure DRI2 blits use GPU copy contents even for software fallback.
Fixes 3D apps not updating with a non-GL compositing manager and Option
"2DAccel" "off".

Also clean up a little pixmap vs. drawable mess.
2009-11-26 16:00:06 +01:00
Keith Whitwell
ecfe1352cc st/xorg: fix refcounting bugs introduced in earlier commit 2009-11-26 14:23:24 +00:00
Keith Whitwell
dfb871d403 st/xorg: formatting
This directory needs indent run over it.
2009-11-26 14:23:07 +00:00
Keith Whitwell
41423c01b2 st/xorg: remove debugging flush
Accidentally committed in 7fbdbad5c0
('st/xorg: consolidate some dest surface state setting')
2009-11-26 12:53:36 +00:00
José Fonseca
c783f5cfd8 svga: Remove spurious argument to SVGA_DBG. 2009-11-26 12:02:59 +00:00
Keith Whitwell
7b0e4adaf2 st/xorg: render throttling in block handler
Similar to the classic swapbuffer throttling in GL drivers, put an
upper bound on the number of outstanding chunks of rendering the state
tracker can generate -- where calling the block handler denotes a
chunk.

Currently that number is set at around 4 "chunks", but could be
tweaked up or down.  If a better measure for the amount of outstanding
rendering is found, that would be fine too.

As it stands, this improves interactivity by preventing the X server
from queueing up arbitary amounts of rendering.
2009-11-26 11:55:47 +00:00
Keith Whitwell
8544c309d0 st/xorg: split copy operation into prepare/copy/done phases
Any high-overhead one-off tasks are moved into the prepare hook.
2009-11-26 11:23:37 +00:00
Keith Whitwell
91a5131e6b st/xorg: don't set up constant buffer for non-xv fragment shaders
These currently don't reference any constants.  Can add this back
if newer shaders need them, but in the meantime don't create
a new constant buffer every time we do a blit.
2009-11-26 11:23:36 +00:00
Keith Whitwell
fa799f81de st/xorg: split up shared Done call
The two users of composite (Composite and Solid) now call a new
xorg_composite_done() from their Done functions, while CopyDone
is directly implemented on top of xorg_renderer.c.
2009-11-26 11:23:36 +00:00
Keith Whitwell
b4ea1eb871 st/xorg: set up rasterizer state in init 2009-11-26 11:23:36 +00:00
Keith Whitwell
86ba5139a8 st/xorg: remove redundant clipping code 2009-11-26 11:23:36 +00:00
Keith Whitwell
899d20cfaa st/xorg: don't bother with cso save and restore in copy func 2009-11-26 11:23:36 +00:00
Keith Whitwell
7fbdbad5c0 st/xorg: consolidate some dest surface state setting 2009-11-26 11:23:36 +00:00
Vinson Lee
808f037660 glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. 2009-11-26 00:35:31 -05:00
Jakob Bornecrantz
45d9ea3619 vmware/xorg: Link against libkms
If the system doesn't have libkms installed it wont try to link against it.
2009-11-24 19:20:59 +01:00
Jakob Bornecrantz
77529a2cf2 vmware/xorg: Clean Makefile a bit 2009-11-24 19:16:37 +01:00
Jakob Bornecrantz
522e840a91 vmware/xorg: Don't link against libdrm_intel 2009-11-24 18:47:15 +01:00
Jakob Bornecrantz
eca5d6944a vmware/xorg: Stage driver in lib/gallium 2009-11-24 18:46:40 +01:00
Jakob Bornecrantz
7fac8ce73b st/xorg: Pass mode types from the kernel to X 2009-11-24 14:53:03 +01:00
Jakob Bornecrantz
ee40b20e7a st/xorg: Add libkms integration 2009-11-24 12:57:32 +01:00
Jakob Bornecrantz
1a19b9dbc2 st/xorg: Touch up xorg_crtc.c 2009-11-24 12:57:32 +01:00
Jakob Bornecrantz
def9b0e586 st/xorg: Rename driver functions 2009-11-24 12:57:32 +01:00
Jakob Bornecrantz
431e85f894 st/xorg: Rename output functions 2009-11-24 12:57:31 +01:00
Jakob Bornecrantz
6713a83bb8 st/xorg: Rename dri2 functions 2009-11-24 12:57:31 +01:00
Jakob Bornecrantz
26f9eeddf4 st/xorg: Standardise all function names defined in xorg_tracker.h 2009-11-24 12:57:31 +01:00
Keith Whitwell
2946aea110 svga: try harder to make the cachable flag work
It doesn't though.
2009-11-25 17:14:07 +00:00
Zack Rusin
c712f33746 st/xorg: accelerate src luminance 2009-11-25 10:20:08 -05:00
Zack Rusin
d228e3cc8e util: also print out memory statistics 2009-11-25 10:20:08 -05:00
Keith Whitwell
55b0157860 svga: revert packing of surface key
Over-ambitious packing of values broke my cursor.
2009-11-25 11:45:20 +00:00
Dave Airlie
92c6a26a8a radeon: fix context destroy needing lock for flushing.
Thanks to Intel code which I've just stolen pretty much as usual.

This fixes fdo bug 22851 which is a dri1 regression since rewrite.

Tested by: fpiobaf (Fabio) on #radeon
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-11-25 20:40:15 +10:00
Vinson Lee
94bcb9f1a4 glu/sgi: Fix memory leak in gluBuild1DMipmapLevelsCore. 2009-11-25 00:39:37 -05:00
Vinson Lee
0d89f3dc7f glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. 2009-11-25 00:28:56 -05:00
Vinson Lee
f895abbd97 glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. 2009-11-25 00:18:49 -05:00
Keith Whitwell
f1ce37f74a svga: cache textures as well as buffers 2009-11-24 21:15:35 +00:00
Keith Whitwell
4509f3cbad st/xorg: use surface_copy for blits if available
Even if its not available, we really want to be coalescing blit
operations better.
2009-11-24 21:15:35 +00:00
Ian Romanick
b12ca6b87b i915: Initialize Length and Offset fields when mapping a buffer object
This fixes an assertion failure in _mesa_MapBufferARB.

Fixes bugzilla #25253.
2009-11-23 23:14:49 -08:00
Ian Romanick
da0883114b shaderutil: Fix detection of shaders
Check for versions >= 2.0 (because some drivers return 3.0), and return
GL_FALSE if shaders are not detected.
2009-11-23 18:33:50 -08:00
Jakob Bornecrantz
acc51ac0ac svga: Filter out pendantic and ansi flags
Rather have the driver compile without the flags then
having to disable them.
2009-11-24 01:16:17 +01:00
Vinson Lee
326b66d724 glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. 2009-11-24 01:23:12 -05:00
Vinson Lee
364070b1f2 dri: Fix potential null pointer deference in dri_put_drawable. 2009-11-24 00:57:55 -05:00
Maciej Cencora
960464e42d radeon: fix errors in miptree related function
- typo
- memory leak
- off by one (spotted by airlied)
2009-11-23 21:59:08 +01:00
Maciej Cencora
635823d267 Merge branch 'mesa_7_7_branch' of http://anongit.freedesktop.org/git/mesa/mesa into mesa_7_7_branch 2009-11-23 21:28:22 +01:00
Jakob Bornecrantz
a11750218f autoconf: Fix case for not having package
(cherry picked from commit 5c4bdbd825)
2009-11-23 20:09:36 +01:00
Jakob Bornecrantz
86710c3334 svga: Scrub Makefiles a bit
Remove x86 specific hacks. Not that they will ever be used on
none x86 arches, but they are built by default. And the way the
flags where added was a hack.
2009-11-23 20:09:00 +01:00
Michel Dänzer
601edbef17 Fix the DRI swrast driver for big endian platforms.
Too bad I didn't realize earlier how easy this could be...

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=22767 .
2009-11-23 19:56:37 +01:00
Vinson Lee
67125c7f9a mesa: Initialize variable in _mesa_get_texel_fetch_func. 2009-11-23 01:52:59 -05:00
Vinson Lee
4b0b250aae glx: Prevent potential null pointer deference in driCreateContext. 2009-11-23 01:30:32 -05:00
Vinson Lee
5b925b7daa glu/sgi: Fix memory leak in bitmapBuild2DMipmaps. 2009-11-23 01:09:06 -05:00
Vinson Lee
b611f639b4 glu/sgi: Fix memory leak in gluScaleImage3D. 2009-11-23 00:57:37 -05:00
Maciej Cencora
e0fda04013 r300: fix VP source conflict resolution on 64-bit machines
On 32bit machines we were lucky because the sizeof(reg) == sizeof(rc_src_register).
On 64bit machines pointers are 8 bytes long, so we were overwriting other data.
2009-11-22 15:08:46 +01:00
Maciej Cencora
dfe440c856 r300: fix SIN/COS/SCS instructions for R300 fp 2009-11-22 14:13:18 +01:00
Vinson Lee
a9c540f5de glu/sgi: Fix memory leak in gluScaleImage. 2009-11-22 01:57:35 -05:00
Vinson Lee
d3b4c99c70 glu: Fix memory leak in __gl_meshMakeEdge. 2009-11-22 01:45:53 -05:00
Vinson Lee
57d389aab5 svga: Prevent potential null pointer deference in vmw_surface.c. 2009-11-22 01:26:32 -05:00
Vinson Lee
b62a74d3b9 svga: Fix memory leak in vmw_screen_ioctl.c 2009-11-22 01:20:07 -05:00
Vinson Lee
88aab56a26 st/xorg: Prevent potential null pointer deference in xorg_xv.c. 2009-11-22 01:10:38 -05:00
Vinson Lee
46feb7db71 st/xorg: Reorder cases in switch statement.
Silences missing break statement warning.
2009-11-22 00:55:52 -05:00
Maciej Cencora
563fe6e8f6 radeon: fix compressed mipmapped textures
Tested on r300 only, other cards may require adjusting texture_compressed_row_align.
2009-11-21 16:49:18 +01:00
Maciej Cencora
1d1f81af93 radeon: fix glCompressedTexSubImage 2009-11-21 16:49:18 +01:00
Maciej Cencora
d20b79172d radeon: fix compressed mipmapped textures
Tested on r300 only, other cards may require adjusting texture_compressed_row_align.
2009-11-21 16:30:48 +01:00
Maciej Cencora
df87877636 radeon: fix glCompressedTexSubImage 2009-11-21 16:30:41 +01:00
Roland Scheidegger
465fee75ee intel: make CopyTex[Sub]Image fallback debug messages more consistent 2009-11-21 04:41:43 -08:00
Roland Scheidegger
c367f4d46e mesa: handle different RowStride in _mesa_get_compressed_teximage
drivers storing compressed textures with non-native stride but relying on
_mesa_get_compressed_teximage for GetCompressedTexImage otherwise won't
work correctly (for instance i965 compressed mipmaps).
2009-11-21 04:41:43 -08:00
Eric Anholt
8451b29d96 i965: Fix several memory leaks on exit.
Bug #25194.
2009-11-21 13:33:57 +01:00
Vinson Lee
052b127842 st/egl: Fix memory leak in egl_tracker.c. 2009-11-20 16:33:25 -08:00
Vinson Lee
ea98e9820d draw: Initialize variable in draw_pt.c. 2009-11-20 16:03:48 -08:00
Vinson Lee
e19195c185 progs/xdemos: Fix memory leak in pbinfo.c. 2009-11-20 15:52:53 -08:00
Vinson Lee
e0857962b9 progs/xdemos: Fix memory leak in pbdemo.c. 2009-11-20 15:48:29 -08:00
Vinson Lee
538a8df652 progs/xdemos: Fix memory leak in glxpbdemo.c. 2009-11-20 15:18:19 -08:00
Vinson Lee
a4720a1a32 progs/xdemos: Remove duplicate code in glxinfo.c. 2009-11-20 15:06:56 -08:00
Vinson Lee
66a4ec14c3 progs/xdemos: Add assert in corender.c. 2009-11-20 15:03:16 -08:00
Vinson Lee
f6541773c4 i915g: Add missing break statement in i915_debug.c. 2009-11-20 14:31:42 -08:00
Vinson Lee
36e2074b63 gallium/util: Initialize variables in u_pack_color.h. 2009-11-20 14:20:15 -08:00
Brian Paul
3128d65fd7 docs: document fixes for AIX 2009-11-19 09:35:01 -07:00
Tom Fogal
7593bcb6ec gl: added mangled glXGetProcAddressARB define
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-19 09:33:32 -07:00
Tom Fogal
8f24e863c3 progs: Fix quoting issue with empty set of PROGRAM_DIRS.
Quotes are important to make sure the argument to test -n really
is the empty string, but that requires stringifying PROGRAM_DIRS.

Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-19 09:26:39 -07:00
Tom Fogal
4e6e2462ea mesa: define 32bit byteswap for AIX.
Fixes `xlib' driver build on AIX.

Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-19 09:18:51 -07:00
Brian Paul
5117725fd0 docs: removed VC6/7 project files 2009-11-19 09:07:34 -07:00
Brian Paul
e16b59df42 docs: update news file for 7.6.1 release 2009-11-19 09:07:17 -07:00
Brian Paul
2a1505b42e docs: remove VC6/7 project file info 2009-11-19 09:01:48 -07:00
Brian Paul
cba614bd88 mesa: omit VC6, VC7 project files from tarballs
Only VC8 project file is known to work.
2009-11-19 09:00:16 -07:00
Brian Paul
3bcf2d49f3 windows: remove old VC6 project files directory
Very out of date, according to Karl Schultz.
2009-11-19 08:57:39 -07:00
Alex Deucher
fe5c46546e r600: disable compressed texture support
It's not implemented yet.  fixes fdo bug 24047
2009-11-18 11:51:20 -05:00
Jakob Bornecrantz
5109484bd9 st/xorg: Flush any pending operations on upload 2009-11-18 17:49:38 +01:00
Jakob Bornecrantz
8d6da811d4 st/xorg: Unbind any textures in solid
Helps debuging with rbug
2009-11-18 17:49:37 +01:00
Alan Hourihane
910b58039a Fix vega compilation. 2009-11-20 21:15:25 +00:00
Alan Hourihane
1dbf3642b9 Fix memory leak. 2009-11-20 21:15:22 +00:00
Vinson Lee
8556fad751 progs/xdemos: Silence unused value warnings in sharedtex_mt.c. 2009-11-20 13:09:42 -08:00
Vinson Lee
f080567f4c progs/xdemos: Fix memory leak in glxinfo.c. 2009-11-20 13:01:22 -08:00
Vinson Lee
02c3e0b82d progs/tests: Silence unused value warnings in sharedtex.c. 2009-11-20 12:49:50 -08:00
Eric Anholt
c4e8918cd2 mesa: Fix NULL deref in optimizer when NumInstructions == 0.
Bug #24984.
2009-11-20 21:46:48 +01:00
Vinson Lee
48deddaa6f progs/tests: Initialize variable in getprocaddress.c. 2009-11-20 12:34:21 -08:00
Vinson Lee
e26135a744 progs/util: Exit RawImageGetData early if malloc fails.
Prevents a null pointer deference later on.
2009-11-20 12:11:55 -08:00
Vinson Lee
c88b18a4df progs/slang: Check for ftell failure in vstest.c. 2009-11-20 11:34:21 -08:00
Vinson Lee
d36cb2396c progs/util: Fix memory leak if malloc fails in RawImageOpen. 2009-11-20 11:22:13 -08:00
Vinson Lee
08cb1d0ce4 st/xorg: Fix type of 'unknown'. 2009-11-20 00:03:10 -08:00
Vinson Lee
b98db7bf69 progs/vpglsl: Fix psiz-mul.glsl compilation error on Mac OS. 2009-11-19 23:56:07 -08:00
Vinson Lee
760cf71572 progs/vp: Fix memory leak in vp-tris.c. 2009-11-19 22:59:01 -08:00
Vinson Lee
9553a42f63 progs/trivial: Redraw upon keypress. 2009-11-19 22:52:05 -08:00
Vinson Lee
881f55236a progs/glsl: Redraw upon keypress. 2009-11-19 22:46:19 -08:00
Dave Airlie
f8ea531820 r100: fix texture_from_pixmap and compiz.
r100 state emission has separate rect and non-rect states,
if we are doing TFP for a TEXTURE_2D we shouldn't use the rect
states as they won't get emitted properly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-11-20 11:47:00 +10:00
Vinson Lee
8b808d50e2 st/xorg: Fix infinite loop in copy_packed_data. 2009-11-19 14:40:00 -08:00
Vinson Lee
4ab8dbe593 progs/xdemos: Add missing break statement in offset.c. 2009-11-19 14:20:26 -08:00
Brian Paul
4e6c79ac16 st/mesa: replace st_flush() with pipe->flush()
We only need to flush the gallium driver in this case.
Fixes a recursive state validation bug.
2009-11-19 15:18:23 -07:00
Brian Paul
2198497203 vbo: added recursion check in vbo_exec_FlushVertices() 2009-11-19 15:17:56 -07:00
Brian Paul
dc41d62250 st/mesa: get rid of compressed_num_bytes() code 2009-11-19 14:35:38 -07:00
Brian Paul
92863109af st/mesa: remove is_compressed_mesa_format() 2009-11-19 14:17:31 -07:00
Brian Paul
273f4d6b5f st/mesa: remove pointless assertion 2009-11-19 14:17:31 -07:00
Brian Paul
3f40166500 softpipe: whitespace/indentation fixes 2009-11-19 14:17:31 -07:00
Vinson Lee
3790c6a13b progs/trivial: Redraw upon keypress. 2009-11-19 13:03:12 -08:00
Brian Paul
367cfca808 softpipe: add missing check in softpipe_is_texture_referenced()
Check if the named texture is referenced by the texture cache.
2009-11-19 11:39:24 -07:00
Michel Dänzer
31ea323b4d st/xorg: Replace compile-time acceleration switch with Option "2DAccel".
This option can be used to disable 2D acceleration. DRI2 and XVideo blits will
still be accelerated, at least to some degree even with compositing.
2009-11-19 17:52:55 +01:00
Michel Dänzer
10c67f9381 st/xorg: Miscellaneous XVideo fixes.
* Make sure the destination pixmap has a texture to render into.
* Fix damage reporting so the EXA migration code can do the right thing.
* Fix destination coordinates for redirected windows.
2009-11-19 17:47:21 +01:00
Michel Dänzer
34145fc3b7 st/xorg: Try harder to ensure a shared texture has valid contents right away. 2009-11-19 17:30:32 +01:00
Michel Dänzer
012d0193cc st/xorg: Don't complain about convolution filter being 'unknown'.
Also add a newline to the complaint so it'll be a little less annoying if we
actually encounter an unknown filter value again.
2009-11-19 17:25:05 +01:00
Michel Dänzer
10dbdee056 st/xorg: Remove superfluous flushes from the EXA WaitMarker hook.
Thanks to Thomas Hellström for pointing this out.
2009-11-19 10:54:49 +01:00
Michel Dänzer
ea114345a6 st/xorg: Don't initialize non-existing fields. 2009-11-19 10:38:08 +01:00
Vinson Lee
e3cfd78969 progs/tests: Fix memory leak in texdown.c if malloc fails. 2009-11-18 17:30:50 -08:00
Alex Deucher
c5add6a468 docs: Add note about r600 2009-11-18 11:32:55 -05:00
Alex Deucher
13b5a624b1 Revert "radeon: Fix legacy bo not to reuse dma buffers before refcount is 1."
This reverts commit 284a7af274.

This breaks kde desktop effects.  See fdo bug 24131
2009-11-18 11:27:36 -05:00
Brian Paul
027abddf4f mesa: set version string to 7.6.1-rc1 2009-11-18 08:08:25 -07:00
Brian Paul
d449c07b8b xorg/st: fixup builds against later dpms headers.
(cherry picked from master, commit e9d6ab72be)
2009-11-18 08:07:56 -07:00
Jakob Bornecrantz
e12c9a6f3a st/xorg: Init all functions and fix spelling 2009-11-18 10:59:42 +01:00
Vinson Lee
cde6643724 progs/fp: Redraw upon keypress. 2009-11-18 14:41:40 -08:00
Jakob Bornecrantz
9ab3c70f65 st/xorg: Make the #if more easier to read 2009-11-18 10:44:07 +01:00
Jakob Bornecrantz
e73553bff7 st/xorg: Use the correct DRI2BufferPtr struct on 1.6.4 servers 2009-11-18 10:44:07 +01:00
Vinson Lee
4b3ec2acf2 progs/glsl: Fix trirast GLSL compilation errors on Mac OS. 2009-11-18 14:02:20 -08:00
Vinson Lee
0d31990b47 progs/glsl: Fix noise GLSL compilation error on Mac OS. 2009-11-18 13:50:49 -08:00
Maciej Cencora
3bf12c8bea r300: allow disabling s3tc support if libtxc_dxtn is available 2009-11-18 22:19:25 +01:00
Maciej Cencora
cefee4e327 Merge branch 'radeon-texrewrite-clean' into mesa_7_7_branch 2009-11-18 22:09:33 +01:00
Maciej Cencora
7118db8700 r600: align for mipmap tree changes 2009-11-18 22:02:48 +01:00
Vinson Lee
d4dc2e30da progs/glsl: Fix multinoise GLSL compilation errors on Mac OS. 2009-11-18 12:49:31 -08:00
Vinson Lee
04442841fb progs/glsl: Fix mandelbrot GLSL compilation error on Mac OS. 2009-11-17 23:15:25 -08:00
Ian Romanick
70dca0c273 AL1616: Fix cut-and-paste bug
One of the PACK_COLOR_88 cases was left over from copying
_mesa_texstore_al88 to _mesa_texstore_al1616.
2009-11-17 22:53:06 -08:00
Brian Paul
89e20ab3ae progs/glsl: use ShadersSupported() 2009-11-17 19:22:29 -07:00
Brian Paul
6acb82dab0 progs/util: warn when GLSL not supported 2009-11-17 19:22:11 -07:00
Ian Romanick
5606dfb572 Merge branch 'outputswritten64'
Add a GLbitfield64 type and several macros to operate on 64-bit
fields.  The OutputsWritten field of gl_program is changed to use that
type.  This results in a fair amount of fallout in drivers that use
programs.

No changes are strictly necessary at this point as all bits used are
below the 32-bit boundary.  Fairly soon several bits will be added for
clip distances written by a vertex shader.  This will cause several
bits used for varyings to be pushed above the 32-bit boundary.  This
will affect any drivers that support GLSL.

At this point, only the i965 driver has been modified to support this
eventuality.

I did this as a "squash" merge.  There were several places through the
outputswritten64 branch where things were broken.  I foresee this
causing difficulties later for bisecting.  The history is still
available in the branch.

Conflicts:
	src/mesa/drivers/dri/i965/brw_wm.h
2009-11-17 16:25:38 -08:00
Ian Romanick
b43887cf7e ARB_fbo: Enable extensions related to GL_ARB_framebuffer_object for GLX 2009-11-17 16:25:38 -08:00
Ian Romanick
4e7476f601 ARB_fbo: Add missing GLX render opcode for glFramebufferTextureLayerEXT
Also regenerate the GLX protocol files from this change.
2009-11-17 16:25:38 -08:00
Ian Romanick
5fbfd88338 Add missing XML files to API_XML
When the files missing from the list were modified, the generated files
weren't regenerated.
2009-11-17 16:25:38 -08:00
Ian Romanick
4d6ec21439 ARB_fbo: Enable GL_EXT_framebuffer_multisample
All of this functionality is already included in ARB_fbo.  This just
enables the string.

I was a bit lazy in using FEATURE_ARB_framebuffer_object for this
feature as well.  I don't think it makes much difference in the long run.
2009-11-17 16:25:38 -08:00
Ian Romanick
7fd44005ae ARB_fbo: Regenerate files from previous commits. 2009-11-17 16:25:37 -08:00
Ian Romanick
50b05e7c1f ARB_fbo: Move EXT_fb_blit to EXT_framebuffer_object.xml
This extension is layered on GL_EXT_framebuffer_object, so it should
live in the same XML file.
2009-11-17 16:25:37 -08:00
Ian Romanick
afab8d9958 ARB_fbo: Add GL_EXT_framebuffer_multisample
Add GL_EXT_framebuffer_multisample.  Make
glRenderbufferStorageMultisampleEXT in GL_EXT_framebuffer_object alias
glRenderbufferStorageMultisample.  Also add the missing GLX render
opcode to glRenderbufferStorageMultisample.

Since this extension is layered on GL_EXT_framebuffer_object, I put it
in EXT_framebuffer_object.xml.
2009-11-17 16:25:37 -08:00
Ian Romanick
daad31d527 EXT_pds: Alias GL_NV_packed_depth_stencil to GL_EXT_packed_depth_stencil
GL_EXT_packed_depth_stencil is a functional superset of
GL_NV_packed_depth_stencil.   If a driver enables EXT_pds, make NV_pds
available as well.
2009-11-17 16:25:37 -08:00
Ian Romanick
b244b702b3 EXT_pds: Add GL_EXT_packed_depth_stencil 2009-11-17 16:25:37 -08:00
Ian Romanick
92b38bc305 EXT_fbo_blit: Add missing GLX protocol render opcode 2009-11-17 16:25:37 -08:00
Ian Romanick
30f09573ed ARB_fbo: Add missing protocol "Get" information 2009-11-17 16:25:37 -08:00
Ian Romanick
c185ff96c9 ARB_fbo: Remove _EXT from enum names 2009-11-17 16:25:37 -08:00
Brian Paul
4440d8adb6 docs: libGL documentation, from the xorg-docs tree
This is pretty old and needs some updating but might be useful or
interesting to some people.
2009-11-17 16:33:22 -07:00
Vinson Lee
773de83d3c progs/tests: Fix memory leak in arbgpuprog.c. 2009-11-17 15:24:40 -08:00
Brian Paul
a54033bedb mesa: remove old comment 2009-11-17 16:18:29 -07:00
Brian Paul
133501bef2 mesa: fix assorted compiler warnings 2009-11-17 16:16:30 -07:00
Brian Paul
bc8fb028c6 mesa: fix incorrect type in store_texel_al1616() 2009-11-17 16:16:30 -07:00
Brian Paul
7e3955d8e8 i915g: replace //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
c4c11eb456 gallium/util: replace //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
845ddbc9aa i915g: remove trailing commas in enum lists to silence warnings 2009-11-17 16:16:30 -07:00
Brian Paul
fc3c5ffcc8 progs/xdemos: change //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
b08f447547 progs/glsl: change //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
1888a72765 progs/demos: silence warnings 2009-11-17 16:16:30 -07:00
Brian Paul
0422053eca mesa: remove trailing comment to silence warning 2009-11-17 16:16:30 -07:00
Brian Paul
e36751ec81 mesa: remove a bit of old code 2009-11-17 16:16:30 -07:00
Brian Paul
2b3ea2be90 docs: i965 clipping fix 2009-11-17 15:53:27 -07:00
Vinson Lee
e8eec93854 progs/slang: Fix potential null pointer dereference in cltest.c. 2009-11-17 14:22:35 -08:00
Vinson Lee
47b5f584a6 progs/redbook: Fix memory leak in quadric.c. 2009-11-17 14:10:35 -08:00
Maciej Cencora
afe84fa698 r200: align for mipmap tree changes 2009-11-17 19:46:59 +01:00
Maciej Cencora
93eb2ab8c3 radeon: align for mipmap tree changes 2009-11-17 19:46:37 +01:00
Jakob Bornecrantz
46492f11f6 svga: More -Werror removal 2009-11-17 12:09:19 +01:00
Vinson Lee
d9508e8df9 progs/util: Fix memory leak if fopen fails in RawImageOpen. 2009-11-17 13:49:31 -08:00
Jakob Bornecrantz
8c5a108dc3 svga: Remove -Werror for now as GCC 4.4.x raises a bunch of warnings 2009-11-17 11:24:39 +01:00
Maciej Cencora
aef769207d r300: fix reads and writes for MESA_FORMAT_S8Z24 buffer
Regression was introduced by texformat-rework branch merge.
2009-11-17 13:40:43 -07:00
Brian Paul
d888bbc45a progs/xdemos: added -lX11 -lpthread for GNU gold linker 2009-11-17 13:40:00 -07:00
Vinson Lee
11905da883 progs/util: Fix memory leak if fread returns 0 in CompileShaderFile. 2009-11-17 12:00:22 -08:00
Brian Paul
6418ce7df6 mesa: move -ansi -pedantic to CFLAGS 2009-11-17 12:47:54 -07:00
Vinson Lee
b8dcb79c53 progs/glsl: Change tangentAttrib from GLuint to GLint in bump.c.
tangentAtrrib is assigned the result of glGetAttribLocation.
The assertion 'assert(tangentAtrrib >= 0)' would be a no-op if
tangentAttrib is a GLuint.
2009-11-17 11:37:48 -08:00
Vinson Lee
786d539511 progs/util: Fix memory leak if malloc fails in tkRGBImageLoad. 2009-11-17 11:04:24 -08:00
Patrice Mandin
b353106467 nouveau: nv30: Check for NULL front (happens with DRI2) 2009-11-17 19:50:37 +01:00
Patrice Mandin
49289f1d25 nouveau: nv30: Add missing include to fix warning 2009-11-17 19:49:56 +01:00
Michel Dänzer
52be96b7fe Remove unconditional use of glibc specific bswap_16() macro.
Fixes unresolved symbol bswap_16 on non-glibc or little endian glibc platforms.
2009-11-17 19:41:29 +01:00
Brian Paul
63bc736f90 docs: list the new VMware SVGA Gallium driver in release notes 2009-11-17 11:23:19 -07:00
Dan Nicholson
cf65d81cf1 dri: Ensure subdirs have finished before linking driver
Recursive make is hard. If there are subdirectories in the DRI drivers,
it's pretty certain we want to finish building in them before linking
the driver. Add a new target to serialize the rules.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-11-17 11:23:19 -07:00
Vinson Lee
041cd0e110 progs/util: Fix memory leak if LoadRGBImage fails. 2009-11-17 10:11:50 -08:00
Michel Dänzer
33e93f4277 r600: More span breakage fixes.
At least now the compiler doesn't complain about implicitly declared functions
anymore...
2009-11-17 19:02:03 +01:00
Vinson Lee
0e783c7d03 progs/glsl: Fix memory leak in deriv.c. 2009-11-17 09:54:54 -08:00
Michel Dänzer
29f3e7e1d1 r600: Attempt to fix span breakage introduced by big endian fixes.
Only compile tested; I happened to notice people on IRC reporting

.../r600_dri.so: undefined symbol: radeon_ptr_2byte_8x2
2009-11-17 18:47:24 +01:00
Vinson Lee
28b8e4bcd7 progs/util: Fix memory if LoadRGBMipmaps2 fails. 2009-11-17 08:29:36 -08:00
Michel Dänzer
081bf9563f radeon: Depth/stencil span code fixes for big endian.
Fixes e.g. text in progs/demos/arbocclude.
2009-11-17 11:09:09 +01:00
Michel Dänzer
592ce48ce9 radeon: Fix occlusion queries on big endian. 2009-11-17 11:08:21 +01:00
Michel Dänzer
2262765425 radeon: Fix software fallbacks with KMS on big endian. 2009-11-17 08:05:23 +01:00
Michel Dänzer
f2651264d3 radeon: FBO fixes for big endian. 2009-11-17 08:05:22 +01:00
Michel Dänzer
2d0c295256 Add MESA_FORMAT_XRGB8888_REV. 2009-11-17 08:05:22 +01:00
Dave Airlie
e015a4c29b radeon: rn50's have no 3D engine so don't try and init 3D driver. 2009-11-17 16:06:26 +10:00
Vinson Lee
0e790ac353 progs/util: Fix memory leak if LoadYUVImage fails. 2009-11-16 18:24:06 -08:00
Jakob Bornecrantz
60769b232c svga: Build svga driver 2009-11-17 03:18:06 +01:00
Jakob Bornecrantz
f7109aaf6c svga: Add vmwgfx_drm.h file from vmwgfx kernel driver
Add the vmwgfx_drm.h header for now, this allows the svga driver
to be enabled by default without forcing people to install the
vmwgfx_drm.h header on their system.

To be removed once vmwgfx_drm.h is in libdrm.
2009-11-17 03:18:05 +01:00
Jakob Bornecrantz
3192633d4a svga: Add svga driver 2009-11-17 03:18:04 +01:00
Vinson Lee
6b480dc21d progs/demos: Fix memory leak in ray.c. 2009-11-16 18:06:40 -08:00
Jakob Bornecrantz
648e8b4c46 st/xorg: Fix copy-pasto
Thanks Alan.
2009-11-17 01:48:53 +01:00
Vinson Lee
ee555e3d69 progs/demos: Fix memory leak in projtex.c. 2009-11-16 16:31:34 -08:00
Vinson Lee
a1afe303de progs/demos: Fix memory leak in ipers.c. 2009-11-16 15:44:52 -08:00
Ian Romanick
fdfbae3381 i965: Use MESA_FORMAT_AL1616 when appropriate 2009-11-16 15:23:17 -08:00
Ian Romanick
b1616b2a81 Move 'static' to start of declaration to silence compiler warning 2009-11-16 15:23:16 -08:00
Ian Romanick
12982e381d AL1616: Enable MESA_FORMAT_AL1616 for software paths 2009-11-16 15:23:16 -08:00
Ian Romanick
3325dc91be AL1616: Add TexImage storage path 2009-11-16 15:23:16 -08:00
Ian Romanick
975871b4d5 AL1616: Add texel fetch / store routines 2009-11-16 15:23:16 -08:00
Ian Romanick
eb437fabe0 AL1616: Add formats for GL_LUMINANCE16_ALPHA16 textures 2009-11-16 15:23:16 -08:00
Ian Romanick
5fb07a4046 AL1616: Add macros to pack two GLushorts into a texel 2009-11-16 15:23:16 -08:00
Vinson Lee
aef3218f0b progs/demos: Fix memory leak in fslight.c. 2009-11-16 14:56:07 -08:00
Jakob Bornecrantz
cb060f3b98 st/xorg: Fix comp alpha code and deal with luminance masks
There are two fixes in here one is a one liner that fixes
component alpha logic. The other deals better with luminance
formats used for masks, sources not yet implemented.

Fixes component alpha text and icons in gnome. There are a one
or two cases that this code misses. Like if src_luminance is set
but no mask image is given.
2009-11-16 23:33:45 +01:00
Jakob Bornecrantz
5438ee3ecf st/xorg: Incase of format missmatch swizzle channels and set alpha
This path is only hit for icons in gnome so far
2009-11-16 23:33:44 +01:00
Alex Deucher
d683acb101 r600: don't force Z order
Let the hw decide (early vs late Z)
fixes fdo bug 25092

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-16 15:03:48 -05:00
Corbin Simpson
0f060250fc docs: Update r300g status. 2009-11-16 10:46:20 -08:00
Brian Paul
664b7303c2 docs: fixes, changes for Mesa 7.7 2009-11-16 11:33:45 -07:00
Brian Paul
fcf8dea36c progs/tests: silence warning 2009-11-16 11:33:45 -07:00
Brian Paul
f549f4c4b6 mesa: remove unused vertex array driver hooks 2009-11-16 11:33:44 -07:00
Brian Paul
652828ec0e mesa: check BaseLevel, MaxLevel in _mesa_GenerateMipmapEXT() 2009-11-16 08:25:17 -07:00
Brian Paul
a719395b45 mesa: use _mesa_get_current_tex_object() 2009-11-16 08:21:28 -07:00
Brian Paul
ecb03d75a2 mesa: added another check in check_gen_mipmap()
We don't need to call ctx->Driver.GenerateMipmap() if we're updating
a texture level >= MAX_LEVEL.
2009-11-16 08:18:03 -07:00
Michel Dänzer
d3a37d93ab st/xorg: Only reference new picture formats when they're defined.
Fixes http://bugs.freedesktop.org/show_bug.cgi/?id=25094 .
2009-11-16 11:59:39 +01:00
Brian Paul
afae49cc15 st/mesa: comments for st_draw.c 2009-11-15 16:22:53 -07:00
Brian Paul
4581f70578 st/egl: add some basic comments 2009-11-15 16:22:52 -07:00
Francisco Jerez
abefd7dcdf nv20: Fix build for the last nouveau_class.h changes.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-11-15 18:20:19 +02:00
Francisco Jerez
ed9c4933af nv10: Fix build for the last nouveau_class.h changes.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-11-15 18:20:19 +02:00
Vinson Lee
a420056750 progs: Ignore Mac OS dSYM directories. 2009-11-14 21:39:31 -08:00
Maciej Cencora
ad83aeccdc radeon: return false on texture validation if texture isn't complete 2009-11-14 18:11:16 +01:00
Maciej Cencora
23ec7c4574 radeon: rework mipmap tree 2009-11-14 16:55:39 +01:00
Maciej Cencora
8f88cf3938 radeon: more texture code refactoring 2009-11-14 16:55:38 +01:00
Maciej Cencora
9d0af686b2 radeon: minor refactoring of texture code
Also properly set dstImageOffsets for TexSubImage case.
2009-11-14 16:55:38 +01:00
Maciej Cencora
7628b06ba3 radeon: rework mipmap tree reference counting 2009-11-14 16:55:34 +01:00
Maciej Cencora
6e5d473cc1 r300: fix regression introduced in 1d5a06a1f7
Spotted by Dave Airlie
2009-11-14 14:43:34 +01:00
Maciej Cencora
aa19561158 radeon: use radeon_bo_is_referenced_by_cs for query objects 2009-11-14 14:43:18 +01:00
Maciej Cencora
d3fa67c9b8 radeon/r300: don't flush cmdbuf if not necessary 2009-11-14 14:43:10 +01:00
Maciej Cencora
286bf89e5a radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode 2009-11-14 14:42:48 +01:00
Maciej Cencora
f6d0993212 radeon: fix glBufferSubData 2009-11-14 14:42:34 +01:00
Maciej Cencora
084f43c150 radeon: add radeon_bo_is_referenced_by_cs function 2009-11-14 14:42:26 +01:00
Maciej Cencora
49876ab6a7 radeon: remove unnecessary call to radeonEmitState
fixes bo space accounting errors
2009-11-14 14:42:19 +01:00
Maciej Cencora
0aad2aee66 r300: add missing texformat 2009-11-14 14:42:10 +01:00
Maciej Cencora
e92492295b r300: remove unneeded includes 2009-11-14 14:42:01 +01:00
Eric Anholt
57f40b1837 i965: Share OPCODE_TXB between brw_wm_emit.c and brw_wm_glsl.c
This should fix TXB on G45 and older in the GLSL case.
2009-11-13 16:04:13 -08:00
Eric Anholt
1be0efcbdc i965: Share OPCODE_TEX between brw_wm_emit.c and brw_wm_glsl.c.
New comments should explain some of the confusion about how this message
works.
2009-11-13 16:04:10 -08:00
Eric Anholt
a0fd49b334 i965: Clean up emit_tex a bit. 2009-11-13 15:17:24 -08:00
Eric Anholt
3d36d6b4cf Merge remote branch 'origin/mesa_7_6_branch' 2009-11-13 14:45:29 -08:00
Eric Anholt
99077e7792 i965: Flag BRW_NEW_CONTEXT on some context state.
Fixing this is a prereq for avoiding flagging all state at new
batch time.  Eliminating that still causes problems, though (notably
glean logicOp fails on my GM965).
2009-11-13 14:39:09 -08:00
Eric Anholt
1ffd0a7789 intel: Remove some dead context structure fields. 2009-11-13 13:18:57 -08:00
Eric Anholt
3727858ceb i965: Remove an unused cache_item field. 2009-11-13 13:18:57 -08:00
Eric Anholt
b54f8eeae8 i965: Remove long dead structures for ffvertex_prog.c. 2009-11-13 13:18:57 -08:00
Eric Anholt
ded0ec1ea5 i965: Use bo_map instead of subdata to upload the bits of constant buffer.
Saves CPU time, resulting in a 2.5% FPS win on ETQW.
2009-11-13 13:18:57 -08:00
Eric Anholt
8e8586e626 i965: Validate the number of URB entries selected for the VS. 2009-11-13 13:18:56 -08:00
Eric Anholt
3c05c1eb63 intel: When subdataing a busy buffer, use a temporary and blit in.
This cuts a massive number of waits in ET:QW, which uses a VBO ringbuffer.
Unfortunately it doesn't BufferData when wrapping back to 0, so we can't
be clever with tracking what's been initialized.
2009-11-13 13:18:56 -08:00
Eric Anholt
4e50ce35ee i965: Clean up Ironlake sampler type definitions.
They're the same regardless of execution width for 8, 4x2, and 16.
2009-11-13 13:18:56 -08:00
Eric Anholt
91bd593109 i965: Avoid moving the current value back into the accumulator for MAD.
This is a 2.9% (+/-.3%) performance win for my GL demo, which hits MAD
sequences for matrix transforms.
2009-11-13 13:18:56 -08:00
Eric Anholt
d6690ce15f mesa: Improve the eliminate-move-use to work across multiple instructions.
This shaves more instructions off of the VS of my GL demo, but no
performance difference this time at n=6.  This also fixes a regression
that was in this path, which is now piglit's glsl-vs-mov-after-deref.
2009-11-13 13:18:22 -08:00
Zack Rusin
654122ba7b st/xorg: try to fix non-uniform transforms 2009-11-13 14:58:35 -05:00
Vinson Lee
43080e40aa progs/glsl: Add missing break statement in multinoise.c. 2009-11-12 16:21:49 -08:00
Ian Romanick
b6b753f727 intel: Don't check for context pointer to be NULL during extension init
Thanks to Chia-I Wu's changes to the extension function
infrastructure, we no longer have to tell the loader which extensions
the driver might enable.  This means that intelInitExtensions will
never be called with a NULL context pointer.  Remove all the NULL checks.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2009-11-12 15:43:09 -08:00
Ian Romanick
a736d3f439 intel: Remove unused enable_imaging parameter to intelInitExtensions 2009-11-12 15:43:09 -08:00
Eric Anholt
514544f373 i965: Fix Ironlake shadow comparisons.
The cube map array index arg is always present.
2009-11-12 11:41:39 -08:00
Eric Anholt
5f305b1db9 i965: Fix VBO last-valid-offset setup on Ironlake.
Instead of doing math based on the (broken for VBO && offset != 0)
input->count number, just use the BO size.  Fixes assertion failure in ETQW.
2009-11-12 11:41:39 -08:00
Zack Rusin
4d72f8f520 st/xorg: use an immediate instead of a full blown const 2009-11-11 21:47:28 -05:00
Zack Rusin
72b4a7d67f st/xorg: don't use flow control 2009-11-11 21:43:40 -05:00
Brian Paul
0a39620d6d swrast: handle additional Z24 formats in read_depth_pixels() 2009-11-11 19:38:19 -07:00
Roland Scheidegger
ab12e764ba i965: fix EXT_provoking_vertex support
This didn't work for quad/quadstrips at all, and for all other primitive types
it only worked when they were unclipped.
Fix up the former in gs stage (could probably do without these changes and
instead set QuadsFollowProvokingVertexConvention to false), and the rest in
clip stage.
2009-11-11 17:57:56 -08:00
Vinson Lee
7dfea5c072 demos/glsl: Add missing break statement to noise test. 2009-11-11 17:39:58 -08:00
Zack Rusin
2cfbbc76e4 st/xorg: implement repeatnone and make some code smell less like ass 2009-11-11 19:55:50 -05:00
Zack Rusin
493d599af4 st/xorg: fallback until daddy can implement you properly 2009-11-11 19:55:50 -05:00
Brian Paul
2ff4f5a7fe progs/tests: add alpha/blend testing to packedpixels.c 2009-11-11 12:25:08 -07:00
Corbin Simpson
cbee31a1f8 r300, r300g: Add missing registers. 2009-11-11 10:24:19 -08:00
Corbin Simpson
d030ce6a84 dri-st: Add some required GL 2.0 extensions.
Two-sided stencil and NPOT textures.
2009-11-11 10:24:06 -08:00
Eric Anholt
1220aba99b i965: Fix VS constant buffer value loading.
Previously, we'd load linearly from ParameterValues[0] for the constants,
though ParameterValues[1] may not equal ParameterValues[0] + 4.  Additionally,
the STATE_VAL type paramters didn't get updated.

Fixes piglit vp-constant-array-huge.vpfp and ET:QW object locations.

Bug #23226.
2009-11-10 14:44:40 -08:00
Eric Anholt
e5ffb9f5ea i965: Unalias src/dst registers for SGE and friends.
Fixes piglit vp-sge-alias test, and the googleearth ground shader.  \o/

Bug #22228
(cherry picked from commit 56ab92bad8)
2009-11-10 14:44:39 -08:00
Eric Anholt
23a4a6727e i965: Allow use of PROGRAM_LOCAL constants in ARB_vp.
Fixes piglit arl.vp.
(cherry picked from commit d52d78b4bc)
2009-11-10 14:44:39 -08:00
Jakob Bornecrantz
e4a19ffb13 st/xorg: Fallback if picture format doesn't match texture format 2009-11-10 10:05:40 +01:00
Jakob Bornecrantz
3201c655e4 st/xorg: Don't segfault when debug printing 2009-11-10 10:00:04 +01:00
Zack Rusin
fca8b2c3ae st/xorg: wrap to border color 2009-11-10 20:30:48 -05:00
brian
b81f213157 swrast: update renderbuffer format assertions 2009-11-10 18:23:59 -07:00
brian
a65b84d955 mesa: fix some begin/end render-to-texture logic
Before, we weren't aggressive enough in checking for the start or end
of render-to-texture.  In particular, if only the ctx->ReadBuffer had
texture attachments, we were treating that as a render-to-texture case.

This fixes a regression from commit 75bdbdd90b
"intel: Don't validate in a texture image used as a render target."
2009-11-10 18:09:13 -07:00
brian
bc569cd6be mesa: move check_begin/end_texture_render() calls 2009-11-10 18:09:13 -07:00
brian
d96e55fa7b mesa: new vars: oldDrawFb, oldReadFb in _mesa_BindFramebufferEXT() 2009-11-10 18:09:13 -07:00
brian
e6f60d3037 mesa: rename vars in _mesa_BindFramebufferEXT() 2009-11-10 18:09:13 -07:00
brian
a492ab765a mesa: added comment for check_begin_texture_render() 2009-11-10 18:09:12 -07:00
Jakob Bornecrantz
4c54f8e9aa st/egl: Probe hardware for depth stencil format 2009-11-10 08:29:41 +01:00
Zack Rusin
d2c886c8ca st/xorg: cleanup the naming 2009-11-10 19:42:03 -05:00
Zack Rusin
e08512f3d4 st/xorg: print ouf the picture formats when compositing 2009-11-10 19:42:02 -05:00
Eric Anholt
e42b156fac Merge remote branch 'origin/mesa_7_6_branch' 2009-11-10 16:01:28 -08:00
Eric Anholt
c5413839b3 i965: avoid memsetting all the BRW_WM_MAX_INSN arrays for every compile.
For an app that's blowing out the state cache, like sauerbraten, the
memset of the giant arrays ended up taking 11% of the CPU even when only a
"few" of the entries got used.  With this, the WM program compile drops back
down to 1% of CPU time.

Bug #24981 (bisected to BRW_WM_MAX_INSN increase).
2009-11-10 16:00:30 -08:00
Eric Anholt
eb6a1f8a00 i965: Add a note explaining the data cache domain. 2009-11-10 16:00:30 -08:00
Vinson Lee
520b6abdec i915g: Fix memory leak when pci id is unknown. 2009-11-10 12:39:42 -08:00
Eric Anholt
56ab92bad8 i965: Unalias src/dst registers for SGE and friends.
Fixes piglit vp-sge-alias test, and the googleearth ground shader.  \o/

Bug #22228
2009-11-10 10:54:15 -08:00
Eric Anholt
d52d78b4bc i965: Allow use of PROGRAM_LOCAL constants in ARB_vp.
Fixes piglit arl.vp.
2009-11-10 10:46:57 -08:00
Michal Krol
28039ffdc8 slang: Fix return value check. 2009-11-10 19:25:51 +01:00
Michel Dänzer
5e17c89ead st/xorg: Fix SCons build.
Check for new DPMS header and add xorg_renderer.c source file.
2009-11-10 10:09:56 -08:00
Michal Krol
413e933fd5 slang: Check OOM conditions for alloc_node_storage(). 2009-11-10 18:30:10 +01:00
José Fonseca
eef5a0b3a3 llvmpipe: Fix derived blend color state. 2009-11-10 05:22:15 -08:00
Michal Krol
cc470bf0ca slang: Check return value from new_instruction(). 2009-11-10 04:03:55 +01:00
Michal Krol
b2a29ad309 slang: Fix signed/unsigned int handling in _slang_free_temp(). 2009-11-10 03:25:06 +01:00
Michal Krol
b5d8a7b6dc tgsi/exec: Exit early on error. 2009-11-10 03:12:02 +01:00
Michal Krol
e44c77028c tgsi/ureg: Simplify logic in tokens_expand(). 2009-11-10 03:08:21 +01:00
Michal Krol
83760d961f slang: Handle OOM condition in new_instruction(). 2009-11-10 02:46:24 +01:00
Zack Rusin
031fbb9681 st/xorg: remove deprecated rendering code 2009-11-09 18:04:21 -05:00
Zack Rusin
a6d527d7b8 st/xorg: fix composite batching
quite a large performance optimization (text demo from 1.6fps to 9fps)
2009-11-09 18:04:21 -05:00
Jerome Glisse
216319fc0f r600/r700: typo, fix mask of DB_ALPHA_TO_MASK 2009-11-09 22:37:41 +01:00
Alex Deucher
74ef3207d8 r600: don't emit htile regs
These are needed for HiZ which is not currently used and
the _BASE reg requires a reloc which is not currently supported
in the drm.
2009-11-09 12:27:27 -05:00
Alex Deucher
66d6f9e860 r600: rework DB render setup
- consolidate DB render setup
- only enable perfect ZPASS counts and cull disable
when OQ is active
- enable early Z
2009-11-09 12:20:47 -05:00
Alex Deucher
37676b396a r600: don't emit htile regs
These are needed for HiZ which is not currently used and
the _BASE reg requires a reloc which is not currently supported
in the drm.
2009-11-09 12:16:55 -05:00
Alex Deucher
a9035f3dc3 r600: add missing ZPASS setup bits for r7xx+ 2009-11-09 12:16:55 -05:00
José Fonseca
bc9d51bb0e llvmpipe: Ensure stack variables in unit tests are properly aligned. 2009-11-09 07:26:08 -08:00
Christoph Bumiller
7204b92101 nv50: clarify data for method 0x121c 2009-11-09 14:30:32 +01:00
Corbin Simpson
c9167d868c r300g: Fix up SW TCL rendering functions.
They don't work, but at least they're clean now.
2009-11-08 14:53:29 -08:00
Corbin Simpson
fe89863808 r300g: Protect against possibly missing Draw pointer.
Part of the SW TCL revival.
2009-11-08 14:53:29 -08:00
Corbin Simpson
11d9edf4c9 r300g: Unify context names for counts.
From the SW TCL fixups.
2009-11-08 14:53:29 -08:00
Corbin Simpson
b6f93e2607 r300g: Enable PSC/RS dump with new debugging flags. 2009-11-08 14:53:15 -08:00
Corbin Simpson
0525cb1273 r300g: Fix is_buffer_referenced. 2009-11-08 09:56:02 -08:00
Corbin Simpson
ee28a69188 r300g: Fix build error on old compilers.
This dead code was still getting compiled, causing a bad ref in the lib.
2009-11-08 09:35:07 -08:00
Ian Romanick
2cda507fa1 prog parse: Handle GL_VERTEX_PROGRAM_ARB in glLoadProgramNV 2009-11-07 15:54:33 -08:00
Ian Romanick
6d2ceda780 prog parse: Handle GL_VERTEX_PROGRAM_NV in glProgramStringARB
Handle both NV vertex programs and NV vertex state programs passed to
glProgramStringARB.
2009-11-07 15:54:33 -08:00
Ian Romanick
289db82b2d prog parse: Handle GL_FRAGMENT_PROGRAM_ARB in glLoadProgramNV 2009-11-07 15:54:32 -08:00
Ian Romanick
7452877cf6 prog parse: Handle GL_FRAGMENT_PROGRAM_NV in glProgramStringARB 2009-11-07 15:54:32 -08:00
Corbin Simpson
a12fc1a9c4 r300g: Organize inlined state. 2009-11-07 14:32:31 -08:00
Corbin Simpson
547e939afb r300g: DCE.
This must never have been called before; it's completely wrong.
2009-11-07 14:14:19 -08:00
Corbin Simpson
9f49db6f84 r300g: Minor code cleanup to avoid confusion. 2009-11-07 13:37:07 -08:00
Corbin Simpson
fa6916cfef r300g: Remove do-nothing functions. 2009-11-07 13:12:15 -08:00
Corbin Simpson
c4fa0e4caa r300g: Remove faulty assert. 2009-11-07 13:07:52 -08:00
Corbin Simpson
b7322fd874 Merge branch 'r300g-vbo'
This is an experimental HW TCL fastpath for r300g. It should run alright.

Thanks to osiris for making this possible.
2009-11-07 12:03:04 -08:00
Corbin Simpson
0fe5f0c09a r300g: Be more verbose in what's killing us WRT vert formats. 2009-11-07 11:55:29 -08:00
Corbin Simpson
cd5b2a93d5 r300g: Comments. 2009-11-07 11:55:29 -08:00
Corbin Simpson
ef513776b5 r300g: Don't assert on oversized VBOs, just return FALSE. 2009-11-07 11:55:25 -08:00
Corbin Simpson
746c01b3b2 r300g: Moar vbo cleanup. 2009-11-07 11:53:14 -08:00
Corbin Simpson
b6c3954138 r300g: s/false/FALSE/
Also s/true/TRUE/
2009-11-07 11:53:14 -08:00
Corbin Simpson
7da3cc4241 r300g: Clean up indexbuf render, switch to RELOC macro. 2009-11-07 11:53:14 -08:00
Corbin Simpson
7518d9b1b7 r300g: Clean up r300_setup_vertex_buffers. 2009-11-07 11:53:14 -08:00
Corbin Simpson
96b729f926 r300g: Don't pass hw_prim around in the context.
And some other fixes.
2009-11-07 11:53:14 -08:00
Corbin Simpson
24c6fdbd32 r300g: Use common state funcs for translating vert formats. 2009-11-07 11:53:14 -08:00
Maciej Cencora
1ef0341ea7 r300g: don't hang GPU on misbehaving apps 2009-11-07 11:53:13 -08:00
Maciej Cencora
3445f47697 r300g: VBOs WIP 2009-11-07 11:53:13 -08:00
Maciej Cencora
d8592d1724 r300g: add missing flush 2009-11-07 11:53:13 -08:00
Maciej Cencora
c7dfffc5d5 r300g: enable CS dumping 2009-11-07 11:53:13 -08:00
Maciej Cencora
6acb26eadf r300g: move vborender context function to seperate file
r300g: Un-migrate r300_draw_render.

It'll make maintaining the SW TCL path easier.
2009-11-07 11:53:06 -08:00
Jakob Bornecrantz
57d77c6a44 i915g: Fix comment in is buffer referenced 2009-11-07 19:31:18 +00:00
brian
18768393d1 mesa: move code after decl
Fixes bug 24967.
2009-11-07 08:18:07 -07:00
Christoph Bumiller
44cb5b5c66 nv50: enable all 32 threads of a warp
This should be the default setting.
See also 7d967b9b7c.
2009-11-07 10:48:36 +01:00
Eric Anholt
8baee3d25b i965: Use Compr4 instruction compression mode on G4X and newer.
No statistically significant performance difference at n=3 with either
openarena or my GL demo, but cutting program size seems like a good
thing to be doing for the hypothetical app that has a working set near
icache size.
2009-11-06 21:24:22 -08:00
Eric Anholt
ec66644ed0 i965: Share min/max between brw_wm_emit.c and brw_wm_glsl.c 2009-11-06 21:08:55 -08:00
Eric Anholt
cfa927766a i965: Share emit_fb_write() between brw_wm_emit.c and brw_wm_glsl.c
This should fix issues with antialiased lines in GLSL.
2009-11-06 21:08:55 -08:00
Eric Anholt
2b58c31257 i965: Share most of the WM functions between brw_wm_glsl.c and brw_wm_emit.c
The PINTERP code should be faster for brw_wm_glsl.c now since brw_wm_emit.c's
had been improved, and pixel_w should no longer stomp on a neighbor to dst.
2009-11-06 21:08:55 -08:00
Eric Anholt
1e5400c575 i965: Share math functions between brw_wm_glsl.c and brw_wm_emit.c. 2009-11-06 21:08:54 -08:00
Eric Anholt
7059aa0eff i965: Share the sop opcodes between brw_wm_glsl.c and brw_wm_emit.c. 2009-11-06 21:08:54 -08:00
Eric Anholt
726ad15606 i965: Share OPCODE_MAD between brw_wm_glsl.c and brw_wm_emit.c 2009-11-06 21:08:54 -08:00
Eric Anholt
bad5b120be i965: Share the DP3, DP4, and DPH between brw_wm_glsl.c and brw_wm_emit.c 2009-11-06 21:08:54 -08:00
Eric Anholt
06c1bc8a22 i965: Add generic GLSL code for unaliasing a 3-arg opcode, and share LRP code. 2009-11-06 21:08:54 -08:00
Eric Anholt
90629704ef i965: Use a normal alu1 emit for OPCODE_TRUNC. 2009-11-06 21:08:54 -08:00
Eric Anholt
71af508072 i965: Share basic ALU ops between brw_wm_glsl and brw_wm_emit.c
This drops support for get_src_reg_imm in these, but the prospect of getting
brw_wm_pass*.c onto our GLSL path is well worth some temporary pain.
2009-11-06 21:08:54 -08:00
Eric Anholt
0f34cdf621 i965: Collect GLSL src/dst regs up in generic code.
This matches brw_wm_emit.c, which we'll be using shortly.  There's a
possible penalty here in that we'll allocate registers for unused channels,
since we aren't doing ref tracking like brw_wm_pass*.c does.  However, my
measurements on GM965 don't show any for either OA or UT2004 with the GLSL
path forced.
2009-11-06 21:08:54 -08:00
Zack Rusin
e521bf7706 st/xorg: implement batching for the composite op
something is broken so disabled for now
2009-11-06 22:08:21 -05:00
Zack Rusin
4322346f3f st/xorg: batch solid fill requests
instead of lots of very small transfers, one larger is a lot better
for performance
2009-11-06 22:08:21 -05:00
Zack Rusin
e1730632aa st/xorg: start accumulating vertices in a common buffer 2009-11-06 22:08:21 -05:00
Zack Rusin
3f7df23ff5 st/xorg: use quads instead of triangle fans
easier to split, accumulate and batch those
2009-11-06 22:08:21 -05:00
Zack Rusin
6c44d399bd st/xorg: make the buffer size global 2009-11-06 22:08:21 -05:00
Ian Romanick
26d2ce0a09 GLX: Change GLX client vendor string to "Mesa Project and SGI"
This change allows a certain closed-source browser plug-in to work
with open-source drivers.
2009-11-06 14:52:49 -08:00
Eric Anholt
6b0bcfafab mesa: Reduce the source channels considered in optimization passes.
Depending on the writemask or the opcode, we can often trim the source
channels considered used for dead code elimination.  This saves actual
instructions on 965 in the non-GLSL path for glean glsl1, and cleans up
the writemasks of programs even further.
2009-11-06 14:27:35 -08:00
Eric Anholt
f3cacfe216 mesa: Fix remove_instructions to successfully remove when removeFlags[0].
This fixes the dead code elimination to work on the particular code
mentioned in the previous commit.
2009-11-06 13:16:49 -08:00
Eric Anholt
e4e312d493 mesa: Add an optimization path to remove use of pointless MOVs.
GLSL code such as:
	vec4 result = {0, 1, 0, 0};
	gl_FragColor = result;

emits code like:
  0: MOV TEMP[0], CONST[0];
  1: MOV OUTPUT[1], TEMP[0];

and this replaces it with:
  0: MOV TEMP[0], CONST[0];
  1: MOV OUTPUT[1], CONST[0];

Even when the dead code eliminator fails to clean up a now-useless MOV
instruction (since it doesn't do live/dead ranges), this should at reduce
dependencies.
2009-11-06 13:16:49 -08:00
Eric Anholt
ee0a9e6e10 mesa: Fix up the remove_dead_code pass to operate on a channel basis.
This cleans up a bunch of instructions in GLSL programs to have limited
writemasks, which would translate to wins in shaders that hit the i965
brw_wm_glsl.c path by depending less on in-driver optimizations.  It will
also help hit other optimization passes I'm looking at.
2009-11-06 13:16:49 -08:00
Brian Paul
3105f3aa88 intel: better front color buffer test in intelClear() 2009-11-06 13:52:48 -07:00
Eric Anholt
8395da2e8a i965: Always pass the size argument to brw_cache_data.
This keeps the individual state files from having to export their
structures for brw_state_cache initialization.
2009-11-06 11:37:32 -08:00
Eric Anholt
1166294d1d intel: Finish removing the fallback code for bug #16697.
I fixed it properly as of 7216679c19.
2009-11-06 11:37:32 -08:00
Eric Anholt
75bdbdd90b intel: Don't validate in a texture image used as a render target.
Otherwise, we could lose track of rendering to that image, which could
easily happen during mipmap generation.
2009-11-06 11:37:32 -08:00
Eric Anholt
6b68482e68 mesa: Attempt to pair up Driver.RenderTexture and FinishRenderTexture()
This is probably not 100% complete (bind vs unbind may still not pair up
exactly), but it should help out drivers which are relying on
FinishRenderTexture to be called when we're done rendering to a particular
texture level, not just when we're done rendering to the object at all.
This is the case for the one consumer of FinishRenderTexture() so far: the
gallium state tracker.  Noticed when trying to make use of FRT() in the intel
driver.
2009-11-06 11:37:32 -08:00
Eric Anholt
8df81bca17 intel: Clean up some extra struct indirection in finalize. 2009-11-06 11:37:32 -08:00
Eric Anholt
ee7dfbbd6c intel: Use _mesa_get_current_tex_object() to clean up TFP path. 2009-11-06 11:37:31 -08:00
Eric Anholt
8f30ceaaef intel: Remove duplicated arguments from intel_miptree_match_image(). 2009-11-06 11:37:31 -08:00
Eric Anholt
2bc8bcdcd3 i965: Remove an XXX comment for testing some code that seems to work. 2009-11-06 11:37:31 -08:00
Eric Anholt
bb2dd50be0 intel: Remove obsolete comment about GEM in the spans code. 2009-11-06 11:37:31 -08:00
Eric Anholt
8e0f40d287 intel: Use PIPE_CONTROL on gen4 hardware for doing pipeline flushing.
This should do all the things that MI_FLUSH did, but it can be pipelined
so that further rendering isn't blocked on the flush completion unless
necessary.
2009-11-06 11:37:31 -08:00
Eric Anholt
caf3038123 Make a convenient int for what chipset generation we're on.
gen2/3/4 are easier to say than "8xx, 915-945/g33/pineview, 965/g45/misc",
and compares on generation are often easier than stringing together a bunch
of chipset checks.
2009-11-06 11:37:31 -08:00
Ian Romanick
4e4c2ee1fd Merge branch 'mesa_7_6_branch'
This should fix the memory leaks in the assembly parser without the
regressions.

The conflicts in program_lexer.l were related to changes in returning
strings between the branches (always return IDENTIFIER vs. returing
either IDENTIFIER or USED_IDENTIFIER).

The conflicts in program_parse.y were related to two changes in master
One change prints a variable name in an error message.  The other
change adds outputVarSize to the OUTPUT_statement rule.  The cause the
position of the IDENTIFIER to change from $2 to $3.

Conflicts:
	src/mesa/shader/lex.yy.c
	src/mesa/shader/program_lexer.l
	src/mesa/shader/program_parse.tab.c
	src/mesa/shader/program_parse.y
2009-11-06 11:17:00 -08:00
Ian Romanick
9348ac03ce ARB prog parser: Regenerate parser from previous commits. 2009-11-06 10:46:23 -08:00
Ian Romanick
d8e256f923 ARB prog parser: Release old program string in _mesa_parse_arb_{fragment,vertex}_program
The program structure passed to _mesa_parse_arb_program is just a
place holder.  The stings that actually need to be released are only
known to the functions calling _mesa_parse_arb_program, so they should
be freed there.
2009-11-06 10:46:22 -08:00
Ian Romanick
301a9b7e28 ARB prog parser: Release strings returned from the lexer that don't need to be kept 2009-11-06 10:46:22 -08:00
Ian Romanick
1c7337d46e Revert "ARB prog parser: Fix epic memory leak in lexer / parser interface"
This reverts commit 93dae6761b.

This change was completely broken when the parser uses multiple
strings in a single production.  It would be nice if bug fixes could
initially land somewhere other than the stable branch.
2009-11-06 10:46:22 -08:00
José Fonseca
96e938f62c llvmpipe: Fix build with llvm 2.6.
Fixes bug 24949.
2009-11-06 15:08:05 +00:00
Brian Paul
38d3c156dc intel: call intel_check_front_buffer_rendering() in intelClear()
fixes bug 24953.
2009-11-06 08:00:38 -07:00
José Fonseca
577a598dc9 mesa: Export S3_s3tc as well.
Used in Quake3.
2009-11-06 12:06:45 +00:00
José Fonseca
f611425101 mesa: Translate MAP_UNSYNCHRONIZED_BIT. 2009-11-06 12:06:44 +00:00
José Fonseca
244591ae7b gallium: Add UNSYNCHRONIZED cpu access flag. Document others. 2009-11-06 12:06:44 +00:00
Zack Rusin
25728860fc st/xorg: unify vertex buffer handling
first step on our way to batching
2009-11-06 00:19:54 -05:00
Brian Paul
63191bd244 xmesa: pass pixmap to clip_for_xgetimage()
The code was assuming ctx->DrawBuffer == ctx->ReadBuffer.
Passing the pixmap is simpler and better.
Fixes a potential segfault.
2009-11-05 16:48:52 -07:00
Brian Paul
d971069fc6 mesa: fix infinite loop bug in _mesa_drawbuffers()
Fixes bug 24946.
This regression came from 8df699b3bb.
2009-11-05 13:17:21 -07:00
José Fonseca
67034b9efc softpipe: Implement PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE for destination.
It is a valid and tested combination on D3D9.
2009-11-05 19:44:07 +00:00
Cooper Yuan
e0590159ce g3dvl: remove a debug line 2009-11-05 16:06:01 +08:00
Cooper Yuan
c621c100b2 g3dvl: add scissor setting 2009-11-05 15:59:27 +08:00
Marek Olšák
c2e47191d7 r300g: add polygon mode
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Marek Olšák
4671005a43 r300g: fix the size of CS when emitting the fragprog constant buffer
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Marek Olšák
07190888bd r300g: set the correct offset in a colorbuffer surface
Suggested by Joakim Sindholt.

Also, put flushing of colorbuffers _before_ the framebuffer state setup,
suggested by docs.

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Marek Olšák
ad96c0d851 r300g: add color channel masking
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Brian Paul
7c623905bc mesa: added cast to silence warning 2009-11-04 17:58:43 -07:00
Brian Paul
898de4a9d5 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/windows/gdi/mesa.def
2009-11-04 17:57:20 -07:00
Brian Paul
1c3f7ab74c vbo: fix out-of-bounds array access
The exec->vtx.inputs[] array was being written past its end.  This was
clobbering the following vbo_exec_context::eval state.  Probably not noticed
since evaluators and immediate mode rendering don't happen at the same time.

Fixed the loop in vbo_exec_vtx_init().
Changed the size of the vbo_exec_context::vtx.arrays[] array.
Added a bunch of debug-build assertions.

Issue found by Vinson Lee.
2009-11-04 17:51:28 -07:00
Brian Paul
bc4ad7c2ae mesa: fix broken pack_histogram() case for GLhalf 2009-11-04 17:42:30 -07:00
Brian Paul
76aa0c0fd3 mesa: silence warning from gcc 4.4.1 2009-11-04 17:42:01 -07:00
Brian Paul
fe86f8d732 ARB prog parser: include variable name in error text 2009-11-04 17:27:49 -07:00
Zack Rusin
4c5a758d06 st/xorg: these flushes shouldn't be necessary
performance optimization
2009-11-04 18:10:33 -05:00
Vinson Lee
60c328db2d progs/tests: Fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-04 15:56:14 -07:00
Alex Deucher
9fce12b894 r600: rework draw functions
Seems INDX_OFFSET doesn't work properly on some cards,
so change back to immediate mode indices.  Seems to only
affect DRI1.  Needs more investigation.

Rework and clean up the draw functions.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-04 16:59:13 -05:00
Alex Deucher
70dade8afe r600: fix count prediction for IB case
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-04 14:43:24 -05:00
Alan Hourihane
f1b91ccc08 Fix YTILE spantmp functions 2009-11-04 15:26:38 +00:00
Alan Hourihane
3040b2ee9d Fix YTILE spantmp functions 2009-11-04 14:48:25 +00:00
Vinson Lee
51f7763c00 glslcompiler: Fix Mac OS build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-04 07:14:55 -07:00
José Fonseca
0b4ea45e8a util: Remove homegrown Windows KM profiler.
It's not sampling based so its results are biased towards functions called
many times.
2009-11-04 12:15:29 +00:00
Michal Krol
767bc8eb5a tgsi/ureg: Allow for multiple extended instruction tokens.
For example, we would like to have a predicate and texture token
in one instruction to do predicated texture sampling.
2009-11-04 11:47:10 +00:00
Christoph Bumiller
618e3b89f6 nv50: fix shader emit_tex for cube textures 2009-11-04 00:53:52 +01:00
Christoph Bumiller
317ccfe0df nv50: add abs-modifier for emit_minmax 2009-11-04 00:53:51 +01:00
Christoph Bumiller
040e1d008f nv50: add 3d texture tiling and mip-mapping
Mip-mapped 3D textures are not arrays of 2D layers
with a mip-map layout like 2D textures, therefore we
cannot use image_nr == depth for them.

Making use of "volume tiling" modes now, the allowed
modes are 0xZY where Z <= 5 and y <= 5.
2009-11-04 00:53:51 +01:00
Brian Paul
6eb71519f7 mesa: (GLint64) casts in get.c to silence Visual Studio warnings
Revised version of a patch from Karl Schultz.
2009-11-03 16:13:24 -07:00
Brian Paul
c5106339d3 docs: fix 7.6 build with Visual Studio 2009-11-03 16:12:02 -07:00
Karl Schultz
804d367a47 windows: updated VC8 project file
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 16:09:29 -07:00
Karl Schultz
077eb0d81c windows: remove old entrypoints from mesa.def file
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 16:08:46 -07:00
Karl Schultz
e713a95c96 mesa: added GLAPIENTRY keywords for sync object functions
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 16:05:12 -07:00
Vinson Lee
c475079ef2 progs/util: Fix memory leak if fail to load/compile shader
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 14:49:41 -07:00
Michal Krol
ceb6728725 llvmpipe: Sanitise shader semantic and interpolator handling.
Handle the remaining semantic names and indices.
Respect color interpolator when not flatshading.

Based on Michal's softpipe commit
eb699d64ec.
2009-11-03 17:12:34 +00:00
Keith Whitwell
026cf84bbb llvmpipe: remove old prim_setup draw stage
Everything now goes through the draw_vbuf handler, the same as
regular drivers.

Based on Keith's commit 4fe0fc3eba.
2009-11-03 17:12:34 +00:00
José Fonseca
677a055fa0 llvmpipe: Respect gl_rasterization_rules in primitive setup.
Based on Michal's identical commit for softpipe
(ca9c413647).
2009-11-03 17:12:34 +00:00
José Fonseca
3e8f665c1e python/retrace: Cope with null constant buffers. 2009-11-03 17:12:33 +00:00
José Fonseca
a2e868b977 python/retrace: Add missing colon. 2009-11-03 17:12:33 +00:00
Brian Paul
a017ad2861 progs/tests: debug code for getting texture component sizes 2009-11-03 10:01:10 -07:00
Michal Krol
7ccf60ae40 tgsi: Up tgsi_exec's control flow nesting to 32. 2009-11-03 16:56:50 +00:00
Brian Paul
4bced42341 Merge branch 'mesa_7_6_branch' 2009-11-03 09:54:09 -07:00
Brian Paul
800e553e7a mesa: clean-up, remove some flushing in FBO functions
Remove some unneeded flushes.
Replace FLUSH_CURRENT w/ FLUSH_VERTICES in other places.
2009-11-03 09:52:25 -07:00
Brian Paul
4de18fb093 mesa: fix indentation 2009-11-03 09:52:25 -07:00
Brian Paul
5698d7cd75 mesa: clean-up formatting 2009-11-03 09:52:25 -07:00
Brian Paul
18af75e501 mesa: avoid extraneous _NEW_BUFFER changes in _mesa_BindFramebufferEXT() 2009-11-03 09:52:25 -07:00
Brian Paul
c7048f9d9f mesa: use FLUSH_VERTICES() in _mesa_drawbuffers() 2009-11-03 09:52:25 -07:00
Brian Paul
8df699b3bb mesa: avoid extraneous _NEW_BUFFER state in _mesa_drawbuffers() 2009-11-03 09:52:25 -07:00
Brian Paul
b28c637382 mesa: use ffs() to shorten loop in _mesa_drawbuffers() 2009-11-03 09:52:25 -07:00
Brian Paul
2d11c48223 mesa: added assertion, another comment 2009-11-03 09:52:25 -07:00
Brian Paul
bcbfda71b0 intel: avoid unnecessary front buffer flushing/updating
Before, if we just called glXMakeCurrent() and didn't render anything we'd
still trigger a flushFrontBuffer() call.

Now only set the intel->front_buffer_dirty field at state validation time
just before we draw something.

NOTE: additional calls to intel_check_front_buffer_rendering() might be
needed if I missed some rendering paths.
2009-11-03 09:52:25 -07:00
Marek Olšák
a0cd2b7029 st/mesa: clip pixels in draw_stencil_pixels to avoid crash
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 09:48:04 -07:00
Brian Paul
e60ebebb39 st/mesa: don't use util_blit_pixels_writemask() for depth or depth/stencil
util_blit_pixels_writemask() only works for color formats at this time.
Also, it might never work for depth/stencil surfaces since we can't get
handle stencil values in a fragment shader.

Fixes glCopyTexSubImage(GL_DEPTH_COMPONENT).
2009-11-03 09:48:04 -07:00
Brian Paul
0197348641 st/mesa: fix tests for depth and depth/stencil texture formats 2009-11-03 09:48:04 -07:00
Brian Paul
644d8fd363 mesa: added comment 2009-11-02 19:38:35 -07:00
Brian Paul
7157479b25 mesa: use _mesa_get_current_tex_object() 2009-11-02 19:38:35 -07:00
Brian Paul
1afe60e802 mesa: use _mesa_get_current_tex_object() 2009-11-02 19:38:35 -07:00
Brian Paul
b8fdb900fb mesa: make _mesa_get_current_tex_objec() public 2009-11-02 19:38:35 -07:00
Ian Romanick
731810f854 ARB prog parser: Fix a couple issues with previous merge from mesa_7_6_branch
Since the addition of support for Nvidia condition codes, the lexer internally
uses handle_ident to select between returning IDENTIFIER and USED_IDENTIFIER.
Also, use return_string instead of strdup.

Fixes bug #24809.
2009-11-02 12:44:14 -08:00
Vinson Lee
e055665752 glx: Fix memory leak if XF86DRICreateDrawable() fails
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-02 12:35:47 -07:00
Pierre Ossman
213ec8251c r600: implement LOG op in compiler 2009-11-02 11:30:00 -05:00
Pierre Ossman
d00cbba403 r600: implement EXP op in compiler 2009-11-02 11:29:54 -05:00
Michal Krol
c379fbbe24 tgsi/ureg: Add negate and swizzle for predicates. 2009-11-02 14:59:52 +00:00
Brian Paul
c02cd82b46 mesa: fix incorrect approx bits/channel for fxt1 formats
See bug 24806.
2009-11-02 06:52:10 -07:00
Brian Paul
a40055f4b6 gallium/util: add casts to silence warnings 2009-11-02 06:51:47 -07:00
Michal Krol
962ece9540 tgsi/ureg: Update for gallium interface changes. 2009-11-02 09:44:21 +00:00
Michal Krol
aa2b2e5d7d tgsi: Update for gallium interface changes. 2009-11-02 09:44:20 +00:00
Michal Krol
0a7d50ed7e gallium: Cleanup predicate and condition code TGSI tokens.
There is little point in having a special TGSI token just to handle
predicate register updates. Remove tgsi_dst_register_ext_predicate token
and instead use a new PREDICATE register file to update predicates.
Actually, the contents of the obsolete token are being moved
to tgsi_instruction_ext_predicate, where they should be
from the very beginning.

Remove the NVIDIA-specific condition code tokens -- nobody uses them
and they can be emulated with predicates if needed.

Introduce PIPE_CAP_SM3 that indicates whether a driver supports
SM3-level instructions, and in particular predicates.

Add PIPE_CAP_MAX_PREDICATE_REGISTERS that can be used to query the driver
how many predicate registers it supports (currently it would be 1).
2009-11-02 09:44:18 +00:00
Michal Krol
eb699d64ec softpipe: Sanitise shader semantic and interpolator handling.
Handle the remaining semantic names and indices.
Respect color interpolator when not flatshading.
2009-11-02 09:44:16 +00:00
Younes Manton
87d7c1aa15 nouveau: Assume all texture blankets are linear for now. 2009-11-01 18:27:47 -05:00
Corbin Simpson
1f630fa016 r300g: Miscellania. Avoid draw segfaults, s/true/TRUE/, etc.
Cleared out my git stash.
2009-11-01 11:54:52 -08:00
Maciej Cencora
3d73852121 r300g: fix geometry corruptions
PVS flush is needed before changing the vertex shader or vertex shader constants.
2009-11-01 11:02:02 -08:00
Maciej Cencora
2db46af875 r300g: split constant buffer and shader emittion 2009-11-01 11:01:40 -08:00
Corbin Simpson
cab749a1d0 r300g: Adopt osiris' PSC data and swizzle.
A fair amount more flexible and easier to maintain.
2009-11-01 09:24:02 -08:00
Christoph Bumiller
5de8f97440 nv50: handle TGSI_SEMANTIC_FACE 2009-11-01 14:28:08 +01:00
Christoph Bumiller
496c9eaacf nv50: make IF condition safe
Don't assume that a SET that writes to IF's argument
directly precedes the IF.
2009-11-01 14:28:04 +01:00
Christoph Bumiller
99e308a0e0 nv50: implement TGSI_OPCODE_AND/OR/XOR
Will use AND for gl_FrontFacing, the face input
is either 0 or 0xffffffff.
2009-11-01 14:27:35 +01:00
Christoph Bumiller
1cc16e1b83 nv50: fix textures with block size != cpp
First, using width * block size as pitch is evidently
wrong if a block contains more than 1 texel.

For tiled textures, since a block occupies a contiguous
area of memory, y addressing in m2mf has to be done by
block index, not the y coordinate itself.

This should fix compressed textures.
2009-10-31 20:51:09 +01:00
Younes Manton
91232b7004 nouveau: Support X8R8G8B8 textures on nv30, nv40 and RTs on nv10-nv40. 2009-10-31 09:42:49 -04:00
Christoph Bumiller
9831e1f76c nv50: use SIFC also for shader upload
Adds a more generic SIFC transfer function.
2009-10-31 13:40:33 +01:00
Christoph Bumiller
525f529d13 nv50: make MRTs work
We have to indicate to the hw whether the FP exports
multiple colour results.
Method 0x121c is used to specify the number of RTs.
Also deactivate zeta explicitly if there's no zsbuf.
2009-10-31 13:40:33 +01:00
Dave Airlie
73b45b0669 radeon: add missing include 2009-10-31 21:24:50 +10:00
Marek Olšák
c9928ac3ee r300g: correct the pitch calculation for smaller mipmaps 2009-10-31 07:30:48 +01:00
Marek Olšák
3f60130b87 r300g: pretend NPOT support
It's requires to get GL2.1, therefore, much more piglit tests can be used
for testing. Figure out later how to emulate this.
2009-10-31 07:30:48 +01:00
Marek Olšák
a8f85dceb5 r300g: fix reading from the destination buffer in blending 2009-10-31 07:30:48 +01:00
Marek Olšák
63c9450ae7 r300g: add precalculating of pixel pitch, add a new NPOT flag 2009-10-31 07:30:48 +01:00
Marek Olšák
11180b4471 r300g: remove unnecessary assertions
Also, correct typos in comments.
2009-10-31 07:30:48 +01:00
Marek Olšák
ace78d90de r300g: fix crash in r300_is_texture_referenced
Also, a subtle fix in emitting a texture state
2009-10-31 07:30:47 +01:00
Dave Airlie
5cf7c8e2d5 radeon: use _mesa_get_current_tex_unit 2009-10-31 15:50:12 +10:00
Brian Paul
5e9f97f0ea ARB prog parser: regenerated files 2009-10-30 19:08:19 -06:00
Brian Paul
df5615de1f ARB prog parser: new set_src_reg(), set_dst_reg() helpers
These functions do sanity checks on the register file and index.
2009-10-30 19:08:18 -06:00
Brian Paul
a71edc9455 mesa: better error message 2009-10-30 19:08:18 -06:00
Eric Anholt
7c8bed62e0 intel: Use GTT mapping when available for swrast.
This improves piglit quick.tests runtime from 19:33 minutes to 6:06 on
my GM45.  It should also hide most of the A17 swizzling issues, though
they'll still exist when swapping occurs (which is the kernel's problem
either way).
2009-10-30 17:35:12 -07:00
Eric Anholt
d63c29ef20 x86: Fix the test for negative pixel count in optimized rgb565 spans.
There's a bunch of bogus looking stuff the count handling in this code, but
this fixes the testcases we have.
2009-10-30 17:35:11 -07:00
Eric Anholt
21a3a79371 intel: Fix up z24_x8 depth spans since the texformat merge. 2009-10-30 17:35:11 -07:00
Vinson Lee
9c3197ef0a prog/tests: Fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-30 15:30:13 -06:00
Eric Anholt
cb132406de i965: Add an index assert on get_fp_inst array like other compiler arrays. 2009-10-30 13:28:44 -07:00
Eric Anholt
2c30ee9bd6 i965: Fix BRW_WM_MAX_INSN to reflect current limits.
Part of fixing bug #24355.
2009-10-30 13:20:34 -07:00
Eric Anholt
2073006c95 intel: Set the texture format in the TFP path.
This fixes a regression in piglit's tfp test as of
11caea687e.  Additionally, set the texture
format for the RGB textures to MESA_FORMAT_XRGB8888 and support it in the
hw paths so that hopefully sw fallbacks involving TFP get better alpha
behavior.

The radeon drivers appear to need the same fix.

Bug #24803
2009-10-30 12:41:28 -07:00
Alex Deucher
b568a2c808 r600: remove duplicate line 2009-10-30 15:08:09 -04:00
Alex Deucher
703a836d40 r600: fill in some missing tex formats
This improves shadowtex since the component ordering
is at least correct now, but I'm not sure how to
deal with texturing from a depth surface yet due to
differences in depth and color tile layouts.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-10-30 15:02:34 -04:00
Alex Deucher
57864f6e04 r600: fix a warning, update comments 2009-10-30 11:52:02 -04:00
Vinson Lee
a8ed066858 progs/tests: fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-30 09:40:04 -06:00
Andre Maasikas
5f7d5d3ea3 r600: use AUTO_INDEX for draw - saves cmd buffer space
also seems we can use INDX_OFFSET if start != 0
2009-10-30 17:18:00 +02:00
Brian Paul
409469fb70 intel: fix up some XRGB breakage
We weren't choosing the right XRGB span functions for reading the
framebuffer.  XRGB formats still aren't turned on yet though.
2009-10-30 09:13:04 -06:00
Brian Paul
730a3de9f9 mesa: fix inverted buffer object test
Fixes bug 24799.
2009-10-30 08:31:01 -06:00
Brian Paul
71cd40bccf mesa: fix incorrect format info for MESA_FORMAT_SL8
Fixes bugs 24798 and 24801.
2009-10-30 08:21:16 -06:00
Chow Loong Jin
35506dec67 Add --with-dri-searchpath argument
* Add an extra argument to configure which allows for specifying
  different DRI driver search paths to libGL (FDO #24766)

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-10-30 06:00:13 -07:00
Michal Krol
ca9c413647 softpipe: Respect gl_rasterization_rules in primitive setup. 2009-10-30 08:05:40 +00:00
Brian Paul
4a253431ab intel: update intel_create_renderbuffer(format), add XRGB support
Pass a gl_format to intel_create_renderbuffer() instead of GLenum.
Add cases for MESA_FORMAT_XRGB8888 textures and renderbuffers.
However, we don't yet create any renderbuffers or textures with that
format.  It seems the default alpha value is zero instead of one.
Need to investigate that first.
2009-10-29 19:12:50 -06:00
Brian Paul
f920d496e1 mesa: fix _mesa_texstore_argb8888() for MESA_FORMAT_XRGB8888
If we hit the general path and call _mesa_make_temp_chan_image() we
always want to get a GL_RGBA texture.  We were getting a 3-channel
GL_RGB texture before and that messed up the memory layout.
2009-10-29 17:52:01 -06:00
Alex Deucher
c243e8dd23 r600: remove the no rrb messages 2009-10-29 19:44:35 -04:00
Alex Deucher
b924579bd4 r600: Add support for ARB_depth_clamp 2009-10-29 19:42:52 -04:00
Brian Paul
d0b6147291 intel: remove memcpy_get_tex_image() code
This has been lifted into core Mesa where it can be used for all drivers
that use the _mesa_get_teximage() fallback for ctx->Driver.GetTexImage().
2009-10-29 16:31:57 -06:00
Brian Paul
fcbf663640 mesa: lift memcpy_get_tex_image() code from intel driver into core Mesa
The code should work for any driver.
2009-10-29 16:31:57 -06:00
Brian Paul
bde7874317 mesa: refactor _mesa_get_teximage() code
Break different formats into different functions to make it easier to read.
2009-10-29 16:31:57 -06:00
Brian Paul
217a40d8d9 i965: indentation fix 2009-10-29 16:31:57 -06:00
Brian Paul
26d22b094b i965: make brw_sf_prog_key::sprite_origin_lower_left one bit
Shrinks size of key to 8 bytes from 12.
Note that progs/demos/spriteblast.c is still broken.
2009-10-29 16:31:56 -06:00
Brian Paul
035b21f365 i965: make brw_wm_prog_key a little smaller
GLushort is big enough for the swizzle and origin fields.
The key could probably be made smaller still by re-ordering things.
I'll hold off on that until after the outputswritten64 branch is merged.
The key will get a little larger again with the GLbitfield64 fields.
2009-10-29 16:31:56 -06:00
Eric Anholt
8a9afe71b8 i915: Fix 1D texture mapping in the t coordinate.
Fixes piglit tex1d-2dborder test.
2009-10-29 14:56:52 -07:00
Eric Anholt
4b377ae292 i915: Correct and make use of the defines for 32-bit depth texture modes.
Previously, S8_Z24 depth textures would always be treated as intensity.
Fixes piglit depth-tex-modes.
2009-10-29 14:56:52 -07:00
Brian Paul
861fec163c i965: avoid shader translation on window resize
If the fragment shader doesn't use FRAG_ATTRIB_WPOS (gl_FragCoord) we
don't need to worry about the window size and origin in
brw_wm_populate_key().

This avoids re-generating the i965 shader code when a window is resized.

Issue spotted by Keith Whitwell.
2009-10-29 15:33:43 -06:00
Brian Paul
198ec96d36 i965: define, use BRW_MAX_DRAW_BUFFERS
i965 might support more than 4 color draw buffers.  But if not, this protects
from breakage if the Mesa limit is raised.
2009-10-29 15:33:43 -06:00
Brian Paul
7648c80ac8 i965: remove unused var 2009-10-29 15:33:43 -06:00
Brian Paul
9ef33b8685 i965: don't use context state in emit_fb_write()
Put the state that we care about in the hash key.
Issue spotted by Keith Whitwell.
2009-10-29 15:33:43 -06:00
Brian Paul
a8d233e509 i965: use macros to get/set prog_instruction::Aux field
This makes things a bit easier to remember/understand.
2009-10-29 15:33:43 -06:00
Brian Paul
a0959bcee5 i965: minor code reformatting 2009-10-29 15:33:43 -06:00
Brian Paul
02b9fb9c80 progs/tests: fixes for drawbuffers.c
Disable GL_DEPTH_TEST before glDrawPixels.
Show color buffer 0 on left, color buffer 1 on right.
2009-10-29 14:46:35 -06:00
José Fonseca
c6164ff155 mesa: Add MESA_FORMAT_Z24_X8. 2009-10-29 20:03:51 +00:00
Zack Rusin
a7fa56a64b st/xorg: fix scaling ov xv data, plus some cleanups 2009-10-29 15:13:17 -04:00
Eric Anholt
f8f40b53a6 i915: Implement min/max LOD clamping with the hardware.
This gets us expected behavior for clamping between mipmap levels, and
avoids relayout of textures for doing clamping.

Fixes piglit lodclamp-between.
2009-10-29 12:06:04 -07:00
Eric Anholt
3744472441 i965: Replace a MIN(MAX()) with CLAMP(). 2009-10-29 12:06:03 -07:00
Brian Paul
ea414e3318 intel: check for single memcpy() in memcpy_get_tex_image() 2009-10-29 11:04:24 -06:00
Eric Anholt
92e7c6a258 i965: Fix fallout from ARB_depth_clamp enablement that broke glDepthRange.
If a backwards glDepthRange was supplied (as with the old Quake no-z-clearing
hack), the hardware would have always clamped because we weren't clamping to
the min of near/far and the max of near/far.  Also, we shouldn't be clamping
to near/far at all when not in depth clamp mode (this usually didn't matter
since near/far are usually the same as the 0.0, 1.0 clamping you do for
fixed-point depth).

This should fix funny depth issues in PlaneShift, and fixes piglit
depth-clamp-range
2009-10-29 10:01:17 -07:00
Eric Anholt
32ec3f2673 mesa: Mostly fix swrast's ARB_depth_clamp support.
I'd written a testcase for the hard part of the extension enablement, so
naturally the easy stuff was completely broken.  There are still issues,
as I'm seeing FLOAT_TO_UINT(max_f) == 0x0 when max_f == 1.0, but it gets
piglit depth-clamp-range closer to success.
2009-10-29 10:01:17 -07:00
Eric Anholt
6eb6a0e9cb intel: Don't bother MI_FLUSHing on glFlush in the DRI2 case.
We only need it when drawing to the front buffer, which we never do for
DRI2.  No significant performance difference, but the flush is definitely
gone from the end of every batchbuffer.
2009-10-29 10:01:17 -07:00
Eric Anholt
fb0084e69e intel: Clean up merge leftover from the DRI2 swap throttling. 2009-10-29 10:01:16 -07:00
Brian Paul
1596f714d2 intel: remove debug code 2009-10-29 10:56:13 -06:00
Brian Paul
2b628d43c0 mesa: consolidate some code in _mesa_GetCompressedTexImageARB() 2009-10-29 10:53:26 -06:00
Brian Paul
dcb4716802 intel: added fast memcpy path for glGetTexImage() 2009-10-29 10:50:26 -06:00
Brian Paul
1e2c517026 progs/tests: also test GL_BGRA format in getteximage.c 2009-10-29 10:50:26 -06:00
Brian Paul
01ee5c63d3 mesa: move pixels==NULL check in glGetTexImage() 2009-10-29 10:50:26 -06:00
Brian Paul
99bbf4b4f5 mesa: consolidate some code in _mesa_GetTexImage() 2009-10-29 10:50:26 -06:00
Brian Paul
67df4fb56b mesa: move, clean-up _mesa_print_texture() 2009-10-29 10:50:26 -06:00
Brian Paul
d580c0c8f7 mesa: fix some tests in subtexture_error_check2()
Don't use hard-coded compressed block sizes.
Update comments and error strings.
2009-10-29 10:50:26 -06:00
Brian Paul
cf7040594e mesa: remove unneedded is_srgb_teximage() function
Use _mesa_get_format_color_encoding() function instead.
2009-10-29 10:50:26 -06:00
Brian Paul
c89f5b6ac8 glsl: make shader substitution a little better 2009-10-29 10:50:26 -06:00
David Heidelberger
41892e9b17 st/mesa: fix PIPE_FORMAT_X8Z24 <> MESA_FORMAT_X8_Z24 conversion
Signed-off-by: David Heidelberger <d.okias@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-29 10:14:41 -06:00
David Heidelberger
10a509564f st/mesa: Add conversion from PIPE_FORMAT_X8Z24_UNORM to MESA_FORMAT_S8_Z24.
Fix glxgears and openarena for Nouveau (no more asserts and crash).

Signed-off-by: David Heidelberger <d.okias@gmail.com
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-29 09:56:14 -06:00
David Heidelberger
c2f5eb7148 st/mesa: Fix nouveau glxinfo after merging texformat-rework.
Signed-off-by: David Heidelberger <d.okias@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-29 09:54:38 -06:00
Brian Paul
1f1bfe8cb5 mesa: move declaration to prevent unused var warning 2009-10-29 07:54:44 -06:00
Chia-I Wu
9927d7f31c mesa: Fix compilation errors and warnings when features are disabled.
Some of the fixes are cherry-picked from opengl-es branch.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Chia-I Wu
59798cd886 mesa/main: Make FEATURE_texture_s3tc follow feature conventions.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Chia-I Wu
20e20fc5af mesa/main: Make FEATURE_texture_fxt1 follow feature conventions.
Also remove the unused initialization and GLchan fetch functions.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Chia-I Wu
920f023e8b mesa/main: Never return NULL in _mesa_get_texstore_func.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Brian Paul
e2131e0171 radeon: fix incorrect Z format in radeon_alloc_renderbuffer_storage()
And update error message.
2009-10-29 07:47:41 -06:00
Cooper Yuan
da1fb3be82 r300g: Fix bytes_per_line calculation error while displaying surface 2009-10-29 20:20:59 +08:00
Chia-I Wu
59b29516af swrast: added braces 2009-10-28 22:14:01 -06:00
Brian Paul
c6bd5fae0c mesa: remove old, unused #define 2009-10-28 21:52:37 -06:00
Brian Paul
635ea87374 progs/tests: added test for GL_EXT_texture_compression_s3tc support 2009-10-28 21:50:51 -06:00
Brian Paul
bd36ca9b76 mesa: re-remove s3v and trident driver files
These were removed from master but a few files came back from the
texformat-rework branch.
2009-10-28 21:46:37 -06:00
Brian Paul
960d49b387 mesa: move some gl_texture_image and gl_renderbuffer fields around 2009-10-28 21:43:50 -06:00
Brian Paul
bc143b1a9f mesa: minor code movement 2009-10-28 21:25:56 -06:00
Brian Paul
1f196b786d Merge branch 'texformat-rework'
Conflicts:
	src/mesa/drivers/dri/radeon/radeon_fbo.c
	src/mesa/drivers/dri/s3v/s3v_tex.c
	src/mesa/drivers/dri/s3v/s3v_xmesa.c
	src/mesa/drivers/dri/trident/trident_context.c
	src/mesa/main/debug.c
	src/mesa/main/mipmap.c
	src/mesa/main/texformat.c
	src/mesa/main/texgetimage.c
2009-10-28 21:24:11 -06:00
Brian Paul
086f9fc0e2 swrast: fix RGB, RGBA texturing code
Fix backward component ordering for RGB textures.
Only optimize RGBA texture case if running little endian.  This restriction
could be lifted with a little work.
2009-10-28 19:46:28 -06:00
Brian Paul
88bb4b5935 swrast: check for single texture unit in _swrast_choose_triangle() 2009-10-28 19:41:24 -06:00
Brian Paul
0103d7a47a swrast: clean up and remove dead code in triangle functions 2009-10-28 19:40:56 -06:00
Brian Paul
1e7517f059 swrast: fix texel decoding in opt_sample_rgba_2d() 2009-10-28 19:38:12 -06:00
Brian Paul
7ac233ec15 mesa: choose texture format in _mesa_get_fallback_texture() 2009-10-28 19:33:48 -06:00
Brian Paul
0ea575d721 Merge branch 'mesa_7_6_branch' 2009-10-28 18:27:25 -06:00
Vinson Lee
96128fdf2f mesa: Fix memory leak if we run out of memory
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-28 17:59:49 -06:00
Zack Rusin
24c61c8c2e st/xorg: fix src coordinates in the video acceleration paths 2009-10-28 16:53:50 -04:00
Alex Deucher
660acd60d0 r600: add occlusion query support
Based on initial patch from Stephan Schmid <stephan_2303@gmx.de>.

Basic idea is to dump the zpass count at the start and end of the query
and subtract to get the total number of visible fragments.  HW writes
alternating qwords for up to 4 DBs.  On the first pass, we start at
buffer address + 0; on the second pass, we start at buffer address + 8
(bytes). The resulting buffer at the end of the query looks like:

qw[0]: db0 start
qw[1]: db0 end
...
qw[6]: db3 start
qw[7]: db3 end

The MSB of each qword is the valid bit and the lower 63 bits are
the zpass count for that DB.

OQ on RV740 is disabled at the moment as it only seems to report
results for half of its DBs.  This needs further investigation.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-10-28 15:53:24 -04:00
Corbin Simpson
f3d8d534e6 r300g: Use u_trim_pipe_prim to prevent lockups from incorrect vert counts.
Adapted from osiris' version on his tree.
2009-10-28 12:15:35 -07:00
Corbin Simpson
23d8d15bed r300g: Keep texture formats organized. 2009-10-28 12:15:35 -07:00
Maciej Cencora
e7c8a27638 r300g: add some texture formats 2009-10-28 12:15:35 -07:00
Corbin Simpson
6007e2e008 r300g: Clear up a bit of the buffer reference stuff.
Still need to actually get reference info from winsys somehow. Doing added
buffers is easy, but knowing whether a flush has happened is a bit tricky.
2009-10-28 12:15:34 -07:00
Corbin Simpson
81c51bb67f r300g: Fix XXX.
Nothing strange here.
2009-10-28 12:15:34 -07:00
Marek Olšák
bcfde42913 r300g: fix emitting the stencil-ref and alpha-ref values
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>

DSA really needs its head examined someday. ~ C.
2009-10-28 12:15:34 -07:00
Marek Olšák
a1d726aae8 r300g: fix the WRAP_T mode when using 1D textures
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-10-28 12:15:34 -07:00
Marek Olšák
0e44884aad r300g: fix blending and do some optimizations
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-10-28 12:15:34 -07:00
Marek Olšák
c451011d99 mesa/st: fix crash in st_texture_image_copy
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-10-28 12:15:33 -07:00
Vinson Lee
c0a61c8442 intel: Fix memory leak in case of renderbuffer bad format
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-28 13:09:44 -06:00
Brian Paul
7d56caabe4 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/shader/lex.yy.c
	src/mesa/shader/program_lexer.l
2009-10-28 11:33:51 -06:00
Brian Paul
0219cd0961 mesa: remove unneeded #includes 2009-10-28 11:13:21 -06:00
Brian Paul
5e3b2baae7 mesa: include imports.h to silence warning 2009-10-28 11:11:30 -06:00
Vinson Lee
a7d0665c00 intel: Fix memory leak in event of mip tree allocation failure
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-28 11:10:14 -06:00
José Fonseca
182ff3e47a llvmpipe: Make sure the JIT engine and X86 target are linked on MSVC build.
Basically mimic the llvm 2.6 way of linking execution engines and
targets.
2009-10-28 11:26:26 +00:00
José Fonseca
5eba607db6 util: Drop return value from cpuid(). 2009-10-28 11:26:26 +00:00
José Fonseca
0426227b68 util: Fix cpuid on MSVC. 2009-10-28 11:26:26 +00:00
José Fonseca
095e66f695 llvmpipe: Implement round() for MSVC. 2009-10-28 11:26:26 +00:00
Brian Paul
6bc1e9fd69 mesa: consolidate _mesa_CompressedTexSubImage[123]DARB() functions 2009-10-27 21:39:44 -06:00
Brian Paul
f3c29bd74f mesa: consolidate CompressedTexSubImage1/2/3DARB() error checking 2009-10-27 21:15:48 -06:00
Brian Paul
9519603f74 mesa: simplify teximage code with get_current_tex_object() 2009-10-27 21:15:36 -06:00
Brian Paul
dd5691e802 mesa: code refactoring to eliminate a switch stmt in bind_buffer_object() 2009-10-27 20:10:59 -06:00
Brian Paul
b44304efde glsl: avoid redundant state changes in _mesa_use_program() 2009-10-27 20:10:59 -06:00
Zack Rusin
2947d14202 st/xorg: fix xv 2009-10-27 21:00:47 -04:00
Ian Romanick
93dae6761b ARB prog parser: Fix epic memory leak in lexer / parser interface
Anything that matched IDENTIFIER was strdup'ed and returned to the
parser.  However, almost every case of IDENTIFIER in the parser just
dropped the returned string on the floor.  Every swizzle string, every
option string, every use of a variable, etc. leaked memory.

Create a temporary buffer in the parser state (string_dumpster and
dumpster_size).  Return strings from the lexer to the parser in the
buffer.  Grow the buffer as needed.  When the parser needs to keep a
string (i.e., delcaring a new variable), let it make a copy then.

The only leak that valgrind now detects is /occasionally/ the copy of
the program string in gl_program::String is leaked.  I'm not seeing
how. :(
2009-10-27 17:06:18 -07:00
Ian Romanick
8df9587d68 ARB prog parser: Don't leak program string
The program string is kept in the program object.  On the second call
into glProgramStringARB the previous kept string would be leaked.
2009-10-27 17:06:18 -07:00
Ian Romanick
0f255d1956 ARB prog parser: Don't leak symbol table header structures 2009-10-27 17:06:18 -07:00
Eric Anholt
2643a7ba29 intel: Fix flipped condition in ARB_sync GetSYnciv(GL_SYNC_STATUS).
Bug #24435
(cherry picked from commit d56125a298)
2009-10-27 16:59:03 -07:00
Brian Paul
b7eea8c616 intel: added region draw_x/y offsets in x/y_tile_swizzle() funcs
This fixes the second part of bug 23552.
2009-10-27 17:35:30 -06:00
Brian Paul
52374d7e4c radeon: add case for MESA_FORMAT_X8_Z24 in radeon_create_renderbuffer() 2009-10-27 17:05:08 -06:00
Brian Paul
f8155ef51f intel: silence warning 2009-10-27 17:01:26 -06:00
Brian Paul
21f8d31cfd mesa: debug code for glBlitFramebuffer() 2009-10-27 17:00:31 -06:00
Brian Paul
507cf530b9 via: silence unused var warnings 2009-10-27 17:00:31 -06:00
Brian Paul
3c71666921 intel: minor clean-up, comments 2009-10-27 17:00:31 -06:00
Brian Paul
7fd8c6ca2a intel: use _mesa_get_current_tex_unit() helper 2009-10-27 17:00:31 -06:00
Brian Paul
05ec586851 mesa: s/Bilt/Blit 2009-10-27 17:00:31 -06:00
Brian Paul
403181b913 mesa: more texture debug code changes, improvements 2009-10-27 17:00:31 -06:00
Brian Paul
58a4328e96 mesa: minor code clean-up in client_state() 2009-10-27 17:00:31 -06:00
Brian Paul
72cb441c2f mesa: avoid redundant state setting in glClientActiveTexture
Plus add code for verbose/debugging.
2009-10-27 17:00:31 -06:00
Brian Paul
33531614de intel: fix comment, formatting 2009-10-27 17:00:31 -06:00
Brian Paul
3bee7610be progs/tests: added new blitfb.c test
Tests glBlitFramebuffer() between two texture/renderbuffer surfaces.
In particular, blit from level[1] of a cube map face to a 2D texture.

Used to find/fix bug in intel do_copy_texsubimage().
See commit aef1ab1073f3e30d699b99dae17518ed48b57c72
2009-10-27 17:00:31 -06:00
Brian Paul
3e45788d5d intel: fix src offset bug in do_copy_texsubimage()
Use src->draw_offset intead of zero.  Zero usually worked, except when
the src renderbuffer is actually a texture mipmap level higher than zero.
Fixes progs/test/blitfb.c test.
2009-10-27 17:00:31 -06:00
Brian Paul
4c2a7bc438 glsl: fix memory leak
A slightly modified version of a patch from Vinson Lee.
2009-10-27 17:00:30 -06:00
Eric Anholt
4f9f5a7840 i915: Fix driver for the miptree x/y offset changes.
Bug #24734.
2009-10-27 17:00:30 -06:00
Brian Paul
e9b17d6477 i965: be clear that the Fallback field is a boolean, not a bitfield 2009-10-27 16:59:44 -06:00
Brian Paul
755161b888 Revert "i965: fix hacked Fallback usage in brw_prepare_vertices()"
This reverts commit 8810b8f671.

It turns out the i965 driver uses the intel->Fallback field as a boolean,
not as a bitmask.  The intelFallback() function is a no-op in the i965
driver.  It would have been nice if there were some comments about this.
I'll fix that next...
2009-10-27 16:59:44 -06:00
Vinson Lee
b7ab7d3627 draw: Fix memory leak.
This would only be hit if we got and invalid index_size.
2009-10-27 16:59:44 -06:00
Brian Paul
b73c4ad98b docs: document Intel glBitmap fixes 2009-10-27 16:59:44 -06:00
Brian Paul
fe818ea797 intel: fix GL state bugs in intel_texture_bitmap()
Need to push texture state and polygon state too.
Fixes rendering glitches seen in progs/demos/engine when changing
the rendering mode (wireframe, texture modes).
This makes bitmap rendering a little slower, unfortunately.
2009-10-27 16:59:43 -06:00
Christoph Bumiller
7d967b9b7c nv50: activate more lanes in a warp
Some cards have crippling defaults set and use only 4
of 32 lanes. This should activate 16 on these.
Those that allow 32 by default should still do so.

Found out by Marcin Kościelnicki.
2009-10-28 00:57:18 +01:00
Brian Paul
498fcfd315 progs/tests: added new blitfb.c test
Tests glBlitFramebuffer() between two texture/renderbuffer surfaces.
In particular, blit from level[1] of a cube map face to a 2D texture.

Used to find/fix bug in intel do_copy_texsubimage().
See commit aef1ab1073f3e30d699b99dae17518ed48b57c72
2009-10-27 16:46:20 -06:00
Brian Paul
22575abdec intel: fix src offset bug in do_copy_texsubimage()
Use src->draw_offset intead of zero.  Zero usually worked, except when
the src renderbuffer is actually a texture mipmap level higher than zero.
Fixes progs/test/blitfb.c test.
2009-10-27 16:46:20 -06:00
Brian Paul
517ae7a3b6 glsl: fix memory leak
A slightly modified version of a patch from Vinson Lee.
2009-10-27 16:29:15 -06:00
Eric Anholt
70b17db918 i915: Fix driver for the miptree x/y offset changes.
Bug #24734.
2009-10-27 10:27:15 -07:00
Jakob Bornecrantz
8a1f239ca9 st/xorg: Adopt to new dirty clip rect type 2009-10-27 17:40:55 +01:00
Brian Paul
43dc91f8bb i965: be clear that the Fallback field is a boolean, not a bitfield 2009-10-27 09:31:53 -06:00
Brian Paul
f9e334cb32 Revert "i965: fix hacked Fallback usage in brw_prepare_vertices()"
This reverts commit 8810b8f671.

It turns out the i965 driver uses the intel->Fallback field as a boolean,
not as a bitmask.  The intelFallback() function is a no-op in the i965
driver.  It would have been nice if there were some comments about this.
I'll fix that next...
2009-10-27 09:31:53 -06:00
Vinson Lee
42732611d3 draw: Fix memory leak.
This would only be hit if we got and invalid index_size.
2009-10-27 09:14:29 -06:00
Vinson Lee
50e113e375 progs/tests: Fix MSVC build. 2009-10-26 15:03:52 -06:00
Brian Paul
0a47631849 docs: document Intel glBitmap fixes 2009-10-26 10:58:47 -06:00
Brian Paul
48dad9c93f intel: fix GL state bugs in intel_texture_bitmap()
Need to push texture state and polygon state too.
Fixes rendering glitches seen in progs/demos/engine when changing
the rendering mode (wireframe, texture modes).
This makes bitmap rendering a little slower, unfortunately.
2009-10-26 10:44:22 -06:00
José Fonseca
ad0975f701 scons: Define _USE_MATH_DEFINES on MSVC. 2009-10-26 15:17:26 +00:00
Brian Paul
87127c83dc windows: added remap.[ch] to project files
Untested.  Other updates may be needed to reflect the current source files.
2009-10-26 09:06:00 -06:00
Chia-I Wu
c9d715da39 mesa: Add remap.c to SConscript.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-26 09:01:29 -06:00
Zack Rusin
b5fb60041e st/xorg: initialize indexes before reswizzling for yuv 2009-10-26 08:15:48 -04:00
Zack Rusin
0b069d648b st/xorg: stop overflowing yuv buffers 2009-10-26 08:15:48 -04:00
Zack Rusin
a9f8baf00b st/xorg: add yuv vertex shader
plus some general fixes
2009-10-26 08:15:48 -04:00
Zack Rusin
6b8ce4cc4f st/xorg: add yuv shaders 2009-10-26 08:15:48 -04:00
Marek Olšák
5241b9568c r300g: read occlusion query results from both Z pipes on RV530 2009-10-26 02:07:32 +01:00
Marek Olšák
827002f5ff r300g: add cubemap support
Also, set a pitch for rectangles only.
2009-10-26 02:07:26 +01:00
Brian Paul
d8ded352ec progs/tests: disable blending while drawing text 2009-10-25 18:10:45 -06:00
Brian Paul
11caea687e mesa: choose texture format in core mesa, not drivers
Call the ctx->Driver.ChooseTextureFormat() function from core Mesa's
_mesa_[Copy]TexImage functions instead of in the driver functions.
One less thing for drivers to do.
2009-10-25 18:06:24 -06:00
Brian Paul
355b5bde50 mesa: remove _mesa_compressed_texture_size_glenum() stub 2009-10-25 17:32:56 -06:00
Brian Paul
20c6c58532 mesa: remove _mesa_compressed_row_stride() 2009-10-25 17:25:46 -06:00
Brian Paul
e3f2efc4f1 mesa: remove calls to _mesa_compressed_row_stride() 2009-10-25 17:23:37 -06:00
Brian Paul
c83b758760 glide: remove _mesa_compressed_row_stride() calls
And fix incorrect first parameter.
2009-10-25 17:21:27 -06:00
Brian Paul
253e7fee5d mesa: remove _mesa_compressed_row_stride() calls 2009-10-25 17:21:11 -06:00
Brian Paul
2594168e9f mesa: begin removing _mesa_compressed_row_stride() calls
Use equivalent _mesa_format_row_stride() function instead.
2009-10-25 17:20:24 -06:00
Brian Paul
82bcc1c5d2 mesa: simplify texture_row_stride() helper 2009-10-25 17:15:02 -06:00
Brian Paul
07ad6393cb mesa: fix-up error checking related to compressed texture block size 2009-10-25 17:07:27 -06:00
Brian Paul
54bb414e00 mesa: clean-up, simplify compressed texture size checking 2009-10-25 16:59:08 -06:00
José Fonseca
3a49497f10 gallium: Move enum pipe_error into p_defines.h.
It's really just another define. No need for its own header.
2009-10-25 21:11:54 +00:00
José Fonseca
88e08d7c6d llvmpipe: Human friendlier sampler state dump. 2009-10-25 12:27:14 +00:00
José Fonseca
47f0529806 util: Human readable output of texture states. 2009-10-25 12:26:39 +00:00
José Fonseca
5fcb75758c llvmpipe: Dump the sampler state of the shader key. 2009-10-25 11:49:01 +00:00
José Fonseca
e4c5e01c10 llvmpipe: Immediate multiplication. 2009-10-25 11:48:17 +00:00
José Fonseca
e1342f871b llvmpipe: Fast path for sampling rgba8 textures with linear filtering.
Implement Keith's suggestion of doing most of the sampling with 16x8
and 8x16 AoS, and only doing the conversion to floating point SoA at
the very last step.

Improves gloss performance by 10%.
2009-10-25 09:53:49 +00:00
José Fonseca
f3893ca9c8 llvmpipe: Make lerping work for 8.8 fixed point values. 2009-10-25 09:53:49 +00:00
José Fonseca
bfd7a9ca96 llvmpipe: New module to help make assertions about formats. 2009-10-25 09:53:49 +00:00
José Fonseca
47d241be9f llvmpipe: New function to unpack rgba8 formats into 4 x u8n AoS. 2009-10-25 09:53:49 +00:00
José Fonseca
abff4214ef llvmpipe: Split the format swizzling step from the unpacking. 2009-10-25 09:53:48 +00:00
José Fonseca
8d80fd3f55 llvmpipe: Allow different signs when unpacking. 2009-10-25 09:53:48 +00:00
José Fonseca
b544ab7299 llvmpipe: Add inlines to quickly generate types matching the native SIMD register bitwidth. 2009-10-25 09:53:48 +00:00
José Fonseca
a55b305c5b llvmpipe: Merge lp_build_load_rgba_soa into lp_build_sample_texel. 2009-10-25 09:53:48 +00:00
José Fonseca
bc93e9181c llvmpipe: Factor our pixel offset computation. 2009-10-25 09:53:48 +00:00
José Fonseca
fedd054d53 llvmpipe: Share testing infrastructure with lp_test_format. 2009-10-25 09:53:48 +00:00
José Fonseca
17afb6dd69 llvmpipe: Eliminate lp_build_store_rgba_aos. 2009-10-25 09:53:48 +00:00
José Fonseca
232b586464 llvmpipe: Eliminate lp_build_load_rgba_aos. 2009-10-25 09:53:48 +00:00
José Fonseca
b4f6907b8d llvmpipe: Move a few format/sampling functions into better space. 2009-10-25 09:53:47 +00:00
Marek Olšák
c2df759cd7 r300g: fix redefining mipmaps and fetching from them 2009-10-25 10:16:59 +01:00
Marek Olšák
118dfe1688 r300g: added support for 3D textures
Mipmaps not tested. Also, I am not sure why piglit/texturing/tex3d needs
to have color tolerance +-1 to pass. The classic Mesa driver doesn't
need that.
2009-10-25 08:06:19 +01:00
Brian Paul
d6ee86c77a mesa: remove _mesa_compressed_texture_size()
Use _mesa_format_image_size() instead.
2009-10-24 16:50:00 -06:00
Brian Paul
4c00981b22 mesa: remove ctx->Driver.CompressedTextureSize() hook
It always just called _mesa_compressed_texture_size() anyway.
2009-10-24 16:34:25 -06:00
Brian Paul
35efc6a1b3 mesa: change compressed texture size calls
Replace calls to ctx->Driver.CompressedTextureSize with calls to
_mesa_format_image_size.  The former always called the later.
2009-10-24 16:28:27 -06:00
Brian Paul
bea245ac2f mesa: minor clean-ups in _mesa_store_compressed_texsubimage2d() 2009-10-24 12:04:09 -06:00
Brian Paul
5c82827696 mesa: simplify _mesa_compressed_row_stride(), _mesa_compressed_image_address()
_mesa_compressed_row_stride() can go away soon.
_mesa_compressed_image_address() can be generalized and moved to formats.c
2009-10-24 11:52:36 -06:00
Brian Paul
1ad9671db7 mesa: s/GLuint/gl_format/ 2009-10-24 11:41:25 -06:00
Brian Paul
2c3787f513 mesa: move assertion after declaration 2009-10-24 11:34:27 -06:00
Brian Paul
d255aaf54f mesa: remove hard-coded block sizes 2009-10-24 11:33:58 -06:00
Brian Paul
7b16c43e43 mesa: added _mesa_get_format_block_size() 2009-10-24 11:33:10 -06:00
Brian Paul
51bc12d623 progs/tests: fix sub texture offsets 2009-10-24 11:08:01 -06:00
Brian Paul
bee6794eb1 mesa: added _mesa_get_format_name() 2009-10-24 08:43:16 -06:00
Brian Paul
eb732b1bbb mesa: additional comments in format code 2009-10-24 08:41:08 -06:00
Joakim Sindholt
94a63dccdd r300g: fix scons build yet again 2009-10-24 02:43:21 +02:00
Brian Paul
46a784b7fd Merge branch 'mesa_7_6_branch' 2009-10-23 18:38:43 -06:00
Brian Paul
26f1ad65b9 mesa: simplify att->CubeMapFace assignment 2009-10-23 18:31:03 -06:00
Brian Paul
346250b190 mesa: refactor, new print_shader_info() 2009-10-23 18:31:03 -06:00
Brian Paul
81a4d34f07 mesa: rework error checking code for glGetCompressedTexImage()
Do all error checking in new getcompressedteximage_error_check() func.
Move some additional PBO checks out of the driver fallbacks into the
error checking functions.
2009-10-23 18:31:03 -06:00
Brian Paul
d66965c9a1 mesa: remove misplaced VERBOSE_TEXTURE tests 2009-10-23 18:31:02 -06:00
Brian Paul
9b50ceac03 mesa: more detailed error messages in fbo code 2009-10-23 18:31:02 -06:00
Brian Paul
dc8b139aa2 mesa: remove FBO texture depth/stencil test
The texture format should not be checked until validation time since
the format might be changed by a subsequent glTexImage() call.
2009-10-23 18:22:41 -06:00
Zack Rusin
b17c885a8a st/xorg: fix text with component alpha rendering 2009-10-23 19:39:16 -04:00
Brian Paul
0acb057ad1 mesa: fix broken _mesa_str_checksum() 2009-10-23 16:36:15 -06:00
Eric Anholt
49d402e275 Merge remote branch 'origin/mesa_7_6_branch'
Conflicts:
	src/mesa/drivers/dri/intel/intel_fbo.c
	src/mesa/drivers/dri/intel/intel_mipmap_tree.c
	src/mesa/drivers/dri/intel/intel_mipmap_tree.h
	src/mesa/drivers/dri/intel/intel_tex_copy.c
	src/mesa/drivers/dri/intel/intel_tex_image.c
2009-10-23 15:21:05 -07:00
Eric Anholt
bfd51dc34d i965: Annotate _NEW_COLOR dependency for brw_update_renderbuffer_surface(). 2009-10-23 14:13:57 -07:00
Eric Anholt
2d17dbfb53 intel: Keep track of x,y offsets in miptrees and use them for blitting.
By just using offsets, we confused the hardware's tiling calculations,
resulting in failures in miptree validation and blit clears.

Fixes piglit fbo-clearmipmap.

Bug #23552. (automatic mipmap generation)
2009-10-23 14:12:24 -07:00
Brian Paul
b01937a3c9 progs/tests: print requested/internal format info 2009-10-23 14:52:10 -06:00
Brian Paul
96d7d66dff docs: document updated GL extension header files 2009-10-23 14:49:47 -06:00
Brian Paul
5c0dc902e7 gl: updated wglext.h to version 17 2009-10-23 14:49:26 -06:00
Brian Paul
559da98c2b gl: updated glxext.h to version 25 2009-10-23 14:49:26 -06:00
Brian Paul
9df9696f6d gl: updated glext.h to version 56 2009-10-23 14:49:20 -06:00
Brian Paul
ff3f09a7fe docs: document cell, glGetTexLevelParameter() fixes 2009-10-23 14:45:44 -06:00
Brian Paul
cd62b4f00a mesa: fix GL_TEXTURE_INTERNAL_FORMAT query for compressed formats
Need to return the actual compressed format when the user originally
requested a generic compressed format.
2009-10-23 14:45:44 -06:00
Brian Paul
9528dc6ed8 mesa: added _mesa_compressed_format_to_glenum()
Maps a compressed MESA_FORMAT_x to correspding GLenum.  Needed for
querying a texture's actual format when a generic format was originally
requested.
2009-10-23 14:45:44 -06:00
Brian Paul
5e4f5e41a4 mesa: change s3tc vs. fxt1 priority when choosing compressed formats 2009-10-23 14:45:44 -06:00
Christoph Bumiller
683722740c nv50: do SIGN_SET as one instruction 2009-10-23 22:24:13 +02:00
Christoph Bumiller
99e728a13e nv50: fix saturation outside of tx_insn case 2009-10-23 22:24:09 +02:00
Christoph Bumiller
ad67326f12 nv50: allow all 127 TEMP regs
We should really learn to not waste so many though.
2009-10-23 22:24:03 +02:00
Christoph Bumiller
c738c9ab67 nv50: fix address reg code
Contained some rather obvious thinking errors before,
and didn't consider offsets from TGSI ADDRESS regs.
2009-10-23 22:17:44 +02:00
Christoph Bumiller
255a90a7bd nv50: add depth texture formats, and a few others, too 2009-10-23 22:17:34 +02:00
Vinson Lee
952bf63e2c progs/tests: Fix MSVC build. 2009-10-23 13:49:13 -06:00
Patrice Mandin
d9014a13e7 nouveau: nv30: Relax some limits. We can render to z24s8 buffer even if color buffer is 16 bits. 2009-10-23 18:42:21 +02:00
Patrice Mandin
c84a056764 nouveau: nv30: use r5g6b5 as z16 format 2009-10-23 18:40:13 +02:00
Chia-I Wu
6e99e6ddbf glapi: Always build libglapi.a.
This is made possible by making glapioffsets.h and glapidispatch.h
internal headers of glapi.  They should only be included indirectly
through dispatch.h by mesa.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
22884db174 glapi: Move dispatch marcos to glapidispatch.h.
dispatch.h is kept as a wrapper to glapidispatch.h.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
3d16088ff0 mesa/dri: Remove extension_helper.h.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
17ef1f6074 mesa: Enable remap table in core.
This enables the remap table in core.  driInitExtensions is adapted to
use the remap table.  All uses of extension_helper.h are replaced by
remap_helper.h.  The chicken-egg problem of the DRI drivers is also
solved.

It is now also possible to pass NULL extensions to driInitExtensions.
It will cause driInitExtensions to map all known functions.  This
functionality is used by software drivers and EGL_i915.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
d7d3fb925b mesa/main: Add support for remap table.
This commit only adds the source files.  It is supposed to replace the
remap table in DRI drivers.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Zack Rusin
bec5230a1f st/xorg: lots of fixes related to compositing
fixes transformations, rendering with multiple bound textures, xrender
matrix conversions plus some cleanups
2009-10-23 11:11:00 -04:00
Andre Maasikas
d4d4733e6c r600: remove duplicate stride setting
Stride is set already in r700SetVertexFormat and there it works
correctly for 0 also
2009-10-23 17:16:46 +03:00
Andre Maasikas
738b394769 r600: for position invariant programs reading vert_pos is not always known at this point 2009-10-23 17:16:23 +03:00
Keith Whitwell
da253319f9 gallium: remove extended negate also, and also the ExtSwz token
Likewise, the extended negate functionality hasn't been
used since mesa switched to using tgsi_ureg to build programs,
and has been translating the SWZ opcode internally to a single MAD.
2009-10-23 14:50:02 +01:00
Keith Whitwell
8a571b809a cell: typo from ExtSwizzle commit 2009-10-23 14:38:30 +01:00
Keith Whitwell
b9cb74c7f8 gallium: remove the swizzling parts of ExtSwizzle
These haven't been used by the mesa state tracker since the
conversion to tgsi_ureg, and it seems that none of the
other state trackers are using it either.

This helps simplify one of the biggest suprises when starting off with
TGSI shaders.
2009-10-23 14:31:24 +01:00
Keith Whitwell
4e1d51786e gallium: remove noise opcodes
Provide a dummy implementation in the GL state tracker (move 0.5 to
the destination regs).

At some point, a motivated person could add a better
implementation of noise.  Currently not even the nvidia
binary drivers do anything more than this.  In any case, the
place to do this is in the GL state tracker, not the poor
driver.
2009-10-23 13:56:07 +01:00
Keith Whitwell
19403935aa progs/demos: add fps to multiarb 2009-10-23 13:56:07 +01:00
Cooper Yuan
9b6c86b8be r300g: last changes's typo, miss a include file 2009-10-23 16:40:31 +08:00
Cooper Yuan
6df12aad2f r300g: add flush_frontbuffer function to display video surface 2009-10-23 14:46:29 +08:00
Cooper Yuan
0072a26662 g3dvl: pass display and screen to g3dvl when creating video private context 2009-10-23 14:44:27 +08:00
Alex Deucher
45eb9d2f6d r600: remove remains of old tnl pipeline 2009-10-23 01:01:19 -04:00
Alex Deucher
fc38a3cfe8 r600: fix render size prediction 2009-10-23 01:01:19 -04:00
Alex Deucher
614e8f2203 r600: remove old tnl pipeline 2009-10-23 01:01:19 -04:00
Alex Deucher
95328c7cf9 r600: clean up context creation
Make it more consistent with other radeon drivers.
2009-10-23 01:01:18 -04:00
Ian Romanick
286611d990 Revert "Store clipping distance for user clip planes as part of vertex processing"
This reverts commit f058b25881.

This change is completely wrong in so many ways.  When clip distances
are generated as part of vertex processing, they must be interpolated
to perform clipping.  Geometric clipping goes right out the window.
2009-10-22 19:21:21 -07:00
Ian Romanick
dd24501665 ARB prog parser: Fix parameter array size comparison
Array indexes are invalid when >= the maximum, but array sizes are
only in valid when > the maximum.  This prevented programs from
declaring a single maximum size array.

See the piglit vp-max-array test.
2009-10-22 19:20:15 -07:00
Brian Paul
1160acbfea dri/drivers: update driNewRenderbuffer() to take a gl_format
Now pass a specific MESA_FORMAT_x token to indicate the renderbuffer's
format.  This is better than passing a GLenum and having to guess the
specific format.

I'm unable to test all the drivers, but any issues should be easy to fix.
2009-10-22 19:57:32 -06:00
Brian Paul
cf0e25d4c8 radeon: simplify radeon_create_renderbuffer() 2009-10-22 19:57:06 -06:00
Brian Paul
ab9d1011f5 Merge branch 'mesa_7_6_branch' 2009-10-22 18:38:19 -06:00
Brian Paul
347fb3737b docs: document 'useprog' debug option 2009-10-22 18:35:13 -06:00
Brian Paul
fdce832437 mesa: fix up vbo comments 2009-10-22 18:35:13 -06:00
Brian Paul
488e67bab2 mesa: added _mesa_dump_texture() 2009-10-22 18:35:12 -06:00
Brian Paul
55058652b8 intel: flush old context before binding new context
Per the GLX spec, when changing rendering contexts, the old context
should first be flushed.
2009-10-22 18:33:26 -06:00
Brian Paul
5e6a6a2719 glx: don't destroy context immediately if it's currently bound
According to the GLXDestroyContext() man page, the context should not
immediately be destroyed if it's bound to some thread.  Wait until it's
unbound to really delete it.  The code for doing the later part is
already present in MakeContextCurrent() so no change was needed there.
2009-10-22 18:20:28 -06:00
Brian Paul
4837e01bcd mesa: code refactoring- new _mesa_finish(), _mesa_flush() 2009-10-22 18:16:10 -06:00
Zack Rusin
fb22e80169 st/xorg: fix the makefile when used with new xextproto 2009-10-22 19:33:04 -04:00
Brian Paul
61a96a2ac7 progs/xdemos: fix command line flag typo 2009-10-22 17:11:59 -06:00
Brian Paul
8810b8f671 i965: fix hacked Fallback usage in brw_prepare_vertices()
Setting intel->Fallback = 1 clobbered any fallback state that was already
set.  Not sure where this hack originated (the git history is a little
convoluted).  Define and use a new BRW_FALLBACK_DRAW bit instead.  This
shouldn't break anything and could potentially fix some bugs (but no
specific ones are known).
2009-10-22 16:52:59 -06:00
Brian Paul
c24466c34e intel: define INTEL_FALLBACK_DRIVER for drivers 2009-10-22 16:52:59 -06:00
Brian Paul
ea659f8917 intel: Fallback field is a bitmask, use GLbitfield 2009-10-22 16:52:59 -06:00
Brian Paul
f9bbbe5803 i965: remove unused brw_context::tmp_fallback field 2009-10-22 16:52:59 -06:00
Brian Paul
2f7abf5c04 i965: remove unused BRW_FALLBACK_TEXTURE bit
The value was probably wrong too.
It was the same as INTEL_FALLBACK_DRAW_BUFFER.
2009-10-22 16:52:59 -06:00
Corbin Simpson
04ec113e09 r300g: Enable more stuff in r300_screen, cleanup comments.
Also enable 24-bit depth buffers without stencil.
2009-10-22 14:29:48 -07:00
Corbin Simpson
ff9e1c0198 r300g: Cleanup PSC setup math a bit and stop using Draw formats. 2009-10-22 14:29:48 -07:00
Christoph Bumiller
198925caa1 nv50: handle PIPE_TEX_FILTER_ANISO case
Set the same bits as for linear filtering (in addition
to max anisotropy), and 2 unknown bits I've seen set.
2009-10-22 23:05:12 +02:00
Patrice Mandin
4b8de9bd7c nouveau: nv30: rewrite so we can render only in depth buffer 2009-10-22 22:01:53 +02:00
Patrice Mandin
f9a69c0f04 nouveau: nv30: use a8r8g8b8 as depth texture format for z24s8 2009-10-22 22:00:46 +02:00
Corbin Simpson
fd7ee2bcb7 Kill off trident.
Hm. I could have said "chew trident and spit it out," or perhaps
"spear trident," instead. Dohoho.
2009-10-22 12:57:13 -07:00
Corbin Simpson
8e4657a9d4 Nuke s3v.
As per FDO #17889.
2009-10-22 12:29:30 -07:00
Corbin Simpson
06e464c2d5 r300g: Clean up duplicate code in r300_render. 2009-10-22 11:50:51 -07:00
Corbin Simpson
1f7f9bab81 r300g: Move render functions to r300_render.
Part of the fastpath cleanup.
2009-10-22 11:50:51 -07:00
Alex Deucher
dd36006a4e r600: fix depth span macros for format changes 2009-10-22 14:48:45 -04:00
Brian Paul
eb1b8ed148 radeon: fix some renderbuffer format bugs 2009-10-22 12:26:17 -06:00
José Fonseca
bf48447caf scons: Hack LLVM support on Windows.
Doesn't quite work yet though, as small differences in the compilation flags
used when building LLVM and Mesa cause link failures for STL symbols.
2009-10-22 19:12:14 +01:00
José Fonseca
719984afca llvmpipe: Avoid yet another variable size array. 2009-10-22 19:12:14 +01:00
José Fonseca
ba8c11923a llvmpipe: Define rdtsc for MSVC. 2009-10-22 19:12:14 +01:00
José Fonseca
9aafa1fbd2 llvmpipe: Avoid variable size arrays.
Not really variable size, but MSVC still doesn't like them.
2009-10-22 19:12:14 +01:00
José Fonseca
01b85e2923 llvmpipe: Use the pack/unpack functions for 8bit unsigned norm multiplication. 2009-10-22 19:12:13 +01:00
José Fonseca
4458695bda llvmpipe: Utility function to double the bit width of a type. 2009-10-22 19:12:13 +01:00
José Fonseca
421507de06 llvmpipe: Factor vector packing/unpacking to a separate source file.
These functions will be needed to implement many of the 8bit operations,
and they are quite complex on its own.
2009-10-22 19:12:13 +01:00
José Fonseca
a07437f8a6 llvmpipe: Call util_cpu_detect() from the unit tests. 2009-10-22 19:12:13 +01:00
José Fonseca
4797ce0d19 util: Set cpu endianness too. 2009-10-22 19:12:13 +01:00
José Fonseca
1acd891ed3 scons: Disable more MSVC pedantic security warnings. 2009-10-22 19:12:12 +01:00
Alex Deucher
f8bee0e412 Merge branch 'master' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa 2009-10-22 12:29:36 -04:00
Zack Rusin
1f5b568fbe st/xorg: cleanup the checks for whether the op is accelerated 2009-10-22 12:21:35 -04:00
Alex Deucher
5e77b61e39 Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa 2009-10-22 12:02:31 -04:00
Zack Rusin
c4af8ce69e st/xorg: lots of render fixes
fixes all the blend modes, fixes flushing/finishing semantics, adds
acceleration for the component alpha modes that we can support, fixes
src in mask shader and general cleanups
2009-10-22 11:53:10 -04:00
Chia-I Wu
4e2bdd6635 progs/egl: Add support for pixmap and pbuffer surface to xeglgears.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
60cf250d47 egl_glx: Add support for eglWaitClient and eglWaitNative.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
7ffe64a7ae egl_glx: Clean up eglGetProcAddress.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
a206436577 egl_glx: Clean up context functions.
This lifts the requirement that a context must be direct.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
c407c70244 egl_glx: Clean up surface functions.
Separete Drawable and GLXDrawable.  Add support for pbuffer and pixmap
surfaces on GLX <= 1.3.  Remove surface binding code that will never
work.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
78c3a351bc egl_glx: Clean up the initialization code.
Proper detection of GLX extensions.  Convert fbconfigs or visuals in a
more unified way and validate the resulting configs.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
326baecd75 egl: Correct conversion of native visual type.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Ben Skeggs
eebf4b5299 nv50: support 3D class 0x8597, remove redundant unknown chipset detection 2009-10-22 21:56:32 +10:00
Corbin Simpson
511bd5f32b r300g: Check for NULL Draw during flush.
Split from the fastpath WIP.
2009-10-22 00:21:08 -07:00
Andre Maasikas
869e20bcb7 r600: set barrier for tex inst if dst is used earlier, might overwrite it otherwise 2009-10-22 09:45:11 +03:00
Andre Maasikas
a88c9296cb r600: need to export something from PS
Also avoids empty shader for "END" - seems to be somewhat valid fp
 Maybe this can be done differently in the future (fake FRAG_RESULT_COLOR
 already in Map_Fragment_Program() or is there a way to program the chip
 to not hang in case of no exports.
2009-10-22 09:44:03 +03:00
Andre Maasikas
b86302283b r600: add beginnings of ARL instruction 2009-10-22 09:42:42 +03:00
Corbin Simpson
0a8cd4862c r300g: Update comments, function names in r300_state_inlines. 2009-10-21 23:26:02 -07:00
Corbin Simpson
034db65f08 r300g: Update comments, asserts, indents in r300_texture.
I wish I knew enough about textures to really really REALLY fix that file.
2009-10-21 23:23:37 -07:00
Corbin Simpson
5a653ada41 r300g: Remove unused debug flag. 2009-10-21 22:54:52 -07:00
Corbin Simpson
40247d87d2 r300g: Cleanup old static shader state. 2009-10-21 22:53:37 -07:00
Brian Paul
82ffc5884c progs/tests: draw Z values as luminance, no pixel zoom 2009-10-21 21:51:19 -06:00
Brian Paul
3c68560866 i915: replace MESA_FORMAT_Z24_S8 with MESA_FORMAT_S8_Z24
And change parameter type.
2009-10-21 21:48:03 -06:00
Brian Paul
6e1ddd34c6 radeon: get rid of z24s8 <-> s8z24 conversions in span code
Can just use s8z24 everywhere.
Note: the WRITE_DEPTH macro for R600 may need to be fixed.
2009-10-21 21:20:05 -06:00
Brian Paul
c18b022d0d radeon: replace MESA_FORMAT_Z24_S8 with MESA_FORMAT_S8_Z24
Core Mesa deals with MESA_FORMAT_S8_Z24 everywhere it should so
we shouldn't have to use MESA_FORMAT_Z24_S8 anymore.
2009-10-21 21:14:44 -06:00
Brian Paul
68d94a608a intel: use MESA_FORMAT_S8_Z24 format and avoid z24s8/s8z24 conversions 2009-10-21 20:02:33 -06:00
Brian Paul
4bd70b5cff i965: change parameter type to gl_format 2009-10-21 20:00:43 -06:00
Brian Paul
c55b355fd4 mesa: use MESA_FORMAT_X8_Z24 2009-10-21 19:58:00 -06:00
Brian Paul
832f29770d mesa: use MESA_FORMAT_X8_Z24 format 2009-10-21 19:56:18 -06:00
Brian Paul
e4c700dbbf mesa: added MESA_FORMAT_X8_Z24 format
24-bit Z in 32-bit pixel.  We could probably use the MESA_FORMAT_S8_Z24
format but this there's a few places where we explicitly don't want stencil.
This format may go away at some point in the future.
2009-10-21 19:55:44 -06:00
Marc Dietrich
b2b239691d gallium/util: fix cpu detection on ppc
As we are compiling with -D_BSD_SOURCE, sigjmp_buf and siglongjmp
should be replaced by the non-sig functions (see man 3 setjmp).
Tested on linux/cell.
2009-10-21 15:15:03 -06:00
Brian Paul
2cc5a0e6bb mesa: added _mesa_dump_renderbuffers() debug code 2009-10-21 15:14:30 -06:00
Patrice Mandin
d364f662c6 nouveau: nv30: Do not use assert to return NULL 2009-10-21 22:01:03 +02:00
Patrice Mandin
cb351bdd6e nouveau: nv30: check number of colour buffers to bind 2009-10-21 21:56:09 +02:00
José Fonseca
ce98860012 llvmpipe: Remove extraneous name in lp_type pre-declaration. 2009-10-21 15:53:37 +01:00
Corbin Simpson
3b8dad47f8 r300g: No debug in r300_state. 2009-10-21 06:52:25 -07:00
Corbin Simpson
6a448a525b r300g: Cleanup header includes. 2009-10-21 06:52:25 -07:00
Corbin Simpson
babadb8bb9 r300g: Don't use getenv; use debug_get_*_option instead. 2009-10-21 06:52:24 -07:00
Corbin Simpson
5a0598f235 r300g: Don't use the hashtable internally.
As osiris pointed out, glxgears slowly gets slower for some reason
when it's enabled, and it's not helping at the moment, so just turn
it off.
2009-10-21 06:52:24 -07:00
Corbin Simpson
b589e39809 r300g: Examine vertex attribute type on HW TCL too. 2009-10-21 06:52:23 -07:00
Corbin Simpson
b21df2620e r300g: Also kill r300_shader_inlines with fire. 2009-10-21 06:52:23 -07:00
Corbin Simpson
58abfebaad r300g: Kill r300_surface with fire.
If you really want to see it again, check the history.
2009-10-21 06:52:22 -07:00
Brian Paul
5283a3fb25 progs/trivial: check if GL_ARB_occlusion_query is supported 2009-10-20 16:22:03 -06:00
Eric Anholt
d56125a298 intel: Fix flipped condition in ARB_sync GetSYnciv(GL_SYNC_STATUS).
Bug #24435
2009-10-20 14:52:58 -07:00
Eric Anholt
cbd20e18a0 meta: Fix the BufferSubData in meta clear to be BufferData.
Fixes a 3.4% +/- 1.3% performance regression in my GL demo (n=3).  The
other meta code could probably also use the same treatment.
2009-10-20 13:07:49 -07:00
Marc Dietrich
4b2cf92ad9 cell: fix compilation on cell
s/LERP/LRP/
2009-10-20 11:17:12 -06:00
Vinson Lee
ca940a73a7 mesa: Fix Mac OS build.
strtod_l needs the xlocale.h header on Mac OS. It's possible other
non-Linux OSes would need this header too.
2009-10-20 10:43:49 -06:00
Jakob Bornecrantz
478332b0c1 st/xorg: Move drm init to own function 2009-10-20 18:11:51 +02:00
Jakob Bornecrantz
fc07ca004a trace: Check for destroy before calling it 2009-10-20 17:19:05 +02:00
Jakob Bornecrantz
a9f71b3bba st/xorg: Cleanly shutdown 2009-10-20 17:19:04 +02:00
Mathias Fröhlich
16e21191e2 r300: fix texture size handling with size > 2048
The in kernel texture check fails because of both
bit11 flags being set on 16x16 textures. It tuns out
that these bits are still set and not cleared in the
pp_txpitch field of the texture. The attached patch
at least helps for this case on my machine. It clears
the bit 11 from the pitch field if the texture is smaller
and masks out that hight bits on the conventional width
and height field.

Fixes bug 24584
2009-10-19 11:47:21 -04:00
Robert Noland
8123180ea6 r600: Fix size calculation for 24 bit depth
size was being calculated based on 3 bytes per pixel with 24 bit depth
instead of 4 bytes.  This caused corruption in the bottom 25% of objects.
This finishes fixing the menu/text corruption in compiz/kde4.

Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-19 11:09:10 -04:00
Jakob Bornecrantz
5f8f14e5ca st/xorg: Remove output functions not used 2009-10-19 07:52:16 +02:00
Zack Rusin
b7fbcfdb3b st/xorg: makefile garbage 2009-10-19 23:48:38 -04:00
Zack Rusin
a39a3cc14e st/xorg: implement basic src/mask transformations
plus fix filters
2009-10-19 23:45:31 -04:00
Corbin Simpson
e5f1f6a0be r300g: Demonstratory kludge to unbreak glxgears.
We *must* recalculate something in vformat every rebind; let's see
if we can't narrow it down a bit.
2009-10-19 14:43:33 -07:00
Corbin Simpson
973aab1a52 dri-st: Add EXT_provoking_vertex.
Hm, I could have sworn I did this before?
2009-10-19 14:43:32 -07:00
Jakob Bornecrantz
e1b39c673d st/xorg: Switch to set_mode_major 2009-10-18 15:46:25 +02:00
Jakob Bornecrantz
846da0bfda st/xorg: Massivly redo root pixmap creation 2009-10-18 15:46:25 +02:00
Jakob Bornecrantz
e9e6152cb3 st/xorg: Clean up cursor functions a bit 2009-10-18 15:46:25 +02:00
Jakob Bornecrantz
b8843c6056 st/xorg: Support more then one output of a given type 2009-10-18 15:46:24 +02:00
Jakob Bornecrantz
68b5dc9634 st/xorg: Change how disable accel is handled 2009-10-18 15:46:24 +02:00
Christoph Bumiller
ec5c23551c nv50: add support for address regs
Allow indirect uniform access and increase the
limit on parameters from 128 to 512.
2009-10-19 18:25:09 +02:00
Christoph Bumiller
eb7ea97e7f nv50: cleanup emit_kil 2009-10-19 18:25:09 +02:00
Christoph Bumiller
2eef2017ac nv50: implement TGSI_OPCODE_CMP 2009-10-19 18:25:09 +02:00
Christoph Bumiller
f204eb1842 nv50: quick fix for insn src negation
We only have a per nv50_reg negation flag, if an
nv50_reg is used more than once in a TGSI op with
different sign modes, we'd generate wrong code.

We probably can't do much better without more
invasive changes.
2009-10-19 18:25:09 +02:00
Christoph Bumiller
1635e8d6f4 nv50: add support for DDX and DDY opcodes 2009-10-19 18:25:09 +02:00
Christoph Bumiller
c0e80cf0e9 nv50: submit user vbo data through the fifo
Requesting a new real buffer from the kernel and
copying all the data is wasteful e.g. if only a
few (but widely spread) vertices are accessed.
2009-10-19 18:25:08 +02:00
Christoph Bumiller
fba2eabe13 nv50: use SIFC for TIC, TSC upload
Add proper flushes for TIC and TSC and remove
the costly 2D.0110 flush in nv50_flush.

Correct TIC and TSC bo sizes.
2009-10-19 18:25:08 +02:00
Christoph Bumiller
6ab2fcca9d nv50: nicer texture format switch
Similar to nv40.
2009-10-19 18:25:08 +02:00
Alex Deucher
620270c76e Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa
regenerated lex.yy.c
2009-10-19 12:10:59 -04:00
Ben Skeggs
35b98e2884 nouveau: implement is_{texture,buffer}_referenced properly 2009-10-19 09:49:02 +10:00
Ben Skeggs
869d3eea37 drm/nv50: write tic/tsc setup to correct slots when skipping units 2009-10-19 09:49:02 +10:00
Corbin Simpson
16a06fea73 r300g: Fix up a bunch of warnings. 2009-10-18 16:09:01 -07:00
Corbin Simpson
d2e29b502e r300g: Add another ZTOP condition.
I don't even know if texkill works right now.
2009-10-18 10:30:18 -07:00
José Fonseca
838da1d4ae llvmpipe: Allocate texture storage for whole quads. 2009-10-18 14:31:58 +01:00
Corbin Simpson
bb567357bc gallium: Permit surface_copy and surface_fill to be NULL.
Uf. Lots of files touched. Would people with working vega, xorg, dri1, etc.
please make sure you are not broken, and fix yourself up if you are.

There were only two or three places where the code did not have painful
fallbacks, so I would advise st maintainers to find less painful workarounds,
or consider overhauling util_surface_copy and util_surface_fill.

Per ymanton, darktama, and Dr_Jakob's suggestions, clear has been left as-is.

I will not add PIPE_CAP_BLITTER unless it is deemed necessary.
2009-10-17 21:32:56 -07:00
Corbin Simpson
bfd877e470 r300g: Squash format warning.
Won't ever be supported.
2009-10-17 20:53:19 -07:00
Corbin Simpson
11056ca86f r300g: Use a dirty test to bring framerate back up.
This is just split out from the next commit, that's all.
2009-10-17 20:47:45 -07:00
Corbin Simpson
51173e4e53 r300g: Also have rs_block keyed to the current shader combo.
Eliminates part of the glxgears corruption here. Need to clean up PSC more,
to get rid of the rest of it.
2009-10-17 20:29:27 -07:00
Corbin Simpson
ce9ae4a483 r300g: Fix u_hash_table rename. 2009-10-17 20:05:23 -07:00
Corbin Simpson
4a98d19d1b Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2009-10-17 19:58:23 -07:00
Patrice Mandin
114417a2f5 nouveau: nv40: Use same workaround as i915 for segfault related to vbo 2009-10-17 20:49:18 +02:00
Patrice Mandin
66aab9a1f6 nouveau: nv30: Remove duplicate case. Was a typo for X8R8G8B8, but that will never be use for front buffer. 2009-10-17 20:46:19 +02:00
Patrice Mandin
67356ae047 nouveau: nv30: Use same workaround as i915 for segfault related to vbo 2009-10-17 20:27:24 +02:00
José Fonseca
5d42e3988d util: Rename from u_* to util_* while we're at it.
To be consistent with the rest.
2009-10-17 11:45:04 +01:00
Chris Wilson
60a39b6799 intel: Disallow relocations to the byte beyond the end of the buffer 2009-10-17 08:26:54 +01:00
Brian Paul
a335d334d4 mesa: fix/update some comments 2009-10-16 13:07:43 -06:00
Brian Paul
f094b86bb5 mesa: lift default symlinks target into Makefile.template
Driver Makefiles can still add symlink dependencies/rules if needed.
2009-10-16 13:07:43 -06:00
Brian Paul
db2046580f mesa: use EXTRA_MODULES and SUBDIRS to build r300 compiler
This is a bit cleaner and avoids rebuilding the r300_dri.so library all
the time.
2009-10-16 13:07:43 -06:00
Brian Paul
d9fd207133 mesa: added SUBDIRS support in dri/Makefile.template 2009-10-16 13:07:43 -06:00
Brian Paul
f0503726bf mesa: move a comma 2009-10-16 13:07:43 -06:00
Brian Paul
2ee7fd8d58 mesa: added MESA_GLSL=useprog debug flag
This logs glUseProgram() calls to stderr.
2009-10-16 13:07:43 -06:00
Maciej Cencora
3594b53c01 r300: fix vertex program parameters limits 2009-10-16 20:21:17 +02:00
Corbin Simpson
3e56bef5a5 radeon-gallium: Use debug_get_bool_option instead of getenv. 2009-10-16 09:45:07 -07:00
Corbin Simpson
fc8a156cfc r300g: Use a hash table to look up vertex info.
Need to move rs_block to this, too.

Also, I'm getting massive amounts of flicker for some reason; I bet we've gotta
re-re-examine PSC and friends. :C
2009-10-16 08:43:02 -07:00
Corbin Simpson
3924d86115 util: Change function names to begin with u_.
Avoids link-time clashes with Mesa's internal hash table.
2009-10-16 08:43:02 -07:00
Brian Paul
946bc9aa42 docs: document GLSL float parsing bug fix 2009-10-16 07:38:39 -06:00
Brian Paul
89b31c9619 mesa: use C locale for _mesa_strtod()
_mesa_strtod() is used for shader/program parsing where the decimal
point character is always '.'  Use strtod_l() with a "C" locale to
ensure correct string->double conversion when the actual locale uses
another character such as ',' for the decimal point.

Fixes bug 24531.
2009-10-16 07:36:50 -06:00
José Fonseca
166957abeb progs/tests: Use rand() instead of random().
Forgot these on previous commit.
2009-10-16 11:42:13 +01:00
José Fonseca
699260b195 progs/tests: Use rand() instead of random().
More portable. Same implementation on Linux.
2009-10-16 11:39:29 +01:00
Vinson Lee
60b6c74583 prog/tests: Fix MSVC build. 2009-10-16 11:36:09 +01:00
Corbin Simpson
e4f21be13a r300g: Set logical ID for each emitted texture/sampler.
multitexarray works on my r300, but texrect doesn't.
2009-10-15 16:58:26 -07:00
Brian Paul
fa3046431a dri/common: updated #includes 2009-10-15 14:57:45 -06:00
Brian Paul
a37c9ac8ee dri/common: use _mesa_little_endian() and update comments 2009-10-15 14:54:32 -06:00
Brian Paul
9bf2aa3329 dri/common: fix broken _dri_texformat_* initializations 2009-10-15 14:49:53 -06:00
Patrice Mandin
a5a05fd782 nouveau: nv30: Hack to enforce same number of bits as front buffer, for render targets 2009-10-15 22:41:09 +02:00
Patrice Mandin
13580aa3d1 nouveau: nv30: refuse binding a colour buffer with a zeta buffer with different bits, till the backend can tell Mesa not to do that. 2009-10-15 21:58:44 +02:00
Zack Rusin
108273c5ed st/xorg: refix source over 2009-10-15 15:23:04 -04:00
Brian Paul
5b7d9053a0 progs/egl: put declarations before code 2009-10-15 13:00:03 -06:00
Chia-I Wu
6c21c8862b egl: Rework the synchronization primitives.
This adds error checking to the synchronization primitives.  And
eglWaitGL is now implemented by eglWaitClient.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:54:00 -06:00
Chia-I Wu
57da499d7b egl: Rework eglSwapInterval.
This adds error checking to eglSwapInterval and clamps the swap
interval.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:54:00 -06:00
Chia-I Wu
bbfd0e2615 egl: Rework error checking in eglSwapBuffers.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:58 -06:00
Chia-I Wu
aaa1253b09 egl: Update comments about eglapi.c.
Mention that opaque handles are looked up and checked.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:57 -06:00
Chia-I Wu
6190663120 egl: Rework error checking in eglGetCurrentSurface.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:57 -06:00
Chia-I Wu
8bb2485ed0 egl: Include GL header in eglconfigutil.h.
This is just a cosmetic change.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:56 -06:00
Chia-I Wu
29d115092e egl: Fix GLX_USE_TLS build.
Remove an extraneous semicolon.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:56 -06:00
Chia-I Wu
2fc1614e7a egl: Fix eglCheckConfigHandle.
A stupid bug by me made the check void.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:55 -06:00
Owen Taylor
3f30b0709b Use the right pitch when rendering to a texture
We need to get the pitch from the texture level we are rendering to,
rather than just using the base texel width.
2009-10-15 11:33:08 -04:00
Robert Noland
16c6a3b71e r600: FRAG_ATTRIB_WPOS and FRAG_ATTRIB_FOGC appear to be supported.
Report unsupported attributes while I'm here.

Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-15 11:29:52 -04:00
Robert Noland
a176b1c5d8 r600: cleanup in r600_cs_process_relocs().
Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-15 11:29:45 -04:00
Robert Noland
e5d6450c2c radeon: return EINVAL for 0 length buffers.
Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-15 11:29:35 -04:00
Andre Maasikas
22a0029a68 r600: fix tfp1 bo size
Setting the wrong bo size resulting in an incomplete
read cache flush when reading the texture.  This fixes the
compiz text corruption.

[agd5f: take hw pitch alignment into account]
2009-10-15 11:24:49 -04:00
Andre Maasikas
a3fec14101 r600: implement ProgramStringNotify
need this to properly test with piglit/glean vert/fragprog tests
copied mostly from r300, many thanks to osiris, nha, airlied, others...
2009-10-15 11:22:18 -04:00
Andre Maasikas
606becc7f3 r600: LIT dst.y gets value from src.x
seems I overlooked this when removing hardcoded swizzles for this
one previously
2009-10-15 11:21:15 -04:00
Andre Maasikas
74c31e5d05 r600: DPH adds w comp of second operand, so set first one to 1 instead 2009-10-15 11:20:04 -04:00
Andre Maasikas
95851d8cb2 r600: fixup KIL instruction a bit
- KILLGT takes 2 arguments
- arb KIL has no dst register
- add TODO about clause ending but currently piglit fp-kil passes and
  does not hang the card
2009-10-15 11:18:53 -04:00
Andre Maasikas
bf68e54a4d r600: use CB_TARGET_MASK instead of CB_SHADER_MASK for setting color mask
makes blend functions work better

Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-10-15 11:17:09 -04:00
Andre Maasikas
5101215a64 r600: user correct alpha blend factor
Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-10-15 11:16:53 -04:00
Andre Maasikas
f7285bdffc r600: clear position enable bit when when wpos is not used by FP
Makes doom3 alot nicer..
2009-10-15 11:16:41 -04:00
Brian Paul
6f8b4d9e36 mesa: regenerated lex.yy.c w/ _mesa_strtod() 2009-10-15 08:59:13 -06:00
Neil Roberts
269f16cd96 mesa: Use _mesa_strtod in the lexer for assembly shaders
See bug 24531.
2009-10-15 08:57:07 -06:00
Brian Paul
c47b03ebeb radeon: initialize renderbuffer Format field in radeon_create_renderbuffer()
Plus, use MESA_FORMAT_S8_Z24 everywhere.
2009-10-14 13:15:05 -06:00
Brian Paul
31f7e8efb2 progs/Makefile: remove extra quoting
This reverts part of commit 115edf24a9 and
fixes the error: "/bin/sh: line 0: test: too many arguments".
2009-10-14 09:37:53 -06:00
Jakob Bornecrantz
72fd1cf292 trace: Handle transfer returning null 2009-10-14 11:44:09 +02:00
Zack Rusin
074e069910 st/xorg: fix most of the composition modes 2009-10-15 00:06:43 -04:00
Corbin Simpson
a82fc97c64 r300g: Move ZTOP to its own state atom.
It may seem pointless, but this avoids a fair amount of predicted CSO pain.
2009-10-14 20:06:38 -07:00
Brian Paul
91bd87c06e progs/demos: try different depth formats in fbo_firecube.c 2009-10-14 19:13:32 -06:00
Brian Paul
85fb3e4027 docs: document more MESA_GLSL env var options 2009-10-14 19:09:08 -06:00
Brian Paul
24e2f61469 mesa: assorted top-level Makefile clean-ups 2009-10-14 19:09:08 -06:00
Brian Paul
2fd5cb7133 mesa: added VERBOSE_SWAPBUFFERS 2009-10-14 19:08:39 -06:00
Brian Paul
f9784072fe vbo: clean-ups, reformatting 2009-10-14 19:08:38 -06:00
Brian Paul
ade1cc9924 mesa: added MESA_VERBOSE option 'draw' to debug glDrawArrays/Elements, etc. 2009-10-14 19:08:38 -06:00
Brian Paul
d9099f8602 mesa: rename VERBOSE_IMMEDIATE->VERBOSE_MATERIAL to reflect what it does 2009-10-14 19:08:38 -06:00
Brian Paul
73fc0ca4c3 mesa: remove unused ctx->Driver.PrioritizeTextures() hook 2009-10-14 19:08:38 -06:00
Brian Paul
0187e042b6 mesa: remove unused ctx->Driver.TextureMatrix() hook 2009-10-14 19:08:38 -06:00
Tom Fogal
115edf24a9 Fix build when PROGRAM_DIRS is empty.
SUBDIRS just takes PROGRAM_DIRS value.  If PROGRAM_DIRS gets set
to the empty string (as can happen when building only OSMesa), a
'for' loop will lack anything to iterate over, causing a parse
error.

This fixes the issue by making sure SUBDIRS is the null string
when PROGRAM_DIRS is, and wrapping the for loops in if's, causing
them only to execute if there are directories to iterate over.
2009-10-13 16:22:09 -06:00
Tom Fogal
9282edfaa0 ac: Fix AIX shared library builds.
AIX uses ".a" for both static and shared library extensions.
2009-10-13 16:22:06 -06:00
Jakob Bornecrantz
ef067b5f01 st/xorg: Fix dpms include problems 2009-10-13 19:16:21 +02:00
Jakob Bornecrantz
5c4bdbd825 autoconf: Fix case for not having package 2009-10-15 01:25:48 +01:00
Zack Rusin
59cf40059a st/xorg: get transparency on fills working (fixes Qt/KDE apps) 2009-10-14 19:04:29 -04:00
Jakob Bornecrantz
96c9b39a6a i915g: Fix warnings 2009-10-14 23:05:55 +01:00
Alex Deucher
f22c427bd6 r600: enable EXT_vertex_array_bgra extensions 2009-10-14 14:19:12 -04:00
José Fonseca
3ce3c03257 util: Fix cpu detection on Windows. Cleanup. 2009-10-14 17:27:06 +01:00
José Fonseca
4046c3bab4 llvmpipe: Use ALIGN_STACK. 2009-10-14 17:24:22 +01:00
José Fonseca
68edb4eac5 gallium: New ALIGN_STACK macro to tell gcc to align stack pointer. 2009-10-14 17:24:22 +01:00
José Fonseca
5ba645f0fb scons: Disable SSE intrinsics on MinGW.
-mstackrealign causes stack corruption on MinGW. And without it the ability
to use SSE instrinsics goes down the drain. Even if we use
__attribute__((force_align_arg_pointer)) for the functions we explicitly
use SSE instrinsics, the SSE code automatically generated by gcc will
cause assertion failures. What a nightmare.

Thankfully LLVM gets this right, so all runtime generated SSE code just
works. rtasm code doesn't assume 16byte alignment. Therefore the bulk of
our performance sensitive code is not affected by this.

Still, intrinsics can be convenient, and it would be nice
to get this working again some day, sp will try to get a reduced test
case.
2009-10-14 17:24:21 +01:00
Brian Paul
9fd7e9ef05 Merge branch 'mesa_7_6_branch' 2009-10-14 09:40:05 -06:00
Brian Paul
ce3801ab87 Merge branch 'mesa_7_6_branch' 2009-10-14 09:22:30 -06:00
Brian Paul
98eb7a14a4 mesa: remove left-over debug printf 2009-10-14 07:52:39 -06:00
Vinson Lee
ea862ec8ff prog/tests: Fix MSVC build. 2009-10-14 07:52:39 -06:00
Corbin Simpson
fd63f89e95 r300g: Move ztop to derived state.
Need to get it into its own atom instead of piggybacking on DSA.
2009-10-14 03:09:41 -07:00
Corbin Simpson
f13e507798 r300g: Compiler warning cleanup. 2009-10-14 01:58:18 -07:00
Dave Airlie
88b697fb0a r300g: remove buffer add that should be unnecessary.
This should be handled in the emit fine
2009-10-14 18:24:34 +10:00
Dave Airlie
fa581580b1 r300g: add QUERY to KITCHEN_SINK
I missed this, thanks to Corbin for pointing it out.
2009-10-14 18:24:05 +10:00
Dave Airlie
ce5cba040c r300g: add one more ZTOP disable bit.
Still missing the frag uses kill support, hopefully nha can point that out.
2009-10-14 18:05:14 +10:00
Dave Airlie
51d1cf55da r300g: port over last parts of oq support.
Add support for begin/end in each CS so we don't get any other
processes rendering in between.

TODO:
blame other parts of driver for this not working like Z.
2009-10-14 17:44:19 +10:00
Dave Airlie
47791697ab r300g: convert query to a state for emitting.
This means we don't emit in the begin query but when we have
to flush. Similiar to classic.

TODO:
make query object actually work.
2009-10-14 17:14:43 +10:00
Dave Airlie
c1bee7bdea r300g: fixup arb occulsion query support.
1: add rv530 support
   - num z pipes cap
   - add proper start/finish query options for rv530

2: convert to use linked list properly.

3: add flushing required check.

4: initial Z top disabling support.

TODO:
make it actually work on my rv530.
2009-10-14 16:53:12 +10:00
Dave Airlie
210481ae16 r300g: attempt to make bo space check sane.
This attempts to make r300g do proper bo space checking as opposed
to whatever it was doing now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-14 15:13:25 +10:00
Dave Airlie
23c0c820e2 r300g: fix case where texture unit 0 is disabled but unit 1 is enabled.
to reproduce, start texrect, disable 0 texture in menu.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-14 11:42:05 +10:00
Brian Paul
220f72a8d0 mesa: minor tweak to printf string 2009-10-13 16:33:36 -06:00
Brian Paul
435623b3f0 mesa: rework _mesa_read_shader() debug hook
Look for shaders named "newshader_<CHECKSUM>" to replace the incoming
shader text.  For debug purposes.
2009-10-13 16:33:36 -06:00
Brian Paul
dfefde38c7 mesa: don't print pointer in _mesa_fprint_parameter_list() 2009-10-13 16:33:36 -06:00
Ian Romanick
f058b25881 Store clipping distance for user clip planes as part of vertex processing
Once the clipping distance is calculated and stored per vertex, the
distances can be re-used when clipping is actually performed.  This
doesn't have any immediate benefit, but it paves the way for
implementing gl_ClipDistance in vertex shaders and result.clip[] in
vertex programs.

This has not produces any oglconform regressions on my G31 system
which uses software TNL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2009-10-13 15:15:20 -07:00
Patrice Mandin
cf33aaf8fe nouveau: nv30: use texture width,height for render target dimensions 2009-10-13 22:53:32 +02:00
Chia-I Wu
f1c5cab552 egl: Improve logging facility.
Add _eglSetLogger and _eglSetLogLevel to allow drivers to change the
message logger or report level.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:37 -06:00
Chia-I Wu
310c76812e egl: Allow binding to any client API.
As a result, EGL_NONE is no longer a valid client API.  And it is
possible that no config supports the current bound API.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Chia-I Wu
e787ffcd02 egl: Preload a driver if eglGetProcAddress is called early.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Chia-I Wu
9061d733d3 egl: Remove core functions from eglGetProcAddress.
eglGetProcAddress may not be used to query core (non-extension)
functions.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Chia-I Wu
5541988578 egl: Add support for driver built-in.
This allows an EGL driver to be compiled together with libEGL.so.  It
eliminates the need to specify a driver, or support module loading on
new platforms.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Zack Rusin
1cc1c3a033 st/xorg: solid fills with masks are supported
gradients are supported, but not enabled by default due to little
testing they got
2009-10-13 13:04:00 -04:00
Brian Paul
83f4e72009 intel: fix broken sw generate mipmap path
Need to restore code that fixed up the intel_texture_image state.
2009-10-13 10:38:34 -06:00
Zack Rusin
89bb33fb20 st/xorg: fix and enable by default xrender acceleration
src in mask was broken
2009-10-13 12:25:13 -04:00
Brian Paul
eefecf5d2a mesa: whitespace fixes 2009-10-13 09:05:02 -06:00
Brian Paul
c8413351c3 mesa: do RTT check in _mesa_meta_check_generate_mipmap_fallback()
We need to check that we can actually render to the texture's format
before doing mipmap generation.

This may fix bug 24219.
2009-10-13 09:05:02 -06:00
Corbin Simpson
ca8cafda0b r300g: More debug flags. 2009-10-12 21:48:08 -07:00
Corbin Simpson
a4a4f7abc2 r300g: Surface debug.
It gets really annoying watching r300g tell me how it's filling surfaces.
Or falling back during filling surfaces.
2009-10-12 21:48:08 -07:00
Corbin Simpson
95a05621eb r300g: Fallback on surfaces we can't render to or from.
Still not sure why st keeps handing down things we can't render to.
2009-10-12 21:48:07 -07:00
Corbin Simpson
36ccdf09b8 r300g: Prevent multiple-use textures from getting incorrectly approved. 2009-10-12 21:48:07 -07:00
Corbin Simpson
05fc9cdfdf r300g: Clean up texture formats. 2009-10-12 21:48:07 -07:00
Brian Paul
3f928b3552 mesa: save/set/restore texture base/wrap state in blitframebuffer_texture() 2009-10-12 18:12:01 -06:00
Brian Paul
b5d6a8e88f mesa: minor clean up in check_begin_texture_render() 2009-10-12 18:12:01 -06:00
Brian Paul
47a7535f41 intel: whitespace/formatting clean-up 2009-10-12 18:12:00 -06:00
Brian Paul
3732d0a77d intel: replace extern decl with #include 2009-10-12 18:12:00 -06:00
Brian Paul
b9c2897957 intel: added INLINE keyword to minify()
This is mainly just to silence some warnings.
2009-10-12 18:12:00 -06:00
Brian Paul
c932e21fa8 intel: code clean-ups 2009-10-12 18:12:00 -06:00
Brian Paul
e6594a22f2 intel: pass zslice to intel_miptree_image_offset()
This lets us get rid of intel_miptree_depth_offsets() and simplify all
of the calling code.
2009-10-12 18:12:00 -06:00
Brian Paul
15d2ef6024 i965: remove unused var 2009-10-12 18:12:00 -06:00
Vinson Lee
96fd13c1a0 prog/tests: Fix MSVC build. 2009-10-12 18:05:23 -06:00
Brian Paul
6c1cd4c558 mesa: print program Id when printing 2009-10-12 18:05:23 -06:00
Patrice Mandin
a5348d435d Add support for more 8 and 16 bits formats 2009-10-12 21:03:26 +02:00
Andre Maasikas
7a32c0a19e r600: implement ProgramStringNotify
need this to properly test with piglit/glean vert/fragprog tests
copied mostly from r300, many thanks to osiris, nha, airlied, others...
2009-10-12 16:28:36 +03:00
Andre Maasikas
da66d9e12d r600: LIT dst.y gets value from src.x
seems I overlooked this when removing hardcoded swizzles for this
one previously
2009-10-12 16:28:25 +03:00
Andre Maasikas
97dd35bd6f r600: DPH adds w comp of second operand, so set first one to 1 instead 2009-10-12 16:28:16 +03:00
Zack Rusin
150d4968e3 st/xorg: initialize pipe in the renderer 2009-10-11 21:52:10 -04:00
Zack Rusin
319a588238 st/xorg: lots of rendering and xv changes
extract all the rendering code to xorg_rendedrer, make both exa and xv
share that code. in the process cleanup the rendering code and implement
a lot more of the xv infrastructure.
2009-10-11 20:02:47 -04:00
Zack Rusin
59ae3d5155 configs: fix some remains of the i915simple driver 2009-10-11 20:02:47 -04:00
Zack Rusin
4969d014e5 st/xorg: implement basics of xv 2009-10-11 20:02:47 -04:00
Eric Anholt
f3be27c0cf i965: Fix the last valid address setting for the index buffer.
Again, last valid address, not first invalid address.  Fixes regression
in 255e5be265 that the kernel now catches
and caused piglit draw_elements_base_vertex to fail.
2009-10-11 11:21:03 -07:00
Eric Anholt
a82da7fa26 i965: Fix the bounds emitted in the vertex buffer packets.
It's the address of the last valid byte, not the address of the first
invalid byte.

This should also fix problems with rendering with the new sanity checks in
the kernel.
2009-10-11 11:21:03 -07:00
Nicolai Hähnle
f096cc7dc1 r300g: Fix fragment program constants upload on R300
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-11 12:41:18 +02:00
Dave Airlie
3611d01a44 r300g: fix blending default state + alpha separate.
this makes the default state same as r300
2009-10-11 19:30:23 +10:00
Vinson Lee
cbf46ed670 progs/perf: Fix MSVC build. 2009-10-10 10:45:16 -06:00
Brian Paul
57e3eb1b17 Merge branch 'mesa_7_6_branch' 2009-10-10 09:25:34 -06:00
Brian Paul
39daa763b5 softpipe: fix multi-drawbuffers regression
This is part of the fix for bug 24401.
2009-10-10 09:24:22 -06:00
Brian Paul
768481ed40 softpipe: revert 564df9dc5f
This change silenced valgrind warnings but broke progs/tests/drawbuffers.
The problem is we don't know the surface's state when we start caching it
(it may or may not be initialized/cleared/etc).  So "clearing" it here was
presumptuous.  Leaving the code in place (but disabled) for reference and
when using valgrind.

Fixes bug 24401
2009-10-10 09:18:14 -06:00
Cooper Yuan
a74e53ddba r300g: add video surface create and destroy functions 2009-10-10 14:41:44 +08:00
Alex Deucher
194ede4bf9 radeon: fix scissor regression
fixes fdo bug 24248
2009-10-09 15:44:32 -04:00
Brian Paul
2738681e84 docs: fix aux buffer bug 24426 2009-10-09 13:23:07 -06:00
Brian Paul
6164f1fe79 st/mesa: create aux buffers according to visual
Fixes bug 24426 for gallium.
2009-10-09 13:22:15 -06:00
Brian Paul
ce64e063a8 mesa: fix incorrect assertion in _mesa_add_aux_renderbuffers()
Fixes bug 24426.
2009-10-09 13:22:00 -06:00
Brian Paul
45e76d2665 mesa: remove a bunch of gl_renderbuffer fields
_ActualFormat is replaced by Format (MESA_FORMAT_x).
ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are
all replaced by MESA_FORMAT_x queries.
2009-10-08 20:27:27 -06:00
Brian Paul
f7fb30f03b mesa: regenerated gl_mangle.h file 2009-10-08 09:19:42 -06:00
Jakob Bornecrantz
db828ed758 st/xorg: Old X servers don't deal well with failing accesses 2009-10-08 14:54:38 +02:00
Jakob Bornecrantz
6d629d4aa2 st/xorg: More fallback debugging
Change the fallback debugging around a bit and do the old commit correctly
2009-10-08 14:50:40 +02:00
Jakob Bornecrantz
992b143b25 Revert "st/xorg: Debug fallbacks for composite as well"
This commit included a change that should have been in
its own commit, and turns out that you can do what was
suposed to go in it in much better way as well.

This reverts commit 5080e8bea6.
2009-10-08 14:46:29 +02:00
Jakob Bornecrantz
5080e8bea6 st/xorg: Debug fallbacks for composite as well 2009-10-08 13:42:44 +02:00
Jakob Bornecrantz
552efdae06 st/xorg: Use A8 textures for depth 8 pixmaps
There is no hardware out there that can render to I8 textures.
2009-10-08 13:42:40 +02:00
Jakob Bornecrantz
a31d16cbfa st/xorg: Fix depth stencil buffers on old X servers
Sanity checking is for the weak.
2009-10-08 13:42:31 +02:00
Vinson Lee
76d2ec3a0a progs/tests: Add tests to Makefile. 2009-10-09 07:24:37 -06:00
Brian Paul
f36123323c softpipe: restore/fix print_vertex() debug helper 2009-10-09 07:24:37 -06:00
Jakob Bornecrantz
023bab675a progs/perf: Ignores! 2009-10-09 14:00:15 +01:00
José Fonseca
c595dea23c util: Force ESI register for cpuid's ebx result.
Fixes a segfault and better code. Unfortunately using an arbitrary
register ("=r") causes the gcc to abort when the code is optimized saying
it can't satisfy the constraint. Setting seems to do the trick.
2009-10-09 13:22:42 +01:00
José Fonseca
69588d7ed5 llvmpipe: Eliminate constant mapping/unmapping. 2009-10-09 11:29:33 +01:00
José Fonseca
d54e9f54d0 progs: Remove unused empty file. 2009-10-09 11:08:17 +01:00
José Fonseca
b858257ca6 gdi: Fix the build when llvmpipe is requested (the default) but llvm is not present. 2009-10-09 11:08:17 +01:00
Andre Maasikas
44c6c20b69 r600: fixup KIL instruction a bit
- KILLGT takes 2 arguments
- arb KIL has no dst register
- add TODO about clause ending but currently piglit fp-kil passes and
  does not hang the card
2009-10-09 11:52:48 +03:00
Brian Paul
90692486aa docs: bump libdrm version requirement
Probably need to bump other version requirements too...
2009-10-08 20:49:36 -06:00
Eric Anholt
859828cc4f mesa: Bump the required libdrm version to reflect reality.
Not all drivers require the latest version, but distros are good at
tracking it since we've got a good record as far as not regressing, and
it sure beats having a weird compile failure in someone else's driver
later on.
2009-10-08 17:18:12 -07:00
Eric Anholt
9b8d2e76c3 i965: Use bo_references for the state cache delete function.
This appears to shave about 3% off the CPU usage in cairo-gl for firefox.
2009-10-08 17:12:23 -07:00
Eric Anholt
193dddb04e intel: Use new drm_intel_bo_references() to avoid flushing. 2009-10-08 17:12:23 -07:00
Brian Paul
f49d53594c mesa: free display list state after freeing shared state
Fixes bug 24402.
2009-10-08 12:50:44 -06:00
Brian Paul
f67bc2e872 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/common/meta.c
2009-10-08 09:28:07 -06:00
Vinson Lee
f7455ad7af progs/tests: Fix MSVC build. 2009-10-08 08:08:11 -06:00
Brian Paul
f001cc0981 mesa: clean up extended opcode code 2009-10-07 16:51:26 -06:00
Brian Paul
33e9ac20e3 mesa: move gl_list_instruction and gl_list_extensions to dlist.c 2009-10-07 16:41:18 -06:00
Brian Paul
15f05e97aa mesa: added _mesa_free_display_list_data() 2009-10-07 16:32:25 -06:00
Brian Paul
fc995c7298 mesa: clean-up display list mem allocation, fix NULL handling
The -1 term in alloc_instruction() foiled later NULL pointer checks.
2009-10-07 16:22:24 -06:00
Brian Paul
77be195cf6 main: replace ALLOC_INSTRUCTION macro with regular function 2009-10-07 16:12:26 -06:00
Brian Paul
6e1697bee7 mesa: rename display list functions
_mesa_alloc_instruction() sounded like it was related to vertex/fragment
program instructions, but it wasn't.
2009-10-07 16:03:09 -06:00
Brian Paul
ee3fbe7067 gallium/xlib: call XQueryExtension() in glXQueryExtension()
See bug 24321.
2009-10-07 14:43:27 -06:00
Brian Paul
9f002e4aaa mesa/xlib: call XQueryExtension() in glXQueryExtension()
See bug 24321.
2009-10-07 14:42:16 -06:00
Vinson Lee
0083d2e40a i915g: Fix MSVC build. 2009-10-07 14:29:23 -06:00
Brian Paul
7dd2c0afd6 mesa: don't need to free textures, VBOs, etc. in _mesa_meta_free()
They're freed by the normal context deallocation code.
Fixes Blender crash, bug 24185.
2009-10-07 14:07:49 -06:00
Brian Paul
2b9418b278 softpipe: new comments 2009-10-07 13:30:48 -06:00
Brian Paul
0fb71be217 softpipe: whitespace and comment fixes 2009-10-07 13:21:57 -06:00
Brian Paul
9a0ff33ad6 softpipe: prefix non-static functions with sp_ 2009-10-07 13:17:20 -06:00
Joakim Sindholt
cf6209b274 r300compiler: fix scons build again 2009-10-07 21:02:18 +02:00
Nicolai Hähnle
7ca7220ea1 Merge branch 'master' into r300g-glsl
Conflicts:
	src/gallium/drivers/r300/r300_tgsi_to_rc.c

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-07 20:45:08 +02:00
Nicolai Hähnle
5b4c0b864a Merge branch 'mesa_7_6_branch' 2009-10-07 20:39:22 +02:00
Nicolai Hähnle
9fde81bb20 shader_api: Fix bounds checking of glUniform and glUniformMatrix
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-10-07 20:36:23 +02:00
Nicolai Hähnle
ae351599f1 prog_parameter: Document the fact that Size may be > 4
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-07 20:33:55 +02:00
Keith Whitwell
3f5a316f36 util: do some more util_blit_pixels cases without temporaries
When the source surface is pointing at a 2d texture with only one
mipmap level, use that directly rather than creating a temporary.
Probably want to cover more cases, but this is a start.
2009-10-07 18:15:21 +01:00
Keith Whitwell
c0de2ed505 mesa/st: add missing mesa constant file name
There are many different names for constants in mesa, we were missing
one since the ureg rewrite.
2009-10-07 18:15:20 +01:00
Brian Paul
2ef1aae163 st/mesa: pass pipe_screen, not pipe_context to st_choose_format() functions
These don't depend on context state, but use a screen pointer.
2009-10-07 09:58:34 -06:00
Brian Paul
cdcd9da480 docs: fix glXQueryDrawable() bugs 2009-10-07 09:41:38 -06:00
Brian Paul
c3eef6021a mesa/xlib: fix glXQueryDrawable() bugs, see bug 24320 2009-10-07 09:41:38 -06:00
Brian Paul
0526100a5c gallium/xlib: fix glXQueryDrawable() bugs, see bug 24320 2009-10-07 09:41:38 -06:00
Brian Paul
f36425b569 progs/xdemos: test glXQueryDrawable() 2009-10-07 09:41:38 -06:00
Brian Paul
846a6b0695 progs/xdemos: fix swapped parameters to CreatePbuffer() 2009-10-07 09:41:38 -06:00
Michel Dänzer
de81b2cf0a st/dri: Add missing front buffer case in dri_get_buffers().
This seems to help for compiz at least with some drivers.

Also add an assert(0) to catch unhandled cases in the future.
2009-10-07 16:36:39 +02:00
Brian Paul
edbaa717b4 swrast: s/GLfloat/GLuint/ in bzero() 2009-10-07 08:07:53 -06:00
Brian Paul
14f21c7850 swrast: add missing returns 2009-10-07 08:05:28 -06:00
Vinson Lee
4b3cbecb3a progs/test: Fix MSVC build. 2009-10-07 07:54:31 -06:00
Brian Paul
e3fff3daf0 mesa/xlib: return 0 for errorBase, eventBase in glXQueryExtension()
A little better than leaving the values undefined, I think.
See bug 24321.
2009-10-07 07:45:59 -06:00
Brian Paul
f9904edf53 gallium/xlib: return 0 for errorBase, eventBase in glXQueryExtension()
A little better than leaving the values undefined, I think.
See bug 24321.
2009-10-07 07:45:59 -06:00
Jakob Bornecrantz
0f0127f6f9 i915g: Use buffer write instead of map for lit vertices 2009-10-07 14:04:48 +01:00
Jakob Bornecrantz
f8ba93aefd i915g: Change order of buffer_write arguments
They now follow the pipe_buffer_write style,
	its the gallium driver that sets the interface not
	the winsys.
2009-10-07 13:48:32 +01:00
Jakob Bornecrantz
030723fc5d i915g: Disable vbuf fifo and minor commenting of vbuf code
The vbuf fifo doesn't appear to help once the libdrm
	reuse flag has been set.
2009-10-07 13:48:32 +01:00
Brian Paul
74d61d03b5 mesa: added MESA_FORMAT_XRGB8888 2009-10-06 22:30:01 -06:00
Younes Manton
aec2c010f6 nv04-nv40: Fix swizzle transfers for NPOT sizes.
Workarounds not necessary, SIFM can handle NPOT, we just weren't setting
dst dimensions properly. SIFM can't handle odd w,h though, that still
needs fixing.
2009-10-06 22:11:07 -04:00
Brian Paul
c5b7254892 mesa: added case for MESA_FORMAT_SIGNED_RGBA_16 2009-10-06 19:01:43 -06:00
Brian Paul
c13b9a141d mesa: added MESA_FORMAT_SIGNED_RGBA_16 for accum buffers 2009-10-06 19:00:09 -06:00
Brian Paul
f7b5e616e0 mesa: added _mesa_get_format_color_encoding() 2009-10-06 18:56:29 -06:00
Brian Paul
edfd2f7c4f mesa: accept more pnames in _mesa_get_format_bits() 2009-10-06 18:54:13 -06:00
Vinson Lee
9c778a90ea progs/tests: fix MSVC build. 2009-10-06 16:02:47 -06:00
Nicolai Hähnle
57abb76e10 r300/compiler: Fix R300 vertex program dumps
The source register field has 8 bits.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 21:24:44 +02:00
Nicolai Hähnle
bcfba138cc r300/compiler: Fix yet another regression in register allocation
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 21:13:27 +02:00
Nicolai Hähnle
a09bd685da r300/compiler: Fix a really stupid logic inversion in the generic dataflow code
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 20:25:07 +02:00
Nicolai Hähnle
9e42f0ebc7 r300/compiler: Fix regression in pair scheduling
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 20:08:32 +02:00
Vinson Lee
017fae04ec progs/perf: Fix MSVC build. 2009-10-06 09:13:14 -06:00
Andre Maasikas
ec58dac86d r600: r700PredictRenderSize can flush, so move index buffer setup after it 2009-10-06 16:17:03 +03:00
Ben Skeggs
340436d8d2 nv50: fix segfault when there's gaps in enabled texture units
Tested with progs/demos/multiarb.
2009-10-06 13:57:51 +10:00
Ben Skeggs
4911443d36 nouveau: fix buffer object leak
Very apparent with resizing windows on DRI2.
2009-10-06 13:31:43 +10:00
Jakob Bornecrantz
db8b363eb9 i915g: Add more defines to tweek batchbuffer 2009-10-06 03:09:16 +01:00
Jakob Bornecrantz
ce3c2b51a2 i915g: Tweek vertexbuffer size 2009-10-06 03:09:01 +01:00
Brian Paul
3e34a2a2b9 drivers: don't include texformat.h
And remove other unneeded #includes while we're at it.
2009-10-05 18:11:37 -06:00
Brian Paul
90cd968300 mesa: don't include texformat.h 2009-10-05 17:56:31 -06:00
Brian Paul
019bc97bd9 mesa: move _mesa_format_to_type_and_comps() to formats.c 2009-10-05 17:54:20 -06:00
Brian Paul
be0765cd6e mesa: move gl_format_info struct to formats.c
This is a private datatype.
2009-10-05 17:50:36 -06:00
Brian Paul
7e7f38a67d mesa: remove feature tests 2009-10-05 17:48:22 -06:00
Brian Paul
6ec3db6cab mesa: use FetchTexelf() instead of FetchTexelc() 2009-10-05 17:28:39 -06:00
Brian Paul
41bee4cff5 mesa: add parenthesis 2009-10-05 17:27:50 -06:00
Brian Paul
1a2bb37264 mesa: lift _mesa_set_fetch_functions() calls out of drivers
Call it from in the main Mesa glTexImage functions.
2009-10-05 17:12:40 -06:00
Brian Paul
bbbf55fa84 mesa: make _mesa_get_texel_fetch_func() static 2009-10-05 16:52:26 -06:00
Brian Paul
722ae91722 i965g: remove 965/brw files from XLIB_WINSYS_SOURCES 2009-10-05 14:43:38 -06:00
Brian Paul
55770d09c1 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/gallium/auxiliary/util/u_cpu_detect.c
2009-10-05 14:42:08 -06:00
Brian Paul
79892e7976 intel: use driReadDrawable in do_copy_texsubimage() 2009-10-05 14:26:16 -06:00
Brian Paul
3b7ec94c0d intel: use driReadDrawable, not driDrawable in do_blit_readpixels() 2009-10-05 14:25:36 -06:00
Brian Paul
3b29dcbb5e intel: remove a buffer equality test in _mesa_make_current()
Before, if we called glXMakeCurrent() to change a context's window binding
while an FBO was bound, we weren't updating the intel->driDrawable and
intel->driReadDrawable fields.  This could cause us to dereference a null
pointer elsewhere.
2009-10-05 14:07:29 -06:00
Jakob Bornecrantz
f00da2a3ff i915g: Drop the simple sufix
None of the other driver have a silly sufix,
	so just drop it. Nothing new added in this commit
	or any other commit but this is better marketing.
2009-10-05 19:48:08 +01:00
Jakob Bornecrantz
c4b821a4c6 i965g: Drop i965simple
The driver never work with real hardware and has
bitrotted for quite some time now, might as well
drop it. If somebody wants to look at it just use git.
2009-10-05 19:48:03 +01:00
Joakim Sindholt
1f39d59a29 r300g: fix scons build
So I didn't touch r300compiler, but r300g now compiles after having
declarations and code untangled. As nha so gently points out, we shouldn't
have to do this just to comply with MSVC compilers.
2009-10-05 19:25:04 +02:00
Brian Paul
a8768bbc9d mesa: fix return value when clipping {Read,Draw}Pixels height <= 0
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

(cherry picked from master, commit 7aeaca33c3)
2009-10-05 11:10:31 -06:00
Jon TURNEY
a15d9ca9cc Fix building of GLSL demos which use M_PI
Some <math.h> files do not define M_PI, in which case, provide our own definition

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-10-05 11:07:23 -06:00
José Fonseca
6971be783b util: Improve the cpuid assembly.
No need to save ebx on 64bit. Use just xchgl. Refer to gcc's cpuid.h header.

Thanks to Uros Bizjak for pointing this out.
2009-10-05 16:49:21 +01:00
José Fonseca
75e0a376cd mesa: Copy textures' base format into wrapper renderbuffer.
Otherwise st_copy_texsubimage will fallback to software blit due to
inconsistent base formats.
2009-10-05 16:49:21 +01:00
Keith Whitwell
b02ef740b9 mesa/st: add ST_DEBUG environment variable
At last it's possible to turn on tgsi dumps and other debugging in the
state tracker without modifying sources...
2009-10-05 15:51:55 +01:00
Keith Whitwell
6a085184eb util: add lost code to util_make_fragment_tex_shader_writemask()
This got ported to ureg at some point, but lost the code that
distinguishes it from regular util_make_fragment_tex_shader().
2009-10-05 15:51:55 +01:00
Andre Maasikas
0b032eabc7 r600: update vertex program selection for draw path 2009-10-05 13:38:53 +03:00
Michel Dänzer
43750f1575 Use _mesa_select_tex_image() rather than hardcoding face 0.
Fixes crash loading a map in sauerbraten with

hwmipmap 1

in ~/.sauerbraten/config.cfg.
2009-10-05 12:31:51 +02:00
Ben Skeggs
d47de50540 st/dri: avoid segfault if we can't get a pixmap's buffers
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:52:33 +10:00
Ben Skeggs
7bfc3172e8 nv50: support PIPE_FORMAT_X8R8G8B8_UNORM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:36:06 +10:00
Ben Skeggs
5313f1be11 nouveau: return pitch value from local_handle_from_texture()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:36:02 +10:00
Ben Skeggs
7aeaca33c3 mesa: fix return value when clipping {Read,Draw}Pixels height <= 0
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:35:40 +10:00
Ben Skeggs
1336989ec6 st/dri: no need to request fake front buffer, only handle it being returned
The previous behaviour was incorrect, and resulted in EXT_tfp being broken
for DDX drivers that implement the correct behaviour (intel/radeon/nouveau).

In the cases where a fake front buffer is required, the X server will
return one when requesting __DRI_BUFFER_FRONT_LEFT.

The Xorg state tracker (aka modesetting_drv) is likely broken now until
it's modified to match the other drivers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:32:55 +10:00
Frederic Crozat
3856c3cc46 r200: remove subpixel offset from viewport
Fixes bug fdo 20340 for r200.
2009-10-04 17:50:16 -04:00
José Fonseca
7a2271c659 util: Make assert a no-op on non-debug builds.
This ensures that an assertion like

  assert(expensive_test());

won't have any penalty on release builds. It also implies that no vital
code should be in assert expressions.
2009-10-04 22:03:16 +01:00
José Fonseca
77ef705058 llvmpipe: Ensure tile cache transfers are mapped before flushing it. 2009-10-04 22:03:16 +01:00
José Fonseca
589ec337f0 llvmpipe: Autogenerate lp_tile_soa.c from u_format.csv.
This is just a temporary change until we code generate the tile read/write
functions in runtime. The new code avoids an extra memcpy that exists in
u_tile.c functions, from which lp_tile_soa.c was originally based.

This achieves up to 5% improvement, particularly in frames with
little geometry overlap.
2009-10-04 22:03:16 +01:00
José Fonseca
7a7dfb09aa util: Fix cpuid invocation for x86_64. 2009-10-04 22:03:15 +01:00
José Fonseca
eb2e41f0c6 llvmpipe: Remove loop testing from format testing.
Loop building will be rewritten.
2009-10-04 22:03:15 +01:00
José Fonseca
10981c0a76 llvmpipe: Match header's protection macro with filename. 2009-10-04 22:03:15 +01:00
José Fonseca
cd0a396813 llvmpipe: Adjust format assertion.
We support array layout too -- if it has a single channel.
2009-10-04 22:03:15 +01:00
Nicolai Hähnle
a6b300ac98 r300/compiler Add support for more of the Sxx set instructions
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 18:31:18 +02:00
Nicolai Hähnle
12e89e0e51 r300/compiler: Emit flow control instructions and ALU result writes on R500
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 18:30:52 +02:00
Corbin Simpson
2a929a08ab r300g: xRGB and RGBx formats.
We now have 48 GLX visuals. Pretty soon, we'll have 90+ visuals,
only five of which ever get tested. :3
2009-10-04 09:30:30 -07:00
Nicolai Hähnle
a30560e6f0 r300/compiler: Refactor the radeon_pair code to support control flow instructions
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 16:50:07 +02:00
Nicolai Hähnle
995135479d r300/compiler: Refactor to allow different instruction types
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 11:41:03 +02:00
Nicolai Hähnle
e6b137dcce r300/compiler: Introduce aluresult register for branch operation support
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 11:13:13 +02:00
Chris Wilson
f194d2737b intel: Suppress a compiler warning for an pointer->int cast
intel_pixel_read.c: In function ‘do_blit_readpixels’:
intel_pixel_read.c:221: warning: cast from pointer to integer of
different size

Cast via an intermediate (GLintptr) instead and hope the result fits
within GLuint... [It should as we simply do not support textures *that*
large!]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-03 23:08:39 +01:00
Chris Wilson
470ec8d42e intel: Assert that relocation offsets are within the target
This should catch the common programming error where we attempt to
emit a relocation to beyond the end of the target buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-03 23:06:39 +01:00
Nicolai Hähnle
b7cf887ca7 r300/compiler: Introduce control flow instructions and refactor dataflow
Note that control flow instruction support isn't actually fully functional yet.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 23:37:16 +02:00
José Fonseca
cbb57bf726 llvmpipe: Fetch tile only if a color buffer is bound. 2009-10-03 19:42:22 +01:00
Nicolai Hähnle
6d25b9125e Merge branch 'master' into r300-compiler 2009-10-03 19:30:48 +02:00
Nicolai Hähnle
7d2699aedc prog_parameter: Document the fact that Size may be > 4
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 19:30:05 +02:00
Nicolai Hähnle
81e5188f66 r300g: Do not abort on fragment program compiler error
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 19:29:48 +02:00
Nicolai Hähnle
59b20b760d r300g: Fix memory leak in radeon_texture_from_shared_handle
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 18:07:34 +02:00
Sedat Dilek
aa6aa77a1b r300g: Build in the trace and softpipe driver for xorg state tracker
Same as in src/gallium/winsys/drm/intel/xorg/Makefile

Thanks MrCooper for explanations on IRC

[ Summary amended by Michel Dänzer to clarify that this is related to the xorg
  state tracker ]
2009-10-03 18:01:58 +02:00
Michel Dänzer
b330cebe01 radeon: Cope better with texture images with no miptrees.
Fixes crash with compiz magnifier plugin.
2009-10-03 18:01:58 +02:00
Michel Dänzer
f741c1eed4 swrast: Move up state validation in _swrast_ReadPixels.
This ensures the driver won't map the wrong set of textures.
2009-10-03 18:01:58 +02:00
Michel Dänzer
4a6759b778 meta: Make sure texImage->TexFormat is valid for CopyTex(Sub)Image. 2009-10-03 18:01:57 +02:00
Nicolai Hähnle
26df8af4fe r300g: Remove an unnecessarily created pipe buffer (and thus fix a leak)
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 17:51:09 +02:00
Nicolai Hähnle
fce2095a90 st/dri: Install APPLE_vertex_array_object functions
Besides from being necessary to use that extension, it also fixes a crash
when deleting the currently bound vertex array object.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 17:42:50 +02:00
Nicolai Hähnle
751aa58e01 r300g: Reset vbo_offset after allocation of a new buffer
This fixes the glxgears bug, among other things.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 17:27:50 +02:00
Nicolai Hähnle
ebbd65eb06 st/dri: Install ARB_vertex_array_object functions
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 11:45:19 +02:00
Nicolai Hähnle
bbe384c86a r300: Workaround problem on R500 with very large fragment programs
The non-KMS interface is to blame here. In theory, a proper fix
could be produced that works for the KMS interface only, but it
require cleaning a lot of mess. Easier to just do it right in r300g.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 01:39:13 +02:00
Brian Paul
be16acaafa mesa: optimized _mesa_meta_BlitFramebuffer() for src=texture case
If the src renderbuffer is actually a texture, we can directly use that
texture as the src and avoid a copy.
2009-10-02 14:00:02 -06:00
Eric Anholt
4182b58169 i965: Use a little stack space to avoid a malloc in wm_get_binding_table. 2009-10-02 11:42:19 -07:00
Eric Anholt
6d0fc3cfde mesa: Remove another unexplained Flush call, this time from BindFramebuffer.
Combined with the previous fix, it takes cairo-gl firefox-talos-gfx time
from 120 seconds to 90 seconds on my GM45.
2009-10-02 11:42:07 -07:00
Eric Anholt
f019577f0c Revert "Flush driver, not just tnl module."
This reverts commit df058298e1.  It didn't
explain why it was required, doesnt appear to be required, and is a
significant performance penalty for cairo-gl firefox.

Conflicts:

	src/mesa/main/fbobject.c
2009-10-02 11:41:29 -07:00
Eric Anholt
3d78a86cd7 intel: Remove an unexplained flush from intelClearWithBlit. 2009-10-02 11:38:36 -07:00
Alex Deucher
3f623cfffe r600: remove support for host-based ibs
no longer used now that the hw supports this natively.

Also, clean up some formatting.
2009-10-02 14:34:28 -04:00
Keith Whitwell
918199fb0f mesa/st: don't reuse vertex buffers for bitmap, clear quads
Currently using max_slots > 1 will cause synchronous rendering
if the driver flushes its command buffers between one bitmap and the
next.

Need to improve buffer_write to allow NO_WAIT (as well as no_flush)
updates to buffers where we know there is no conflict with previous
data.
2009-10-02 19:03:15 +01:00
Michel Dänzer
316b4ddcf7 st/xorg: Use PIPE_TRANSFER_MAP_DIRECTLY flag in EXA PrepareAccess hook.
Propagate NULL return value.

This also allows removing the DRM_MODE_FEATURE_DIRTYFB specific pixmap
management hacks.
2009-10-02 18:13:26 +02:00
Michel Dänzer
9db647bb7a gallium: Add PIPE_TRANSFER_MAP_DIRECTLY usage flag.
Asks the driver to map the texture storage directly or return NULL if that's
not possible.
2009-10-02 18:13:26 +02:00
Michel Dänzer
47e41b024e gallium: Preparations for adding more PIPE_TRANSFER_* usage flags.
Always test for PIPE_TRANSFER_READ/WRITE using the bit-wise and operator, and
add a pipe_transfer_buffer_flags() helper for getting the buffer usage flags
corresponding to them.
2009-10-02 18:13:26 +02:00
Brian Paul
c01a77d304 docs: document default texture binding fix 2009-10-02 09:58:16 -06:00
Brian Paul
e1bddd159f mesa: fix incorrect default texture binding in unbind_texobj_from_texunits()
If we deleted a currently bound texture, we were always reverting the texture
binding to the default 1D texture rather than the proper default texture.
2009-10-02 09:57:00 -06:00
Brian Paul
7d4b348c67 intel: wrap _mesa_meta_GenerateMipmap()
Need to check if we'll take the software path so which requires mapping the
src texture image.

Fixes crash in piglit gen-compressed-teximage, bug 24219.  However, the
test still does not pass (it may never have).
2009-10-02 09:03:27 -06:00
Brian Paul
f1cab802b8 mesa: added _mesa_meta_check_generate_mipmap_fallback() 2009-10-02 09:03:27 -06:00
Brian Paul
85ee0ef9a7 gallium/xlib: use bitwise-and to test GLX_RGBA_BIT in choose_visual()
The parameter is a bitmask.
2009-10-02 07:52:29 -06:00
Brian Paul
584b0879ac xlib: use bitwise-and to test GLX_RGBA_BIT in choose_visual()
The parameter is a bitmask.
2009-10-02 07:51:19 -06:00
Brian Paul
abc12d0636 gallium/xlib: return GLX_RGBA_BIT or GLX_COLOR_INDEX_BIT in get_config()
This reverts part of commit a6b84aef4a
2009-10-02 07:47:49 -06:00
Brian Paul
389021220d gallium: replace // comments with /* */ 2009-10-02 07:31:42 -06:00
Brian Paul
337480e1f8 gallium: remove // comment and extra whitespace 2009-10-02 07:26:28 -06:00
Brian Paul
32aa40eee4 mesa: removed gl_texture_image::CompressedSize field
Just call ctx->Driver.CompressedTextureSize() when we need to get
the compressed image size.
2009-10-01 21:13:34 -06:00
Younes Manton
f9f7646fe6 g3dvl: Formatting. 2009-10-01 22:57:39 -04:00
Younes Manton
577f12fbba g3dvl: Delete state_trackers/g3dvl, other unused files. 2009-10-01 22:57:39 -04:00
Younes Manton
fcb595c04f g3dvl: Copyright blocks. 2009-10-01 22:53:00 -04:00
Younes Manton
62db9b21da st/xvmc: Set default CSC matrix to BT.601, no ProcAmp, full range RGB. 2009-10-01 22:52:59 -04:00
Younes Manton
e00da1476f g3dvl: Color space conv interface & vl impl.
Interface is pipe_video_context::set_csc_matrix().

vl_csc.h defines some helpers to generate CSC matrices based on one of
the color standard and a user defined ProcAmp (brightness, contrast,
saturation, hue).
2009-10-01 22:52:59 -04:00
Brian Paul
8c92a531fb mesa: reformatting 2009-10-01 19:01:02 -06:00
Brian Paul
bb659f6e53 progs/tests: additional debug code 2009-10-01 16:43:22 -06:00
Brian Paul
4ca9ba2544 mesa: move mesa_set_fetch_functions() 2009-10-01 16:42:37 -06:00
Brian Paul
073d55f584 radeon: fix tx_table[] entry
XXX need to still verify that the table entries are in correct order.
2009-10-01 16:41:52 -06:00
Brian Paul
4208a8c026 savage: s/Xfree/_mesa_free/ 2009-10-01 16:41:24 -06:00
Brian Paul
354d66e2f5 mesa: simplify _mesa_compressed_texture_size() 2009-10-01 16:30:47 -06:00
Brian Paul
b6bdafdf2c mesa: remove gl_texture_image::IsCompressed field
Use _mesa_is_format_compressed() instead.
2009-10-01 16:29:44 -06:00
Brian Paul
040fd7ed44 mesa: added _mesa_format_row_stride() 2009-10-01 16:27:23 -06:00
Brian Paul
1c7ec97ec4 mesa: added _mesa_format_image_size() 2009-10-01 15:59:13 -06:00
Eric Anholt
81aa5d717b i915: Add stub ARB_occlusion_query support under a driconf debug option.
This is useful for enabling our GLSL testcases using the 2.0 entrypoints
even though we don't have full GL 2.0.
2009-10-01 14:54:15 -07:00
Eric Anholt
862a2a55b3 i915: Add optional support for ARB_fragment_shader under a driconf option.
Other vendors have enabled ARB_fragment_shader as part of OpenGL 2.0
enablement even on hardware like the 915 with no dynamic branching or
dFdx/dFdy support.  But for now we'll leave it disabled because we don't
do any flattening of ifs or loops, which is rather restrictive.

This support is not complete, and may be unstable depending on your shaders.
It passes 10/15 of the piglit glsl tests, but hangs on glean glsl1.
2009-10-01 14:52:44 -07:00
Eric Anholt
67f4d626d3 i915: Add support or fallbacks for GLSL fragment shader opcodes. 2009-10-01 14:31:04 -07:00
Eric Anholt
f9f31b2574 i915: Add support for varying inputs. 2009-10-01 14:31:04 -07:00
Eric Anholt
7d4b7460b0 i915: Enable ARB_vertex_shader for both i915 and i830.
Since the TNL is all done in software anyway, it should be the same to
the user who's probably using ARB_vertex_program otherwise, but gives them
a nicer programming environment.
2009-10-01 14:31:03 -07:00
Eric Anholt
96a3c69d48 i915: Increase maximum program size to the hardware limits.
This fixes potential heap trashing if the program of choice exceeds limits,
and fixes the native instructions limit being lower than what can be
used by valid programs.
2009-10-01 14:31:03 -07:00
Eric Anholt
61b512c47c i915: Update and translate the fragment program along with state updates.
Previously, we were doing it in the midst of the pipeline run, which gave
an opportunity to enable/disable fallbacks, which is certainly the wrong
time to be doing so.  This manifested itself in a NULL dereference for PutRow
after transitioning out of a fallback during a run_pipeline in glean glsl1.
2009-10-01 14:31:03 -07:00
Eric Anholt
d6fbf87575 Revert "i915: don't validate PS program when falling back to software"
This reverts commit e7044d552c.  It
prevented the driver from ever recovering from a software fallback due
to a program error.  The original bug it claimed to fix doesn't appear to
exist post-revert.
2009-10-01 14:31:03 -07:00
Eric Anholt
4ff816751f i915: Bail when the fragment program has too many total instructions.
Previously, we'd go trashing the heap.
2009-10-01 14:31:03 -07:00
Eric Anholt
994d1db079 i915: Let i915_program_error take a format string, and don't use _mesa_problem.
It's misleading to report things like the program having too many native
instructions as a Mesa implementation error, when the program may just be
too big for the hardware.
2009-10-01 14:31:03 -07:00
Brian Paul
167ffa9e03 mesa: fix memory leak when generating mipmaps for compressed textures 2009-10-01 14:55:13 -06:00
Brian Paul
0574954238 mesa: fix mem leaks 2009-10-01 14:52:28 -06:00
Brian Paul
0f291f2efe gallium/util: silence uninitialized var warning 2009-10-01 14:52:10 -06:00
Brian Paul
63064cf7c3 mesa: add missing return when out of memory 2009-10-01 14:51:43 -06:00
Brian Paul
7b568614a2 mesa: fix potential uninitialized memory reads 2009-10-01 14:51:26 -06:00
Brian Paul
9b27a0d063 glsl: fix mem leak 2009-10-01 14:50:45 -06:00
Brian Paul
b3e41e0d5e st/mesa: check for null before asserts, fix possible mem leak 2009-10-01 14:49:39 -06:00
Brian Paul
b154497bef st/mesa: silence hidden parameter warning 2009-10-01 14:49:04 -06:00
Brian Paul
5d2413fca4 Merge branch 'mesa_7_6_branch' 2009-10-01 13:35:42 -06:00
Brian Paul
495628bc5c st/mesa: fix non-mipmap lastLevel calculation.
reviewed by Brian Paul.
(cherry picked from master, commit ae2daacbac)
2009-10-01 13:34:49 -06:00
Vinson Lee
18883cdf23 mesa: Return -FLT_MAX instead of 0 for LG2(0).
lim x->0 log(x) = -inf so -FLT_MAX is a better approximation than 0
for LG2(0).
2009-10-01 13:33:20 -06:00
Brian Paul
15c57648cd objviewer: remove disabled code 2009-10-01 13:14:50 -06:00
Brian Paul
9745e26adb objviewer: mouse/keyboard info in README file 2009-10-01 13:14:50 -06:00
Brian Paul
d622c4ddba docs: added objviewer to release notes 2009-10-01 13:14:50 -06:00
Brian Paul
24f31ab861 mesa: add objviewer to PROGRAM_DIRS 2009-10-01 13:14:50 -06:00
Brian Paul
0b1de63ad8 mesa: add progs/objviewer to tarball list 2009-10-01 13:14:50 -06:00
Brian Paul
8d93a4c639 objview: clean up drawing VBO code 2009-10-01 13:14:50 -06:00
Brian Paul
c7c62521fb objview: set skybox texture filter 2009-10-01 13:14:50 -06:00
Brian Paul
336994e54c objview: check GL version/extension 2009-10-01 13:14:49 -06:00
Brian Paul
ca1bda552d progs/objviewer: Wavefront .obj file loader/viewer demo
Adapted from code written by Nate Robins.  See README.txt.
2009-10-01 13:14:48 -06:00
Michel Dänzer
e32a341be6 st/xorg: Check that ms->api->destroy is not NULL before calling it.
Fixes potential crash on X server shutdown.
2009-10-01 16:45:11 +02:00
Robert Noland
0b466c8705 util: Enable sockets on BSD
I think this should be safe for all of the BSDs.

Signed-off-by: Robert Noland <rnoland@2hip.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-01 08:42:48 -06:00
Robert Noland
908ecb3faa util: define PIPE_OS_FREEBSD to correct u_cpu_detect on FreeBSD.
Since the various BSDs use some different features here,
define PIPE_OS_OPENBSD and PIPE_OS_NETBSD as well

Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-01 08:40:30 -06:00
Brian Paul
f8d8f45278 mesa: better debug message 2009-10-01 08:38:38 -06:00
Keith Whitwell
4456006ba6 gallium: remove depth.occlusion_count flag
This was redundant as drivers can just keep track of whether they are
inside a begin/end query pair.  We want to add more query types later
and also support nested queries, none of which map well onto a flag like
this.  No driver appeared to be using the flag.
2009-10-01 14:34:23 +01:00
Cooper Yuan
ae2daacbac st/mesa: fix non-mipmap lastLevel calculation.
reviewed by Brian Paul.
2009-10-01 17:54:27 +08:00
Brian Paul
8c36ca707c swrast: fix some texformat regressions
Need to be careful with component ordering for MESA_FORMAT_RGB888
and MESA_FORMAT_RGBA8888.
2009-09-30 22:50:08 -06:00
Brian Paul
3d6a20e5b6 mesa: rename texformat_tmp.h to texfetch_tmp.h 2009-09-30 21:08:06 -06:00
Brian Paul
60843e3ee5 mesa: remove MESA_FORMAT_RGBA4444
Not used by any hardware driver.  ARGB4444 and ARGB4444_REV remain.
2009-09-30 21:04:17 -06:00
Brian Paul
3fa7dbf368 mesa: remove GLchan-based formats; use hw 8-bit/channel formats instead
Removed: MESA_FORMAT_RGBA, RGB, ALPHA, LUMINANCE, LUMINANCE_ALPHA, INTENSITY.
2009-09-30 21:00:16 -06:00
Brian Paul
74ae14a2bd mesa: move texel fetch/store into new texfetch.[ch] files 2009-09-30 20:47:54 -06:00
Brian Paul
884d1abb2a st/mesa: update comment 2009-09-30 20:36:25 -06:00
Brian Paul
bdc761b0f9 mesa: remove gl_texture_format 2009-09-30 20:35:32 -06:00
Brian Paul
1f7c914ad0 mesa: replace gl_texture_format with gl_format
Now gl_texture_image::TexFormat is a simple MESA_FORMAT_x enum.
ctx->Driver.ChooseTexture format also returns a MESA_FORMAT_x.
gl_texture_format will go away next.
2009-09-30 20:28:45 -06:00
Brian Paul
521e4b9b7e glx: fix glXQueryContext(GLX_RENDER_TYPE)
The renderType parameter to CreateContext() was never used.  Also, it
was often passed as zero.  Now when it's zero we check if the context
is RGBA or CI mode and set it accordingly.

Fixes bug 24211.
2009-09-30 15:15:10 -06:00
Eric Anholt
49fbdd18ed i965: Fix massive memory allocation for streaming texture usage.
Once we've freed a miptree, we won't see any more state cache requests
that would hit the things that pointed at it until we've let the miptree
get released back into the BO cache to be reused.  By leaving those
surface state and binding table pointers that pointed at it around, we
would end up with up to (500 * texture size) in memory uselessly consumed
by the state cache.

Bug #20057
Bug #23530
2009-09-30 11:27:27 -07:00
Michel Dänzer
81a62edc08 st/xorg: Fix debug option function call typo. 2009-09-30 18:01:46 +02:00
Chia-I Wu
cef97267d6 mesa/main: New feature FEATURE_beginend.
This feature corresponds to the Begin/End paradigm.  Disabling this
feature also eliminates the use of GLvertexformat completely.
2009-09-30 08:31:56 -06:00
Chia-I Wu
a73ba2d31b mesa/main: Make FEATURE_dlist follow feature conventions.
As shown in mfeatures.h, this allows users of dlist.h to work without
knowing if the feature is available.
2009-09-30 08:31:56 -06:00
Chia-I Wu
aefa1f6ab1 mesa/main: Make FEATURE_evaluators follow feature conventions.
As shown in mfeatures.h, this allows users of eval.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
42fac11d43 mesa/main: New feature FEATURE_queryobj.
It merges FEATURE_ARB_occlusion_query and FEATURE_EXT_timer_query, and
follows the feature conventions.
2009-09-30 08:31:55 -06:00
Chia-I Wu
80630d1fed mesa/main: New feature FEATURE_arrayelt.
This allows the removal of AEcontext.
2009-09-30 08:31:55 -06:00
Chia-I Wu
cc95de82e5 mesa/main: Make FEATURE_texgen follow feature conventions.
As shown in mfeatures.h, this allows users of texgen.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
301a510092 mesa/main: Make FEATURE_feedback follow feature conventions.
As shown in mfeatures.h, this allows users of feedback.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
67a2a4e901 mesa/main: Make FEATURE_drawpix follow feature conventions.
As shown in mfeatures.h, this allows users of drawpix.h to work
without knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
d25080074f mesa/main: New feature FEATURE_rastpos.
It is separated from FEATURE_drawpix and made to follow the feature
conventions.
2009-09-30 08:31:55 -06:00
Chia-I Wu
cab7ea0368 mesa/main: Make FEATURE_histogram follow feature conventions.
As shown in mfeatures.h, this allows users of histogram.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
2b36db496d mesa/main: Make FEATURE_attrib_stack follow feature conventions.
As shown in mfeatures.h, this allows users of attrib.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
a833ff0f53 mesa/main: Make FEATURE_accum follow feature conventions.
As shown in mfeatures.h, this allows users of accum.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
e82b02c7e8 progs/egl: Make demo3 work again.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
28c2190336 progs/egl: Check EGL_MESA_screen_surface is supported in demo2.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
e0b2848f4f progs/egl: Fix a crash in demo1.
The variable "configs" in main() is used without initialization.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
4b95481e95 st/egl: Fix a double free in drm_destroy_context.
st_destroy_context has destroyed the pipe context for us.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
dd81cc885c st/egl: Fix a crash when unbinding current context.
This fixes a NULL-pointer dereference when
eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)
is called.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
fa8df0c40d progs/egl: Replace EGL_i915 by EGL_DEFAULT_DISPLAY.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Brian Paul
b77469871a docs: document GLSL sqrt(0) fix 2009-09-29 19:05:04 -06:00
Brian Paul
322bc403bc glsl: regenerated file 2009-09-29 18:59:37 -06:00
Brian Paul
65765c9f2c glsl: rewrite sqrt(x) intrinsic to handle x=0
Since sqrt() is basically implemented in terms of RSQ/RCP we'll do a
divide by zero if x=0 and wind up with unpredictable results.
Now use CMP instruction to test for x<=0 and return zero in that case.
2009-09-29 18:57:13 -06:00
Brian Paul
3c794e45b0 glsl: add support for CMP instruction 2009-09-29 18:51:49 -06:00
Brian Paul
5f1faf4a21 docs: fixed glXQueryContext(GLX_RENDER_TYPE) 2009-09-29 12:18:41 -06:00
Brian Paul
a6b84aef4a gallium/xlib: fix GLX_RENDER_TYPE query
Return GLX_RGBA_TYPE or GLX_COLOR_INDEX_TYPE.
2009-09-29 12:17:20 -06:00
Brian Paul
86ee448047 mesa/xlib: fix GLX_RENDER_TYPE query
Return GLX_RGBA_TYPE or GLX_COLOR_INDEX_TYPE.
2009-09-29 12:16:20 -06:00
Brian Paul
cb0de06301 mesa: added nopfrag/nopvert options for MESA_GLSL
These options can be used to force vertex/fragment shaders to be no-op
shaders (actually, simple pass-through shaders).  For debug/test purposes.
2009-09-29 10:38:02 -06:00
Brian Paul
c7aee65bb9 mesa: added _mesa_nop_vertex/fragment_program()
For debug/test purposes.
2009-09-29 10:38:02 -06:00
José Fonseca
baddcbc522 llvmpipe: Workaround for bug in llvm 2.5.
The combination of fptosi
and sitofp (necessary for trunc/floor/ceil/round implementation)
somehow becomes invalid code.

Skip the instruction combining pass when SSE4.1 is not available.
2009-09-29 17:28:15 +01:00
José Fonseca
a02ecdf8c2 llvmpipe: First verify LLVM IR, only then run optimizing passes. 2009-09-29 17:28:15 +01:00
José Fonseca
754f48871c llvmpipe: Runtime cpu checks for lp_build_min_simple too. 2009-09-29 17:28:15 +01:00
José Fonseca
741c40a232 llvmpipe: Implement non SSE4.1 versions of floor and round. 2009-09-29 17:28:15 +01:00
Brian Paul
ef9cd84521 glx: indentation fixes 2009-09-29 09:58:47 -06:00
Brian Paul
124f5875ea Merge branch 'mesa_7_6_branch'
Conflicts:

	Makefile
	configs/default
	docs/relnotes.html
	src/gallium/drivers/softpipe/sp_context.c
	src/gallium/drivers/softpipe/sp_tile_cache.c
	src/mesa/main/version.h
2009-09-29 09:46:49 -06:00
Brian Paul
69a3043f41 mesa: bump version to 7.6.1 2009-09-29 09:36:06 -06:00
Brian Paul
2d400d43bf docs: initial 7.6.1 release notes 2009-09-29 09:34:47 -06:00
Brian Paul
9b5541617f mesa: work-around glXCopyContext() bug in _mesa_copy_texture_state()
See bug 24217.
2009-09-29 09:32:40 -06:00
Brian Paul
564df9dc5f softpipe: initialize the clear_flags bitvector in sp_create_tile_cache()
This silences tons of valgrind warnings in programs that don't call
glClear(), such as progs/demos/gamma.
2009-09-29 08:51:00 -06:00
Brian Paul
fbddc75aa2 softpipe: Grab a ref when the fb is set.
Nasty bug when the surface is freed and another is allocated right on
top of it. The next time we set the fb state SP thinks it's the same
surface and doesn't flush, and when the flush eventually happens the
surface belongs to a completely different texture.

(cherry picked from commit a77226071f)

Conflicts:
	src/gallium/drivers/softpipe/sp_context.c
2009-09-29 08:21:54 -06:00
Chia-I Wu
170bd0c882 egl_xdri: Report full list of supported configs.
Call _eglConfigFromContextModesRec to convert __GLcontextModes to
_EGLConfig.  Single-buffered configs are no longer skipped.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:48 -06:00
Chia-I Wu
d845f2754b egl: Add support for querying render buffer.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:48 -06:00
Chia-I Wu
55893b9439 egl: Add a function to convert __GLcontextModes to _EGLConfig.
_eglConfigFromContextModesRec is used to convert a __GLcontextModes to a
_EGLConfig.  Note that the config is not validated.  An invalid mode
is likely to give an invalid config.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
Chia-I Wu
56822b0812 egl: Rework config lookup.
Make it similiar to how contexts and surfaces are looked up.  It should
be slightly faster, and work better with multiple displays.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
Chia-I Wu
95cdd697e7 egl: Rework configuration management.
This mainly implements the algorithms for configuration selection and
sorting, described in the spec.  User errors should also be correctly
detected and reported.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
Chia-I Wu
358c5a8fd1 egl: Introduce config keys.
Config keys are almost config attributes.  A valid config attribute is a
valid config key, but a valid config key may not be a valid config
attribute.

This commit does not distinguish the differences.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
José Fonseca
7cda8ea44c llvmpipe: Emit SSE intrinsics based on runtime cpu capability check.
Note that llvmpipe still doesn't run on any processor yet: if you don't
have a recent processor with SSE4.1 you will still likely end up
hitting a code path for which a generic non-sse4 version is not
implemented yet.
2009-09-29 13:59:16 +01:00
José Fonseca
a81fb2a0d2 util: Cleanup u_cpu_detect, build. Support X86_64 and detect SSE4.1 too.
I was waiting for the need to use this code to arise, and it finally came.

I've tested building this on Linux and Windows, both x86 and x64_64. But
it might break other platforms. Please bear with me and help me fix it.

Many thanks to Dennis Smit who submitted this, and Eric Anholt whose
work this was based on.
2009-09-29 13:59:16 +01:00
José Fonseca
8210abb113 gallium: New PIPE_OS_UNIX to simplify code that is portable to all unices. 2009-09-29 13:59:16 +01:00
Vinson Lee
60f3f22a52 i915: Fix MSVC build. 2009-09-29 11:10:42 +01:00
José Fonseca
57d0fcba67 python: Update for surface_buffer_create change. 2009-09-29 11:09:55 +01:00
José Fonseca
bd2e36a38f g3dvl: assert.h -> util/u_debug.h 2009-09-29 11:09:55 +01:00
José Fonseca
7db33440a8 g3dvl: Define PIPE_VIDEO_CODEC_UNKNOWN for failures.
gcc 4.4 seems particularly picky with int -> enum conversions.
2009-09-29 11:09:55 +01:00
Andre Maasikas
ac9c8b6359 r600: use CB_TARGET_MASK instead of CB_SHADER_MASK for setting color mask
makes blend functions work better

Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-09-29 19:24:35 +10:00
Andre Maasikas
7c5f3c3d8a r600: user correct alpha blend factor
Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-09-29 19:24:34 +10:00
Andre Maasikas
a230ad2bc4 r600: clear position enable bit when when wpos is not used by FP
Makes doom3 alot nicer..
2009-09-29 16:02:00 +08:00
Jakob Bornecrantz
3a8d525373 st/xorg: Add debug for fallbacks 2009-09-28 21:34:45 -07:00
Jakob Bornecrantz
e226bf8a5d st/xorg: Make debug printing optional 2009-09-28 21:26:13 -07:00
Brian Paul
e2e7bd6c1f mesa: move StoreTexImageFunc typedef to .c file 2009-09-28 21:55:47 -06:00
Brian Paul
0a306daf71 mesa: use _mesa_texstore() 2009-09-28 21:52:43 -06:00
Brian Paul
6480210b89 st/mesa: use _mesa_texstore() 2009-09-28 21:52:23 -06:00
Brian Paul
49263e0856 mesa: make individual texstore functions static 2009-09-28 21:49:38 -06:00
Brian Paul
cb0ef0cbf8 glide: use _mesa_texstore() 2009-09-28 21:49:10 -06:00
Brian Paul
b436d729d1 drivers: use _mesa_texstore 2009-09-28 21:46:34 -06:00
Brian Paul
0b1f4dc0fa drivers: use new _mesa_texstore() function 2009-09-28 21:41:11 -06:00
Brian Paul
660ca9c5a2 mesa: new _mesa_texstore() function 2009-09-28 21:40:50 -06:00
Eric Anholt
d492e7b017 meta: Fix invalid PBO access from DrawPixels when trying to just alloc.
This whole reuse of buffers (TexSubImage instead of TexImage, SubData
instead of Data) is bad for hardware drivers, but it's even worse when
we accidentally try to access the 2x2 PBO to fill the new 16x16 texture
we're creating, producing GL errors.

Fixes piglit pbo-drawpixels.  Bug #14163.
2009-09-28 14:12:15 -07:00
Eric Anholt
e885cb48a0 intel: Drop my generatemipmap code in favor of the new shared code. 2009-09-28 14:12:15 -07:00
Eric Anholt
8b23755ce9 intel: Remove some dead metaops code. 2009-09-28 14:12:09 -07:00
Brian Paul
6829ef7460 docs: update news.html file with 7.5.2 and 7.6 release 2009-09-28 13:20:15 -06:00
Ian Romanick
41865d991f Merge branch 'mesa_7_6_branch'
Conflicts:
	Makefile
	src/mesa/main/version.h
2009-09-28 12:03:23 -07:00
Ian Romanick
d39fd9f641 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Conflicts:
	src/mesa/main/version.h
2009-09-28 12:02:39 -07:00
Ian Romanick
18f3afbe88 docs: 7.5.2 md5 sums 2009-09-28 11:41:23 -07:00
Ian Romanick
b807d49f18 Prep for 7.5.2 release 2009-09-28 11:33:52 -07:00
Ian Romanick
86cd188f94 docs: 7.6 md5 sums 2009-09-28 11:29:25 -07:00
Ian Romanick
f0dc378705 Prep for 7.6 release 2009-09-28 11:22:54 -07:00
Brian Paul
05bad193f5 st/mesa: check gl_texture_object::GenerateMipmap field when allocating texmem
In guess_and_alloc_texture() use the gl_texture_object::GenerateMipmap
field as another hint as to whether to allocate space for a whole mipmap.
2009-09-28 10:03:58 -06:00
Brian Paul
8fda97afb8 Merge branch 'mesa_7_6_branch' 2009-09-28 10:02:20 -06:00
Brian Paul
eeb7e04da6 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-28 09:59:59 -06:00
Robert Noland
d09941c8cc Fix build on non GLIBC platforms (FreeBSD at least)
Build was broken by commit 9666529b5a

I'm not certain that this is entirely the correct fix since the demo
from bug #23774 seemed to work before the commit that broke the build.

Signed-off-by: Robert Noland <rnoland@2hip.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-09-28 09:48:45 -06:00
Brian Paul
fc613848e6 docs: list additional 7.5.2 bug fixes 2009-09-28 09:43:42 -06:00
Brian Paul
c7d0f0b46c docs: document gallium mipmap generation fix 2009-09-28 09:38:50 -06:00
Brian Paul
c7fddaf612 st/mesa: fix st_generate_mipmap() issues
The main issue is we didn't always have a gallium texture object with
enough space to store the to-be-generated mipmap levels.  When that's
the case, allocate a new gallium texture and use st_texure_finalize()
to copy images from the old texture to the new one.

We also had the baseLevel parameter to st_render_mipmap() wrong.
2009-09-28 09:37:16 -06:00
Brian Paul
e3a6f57ad6 st/mesa: fix/simplify st_texture_object::lastLevel calculation
Don't compute the st_texture_object::lastLevel field based on the texture
filters.  Use the _MaxLevel value that core Mesa computes for us.
When called from the GenerateMipmap path, we'll use the lastLevel field
as-is.
2009-09-28 09:35:08 -06:00
Brian Paul
41d0606b7f gallium/util: add sanity check assertions 2009-09-28 09:35:04 -06:00
Brian Paul
eb82373abb mesa: use _mesa_get_current_tex_unit() helper 2009-09-28 09:22:33 -06:00
Vinson Lee
6920a355c1 progs/perf: Include local headers before installed headers.
Fixes compilation errors on platforms with older installed GL headers.
2009-09-28 09:03:26 -06:00
Brian Paul
653ae04bea progs/tests: print usage info upon SPACE/u 2009-09-28 08:44:43 -06:00
Brian Paul
c8de476189 progs/tests: re-indent mipmap_limits.c 2009-09-28 08:44:43 -06:00
Younes Manton
9871521b30 llvmpipe: Grab a ref when the fb is set.
Based on softpipe commit a77226071f.
2009-09-28 15:35:29 +01:00
José Fonseca
5687053480 softpipe: Fix MSVC build. 2009-09-28 13:03:03 +01:00
José Fonseca
22658c1650 g3dvl: Fix MSVC build.
pipe/p_compiler for integer types. No declarations out of scope.
2009-09-28 13:02:42 +01:00
Cooper Yuan
99e1745af9 r300g: fix r300g cause GPU hang issue.
why there are two input position semantic tags is that ureg doesn't
set vs input semantic due to commit: 6d8dbd3d1e

so use vs input index instead of semantic name.
2009-09-28 17:55:38 +08:00
Younes Manton
70c44073ad xvmc: Fail on unsupported formats, operations. 2009-09-28 00:17:33 -04:00
Younes Manton
c0745670d8 g3dvl: Missing semicolon. 2009-09-27 23:54:36 -04:00
Brian Paul
729ff875f4 mesa: change _mesa_format_to_type_and_comps() format parameter type 2009-09-27 21:32:12 -06:00
Brian Paul
bd00a7fa4b mesa: sort texstore_funcs[] array, remove search loop 2009-09-27 21:22:57 -06:00
Younes Manton
d52d51ab8a g3dvl: Formatting and cleanups. 2009-09-27 23:14:52 -04:00
Brian Paul
749e50442a mesa: fix render buffer _BaseFormat assignment 2009-09-27 21:14:43 -06:00
Brian Paul
ef089604a9 mesa: use texture format functions 2009-09-27 21:14:12 -06:00
Brian Paul
4fc344790d mesa: update comments 2009-09-27 21:13:46 -06:00
Brian Paul
e987ea9d21 mesa: use more mesa format functions 2009-09-27 21:07:57 -06:00
Brian Paul
5767a677a0 mesa: fix GL_TEXTURE_LUMINANCE_SIZE query 2009-09-27 20:59:28 -06:00
Brian Paul
a2b663fe38 mesa: use more mesa format functions 2009-09-27 20:58:05 -06:00
Brian Paul
af0adb5852 mesa: use more mesa format functions 2009-09-27 20:56:04 -06:00
Brian Paul
5cf5d4be21 mesa: use more format helper functions 2009-09-27 20:51:18 -06:00
Brian Paul
5978cbdf77 mesa: code movement 2009-09-27 20:40:53 -06:00
Brian Paul
ddffe4546a drivers: use more mesa format functions 2009-09-27 20:40:35 -06:00
Brian Paul
9fbb8884f0 mesa/drivers: use _mesa_get_format_bytes() 2009-09-27 20:24:59 -06:00
Brian Paul
e0bc4533eb mesa/drivers: use _mesa_get_format_bytes() 2009-09-27 20:07:41 -06:00
Brian Paul
b58bc12ed4 via: use mesa texture format helper functions 2009-09-27 19:58:18 -06:00
Younes Manton
97c28bb63a g3dvl: Move XvMC under the Xorg state tracker. 2009-09-27 21:54:20 -04:00
Brian Paul
21db8959c1 glide: use _mesa_get_format_bytes() 2009-09-27 19:53:54 -06:00
Brian Paul
2de7683280 mesa: use _mesa_get_format_base_format() 2009-09-27 19:51:45 -06:00
Brian Paul
db8aca3a39 mesa: use _mesa_get_format_bytes() 2009-09-27 19:49:51 -06:00
Brian Paul
5ab5f16919 mesa: added _mesa_get_format_datatype() 2009-09-27 19:42:36 -06:00
Brian Paul
b64d478a5b mesa: use _mesa_get_format_bits() 2009-09-27 19:38:21 -06:00
Brian Paul
c28d78f832 mesa: added _mesa_get_format_bits() 2009-09-27 19:07:44 -06:00
Brian Paul
a608257a02 mesa: remove unused gl_texture_format fields 2009-09-27 18:57:02 -06:00
Brian Paul
e8eed5003b mesa: added MESA_FORMAT_NONE 2009-09-27 18:53:22 -06:00
Brian Paul
cccdc43fa9 mesa: move StoreTexImageFunc to texstore.h 2009-09-27 18:50:04 -06:00
Brian Paul
27e201e9c4 mesa: rework null texel fetch/store funcs 2009-09-27 18:49:14 -06:00
Brian Paul
05e73cc8e2 mesa: replace function pointer types with void *
These fields are no longer used and will be removed soon.
2009-09-27 18:39:52 -06:00
Brian Paul
adce34e23b st/mesa: use _mesa_get_texstore_func() 2009-09-27 18:39:17 -06:00
Brian Paul
f782f90c45 mesa: use _mesa_get_texstore_func() 2009-09-27 18:38:50 -06:00
Brian Paul
d73cd70316 glide: use _mesa_get_texstore_func() 2009-09-27 18:34:12 -06:00
Brian Paul
9525b92efb mesa: NULL-out unused texformat field initializers 2009-09-27 18:28:48 -06:00
Brian Paul
f76cbac04a mesa: use _mesa_get_texstore_func() 2009-09-27 18:28:22 -06:00
Brian Paul
e07862d2c9 st/mesa: use _mesa_get_texstore_func() 2009-09-27 18:27:59 -06:00
Brian Paul
8abb984dc9 mesa: null-out StoreTexImageFunc fields 2009-09-27 18:19:24 -06:00
Younes Manton
e44c85637a g3dvl: Implement XvMC using pipe_video_context. 2009-09-27 20:18:02 -04:00
Brian Paul
431ba64222 mesa: use _mesa_get_texel_store_func() 2009-09-27 18:17:32 -06:00
Brian Paul
da5722bea6 mesa: use new look-up table to get texel fetch/store funcs 2009-09-27 18:09:23 -06:00
Brian Paul
7116ae857c mesa: make some s3tc/fxt1 functions public 2009-09-27 18:08:49 -06:00
Brian Paul
6c6896bd25 progs/tests: disable texturing before printing text 2009-09-27 18:02:02 -06:00
Younes Manton
f547472bfa g3dvl: pipe_video_context interface, softpipe impl, auxiliary libs 2009-09-27 19:49:06 -04:00
Younes Manton
da793b7434 util: Add util_next_power_of_two() for rounding a uint up to a POT. 2009-09-27 19:25:57 -04:00
Brian Paul
0f91e4461f mesa: minor clean-up in _mesa_texstore_srgb8() 2009-09-27 17:07:22 -06:00
Brian Paul
722b761564 mesa: use _mesa_get_texstore_func() to get texture image store func 2009-09-27 17:01:41 -06:00
Maciej Cencora
540039887a r300g: fix erroneous condition 2009-09-27 22:44:29 +02:00
Maciej Cencora
98f6bea168 r300g: don't force vertex position for HW TCL path
It could be generated by vertex shader.
2009-09-27 22:44:28 +02:00
Maciej Cencora
bedc6b7bdf r300g: add some assertions
Not sure why we are getting a shader with two inputs with position semantic, but we don't know how to handle it correctly so it's better to stop the app than lock the machine.
2009-09-27 22:44:28 +02:00
Maciej Cencora
8c8b77a5f3 r300g: plug memory leak 2009-09-27 22:44:27 +02:00
Maciej Cencora
a6eb593072 r300g: add some debugging info 2009-09-27 22:44:27 +02:00
Dave Airlie
d85fe842b8 r300g: fix r300 rs path 2009-09-28 06:42:25 +10:00
Dave Airlie
b1252c7a34 r300g: rewrite RS state setup.
Not 100% sure this is correct, but its more correct than what was here previous
however it may require changes in the input routing for the frag shader.
2009-09-28 06:28:32 +10:00
Dave Airlie
225c3375fd r300g: silence compiler warning 2009-09-28 06:28:31 +10:00
Jakob Bornecrantz
48c45959ee i915g: Submit direct vertex buffers 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
2d71b541d7 i915g: Fix warning 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
973e9a774a i915g: Tile shared buffers as well 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
5aecddc153 i915g: Make sure to map tiled buffers via the gtt 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
60d72d9e45 i915g: Use boolean 2009-09-27 13:19:48 -07:00
Jakob Bornecrantz
c3663bdc35 i915g: Enable reuse of buffers 2009-09-27 13:19:48 -07:00
Jakob Bornecrantz
dd586078be st/egl: Remove buffer from screen
It is no longer needed since the new drm api code,
	and it incorrectly checked if the buffer where there
	for testing completeness when it should have checked
	the texture instead.
2009-09-27 13:19:48 -07:00
Richard Li
eea30906de r600 : Enable draw_prim. 2009-09-27 14:47:12 -04:00
Younes Manton
a77226071f softpipe: Grab a ref when the fb is set.
Nasty bug when the surface is freed and another is allocated right on
top of it. The next time we set the fb state SP thinks it's the same
surface and doesn't flush, and when the flush eventually happens the
surface belongs to a completely different texture.
2009-09-27 10:56:42 -04:00
Jakob Bornecrantz
bcca927562 progs/rbug: Link to math 2009-09-26 12:36:01 -07:00
Brian Paul
485105ed18 mesa: move _mesa_get_texstore_func() to texstore.c 2009-09-26 12:32:13 -06:00
Brian Paul
22108bb571 mesa: begin removing dependencies on gl_texture_format in texstore code 2009-09-26 12:26:18 -06:00
Brian Paul
a7455f9fc6 mesa: added formats.c to build 2009-09-26 12:25:02 -06:00
Brian Paul
9e7b56c980 mesa: include formats.h 2009-09-26 12:24:17 -06:00
Brian Paul
813870fd95 mesa: initial check-in of new formats.[ch] files 2009-09-26 12:21:03 -06:00
Dave Airlie
eb5dd947fb r300g: add tx depth support in register.
also enable cube/3d bits in txformat reg
2009-09-26 19:32:46 +10:00
Dave Airlie
9bf85f6b95 r300g: only pass complete texture state to hw setup function
No point passing things twice here, also allows more state
to be setup properly.
2009-09-26 18:39:54 +10:00
Dave Airlie
ec9c02187e r300g: add missing break in OQ emit 2009-09-26 18:39:54 +10:00
José Fonseca
1df539ce87 llvmpipe: Allow building with LLVM 2.6 too. 2009-09-26 09:37:43 +01:00
Dave Airlie
28f531e3fe r300g: report GL1.5, enable cap bits for OQ and shadow.
Its not like it works well on 1.3 so may as well reach for greater
heights.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-09-26 18:25:00 +10:00
Dave Airlie
20d3c85128 r300g: add z16 unorm texture format 2009-09-26 18:24:34 +10:00
Dave Airlie
07183b73eb r300g: fix texture pitch to correct value.
pitch is pixels - 1, not bytes.
2009-09-26 16:39:13 +10:00
Ian Romanick
8130375e77 Merge branch 'asm-shader-rework-2'
Conflicts:
	src/mesa/shader/program_parse.tab.c
2009-09-25 16:57:38 -07:00
Michel Dänzer
151e0c0aea intel: Handle GL_RGB8 for glCopyTex(Sub)Image.
Avoids an unnecessary fallback.
2009-09-25 21:00:28 +02:00
Michel Dänzer
c19482b16f st/xorg: Re-enable accelerated fills and copies.
These seem to work well enough now with the new code. Composite acceleration
isn't quite there yet and thus remains disabled in xorg_composite_bind_state()
for now.
2009-09-25 20:49:53 +02:00
Michel Dänzer
07e2d6edfa st/xorg: Flush render cache if but only if a source has pending write operations. 2009-09-25 20:49:53 +02:00
Michel Dänzer
626553f327 st/xorg: Reject Composite acceleration for some cases not working yet. 2009-09-25 20:49:53 +02:00
Michel Dänzer
9c449502a2 st/xorg: Make sure struct is fully initialized.
gcc complained about a missing initializer.
2009-09-25 20:49:00 +02:00
Michel Dänzer
b0ddfe8a3d st/xorg: Use generic semantic for Composite mask coordinates. 2009-09-25 20:38:49 +02:00
Michel Dänzer
ac2e0ddcd8 st/xorg: Flesh out EXA PrepareComposite hook a little.
Check that the formats are supported, and don't crash with source-only
pictures.
2009-09-25 20:38:49 +02:00
Michel Dänzer
b97547027e st/xorg: Use I8 format instead of A8 for depth 8 pixmaps.
Seems to work better for Composite acceleration.
2009-09-25 20:38:49 +02:00
Michel Dänzer
67fb13ba68 st/xorg: Bind rasterizer state for copies. 2009-09-25 20:38:49 +02:00
Michel Dänzer
7edda9350a st/xorg: Source-only pictures always have format PICT_a8r8g8b8.
See xserver/render/picture.c:createSourcePicture(). This both simplifies the
code and avoids a crash because pFormat is NULL.
2009-09-25 20:38:49 +02:00
Michel Dänzer
07f107467e st/xorg: Better checks for unsupported component alpha pictures. 2009-09-25 20:38:49 +02:00
Michal Krol
69c7fc128c softpipe: Grab fs output z from the correct file. 2009-09-25 18:52:13 +02:00
Michal Krol
a0fbc01cea softpipe: Do not advertise support for L16 and YCBCR formats. 2009-09-25 18:52:12 +02:00
Michal Krol
02b81187dc radeon: Fix newlines. 2009-09-25 18:51:55 +02:00
Brian Paul
ecf3091cc7 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/dri/intel/intel_clear.c
2009-09-25 09:00:19 -06:00
Vinson Lee
46da1f2c9b mesa: move declaration before code 2009-09-25 08:51:57 -06:00
Christoph Bumiller
5f4f7ad965 nv50: fix TEX for WriteMask not equal 0xf
If you e.g. only need alpha, it ends up in the first reg,
not the last, as it would when reading rgb too.
2009-09-25 11:01:45 +02:00
Christoph Bumiller
513cadf5af nv50: actually enable view volume clipping
Until now, only primitives wholly outside the view volume
were not drawn.
This was only visibile when using a viewport smaller than
the window size, naturally.
2009-09-25 11:01:45 +02:00
Christoph Bumiller
001daf78c8 nv50: RCP and RSQ cannot load from VP inputs 2009-09-25 11:01:45 +02:00
Christoph Bumiller
ef6805710d nv50: fix CEIL and TRUNC
Separated the integer rounding mode flag for cvt.
2009-09-25 11:01:45 +02:00
Christoph Bumiller
e2b8dc3e38 nv50: implement BGNLOOP, BRK, ENDLOOP
There's a good chance a loop won't execute correctly
though since our TEMP allocation assumes programs to
be executed linearly. Will fix later.
2009-09-25 11:01:44 +02:00
Christoph Bumiller
1196f9fbd6 nv50: implement IF, ELSE, ENDIF opcodes 2009-09-25 11:01:44 +02:00
Cooper Yuan
16a6ca9b2b r300g: add texture format for xvmc 2009-09-25 15:15:20 +08:00
Chia-I Wu
5a1e25afac mesa/main: Make FEATURE_convolve follow feature conventions.
As shown in mfeatures.h, this allows users of convolve.h to work without
knowing if the feature is available.
2009-09-24 21:48:39 -06:00
Chia-I Wu
cb4f24e51d mesa/main: Make FEATURE_colortable follow feature conventions.
As shown in mfeatures.h, this allows users of colortab.h to work
without knowing if the feature is available.
2009-09-24 21:48:22 -06:00
Chia-I Wu
dbb8fb8de9 mesa/main: Make FEATURE_pixel_transfer follow feature conventions.
As shown in mfeatures.h, this allows users of pixel.h to work without
knowing if the feature is available.
2009-09-24 21:48:05 -06:00
Chia-I Wu
17099f5e19 mesa/main: Add comments to mfeatures.h.
The comments document the conventions that a feature may follow.
2009-09-24 21:47:45 -06:00
Eric Anholt
126d62edd1 i915: Fix GetBufferSubData in the case of a system-memory BO.
Bug #23760 (crashes in wine)
2009-09-24 20:04:42 -07:00
Brian Paul
c9ddd6f810 progs/perf: glGenerateMipmap() test 2009-09-24 19:38:04 -06:00
Brian Paul
0876618a8d mesa: _mesa_meta_GenerateMipmap() now working
Handles GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP.
But GL_TEXTURE_3D and texture borders not supported yet.
2009-09-24 19:36:20 -06:00
Brian Paul
e33ea11c14 mesa: remove: unused gl_vertex_program::TnlData field 2009-09-24 19:34:19 -06:00
Ian Romanick
09af58d7ed NV fp lexer: Add UP4B and UP4UB instructions that were previously missing 2009-09-24 18:27:20 -07:00
Eric Anholt
cc8084932c intel: Flush the batch when we're about to subdata into a VBO.
This fixes the clears in openarena with the new metaops clear code, and
the new piglit vbo-subdata-sync test.

Bug #23857.
2009-09-24 16:24:46 -07:00
Eric Anholt
54107a0979 i965: Clean up some mess with the batch cache.
Its flagging of extra state that's already flagged by the vtbl new_batch
when appropriate was confusing my tracking down of the OA clear bug.
2009-09-24 16:24:46 -07:00
Zack Rusin
228aa45fcb st/xorg: start working on the Xv acceleration code 2009-09-24 19:20:41 -04:00
Zack Rusin
80965fca74 st/xorg: fills are supported plussome minor clenups 2009-09-24 19:20:41 -04:00
Zack Rusin
53d2fa46e7 st/xorg: add easier way of disabling/enabling acceleration 2009-09-24 19:20:41 -04:00
Brian Paul
01249c6d56 llvmpipe: add missing __FUNCTION__ parameter to debug_printf() calls 2009-09-24 16:08:47 -06:00
Brian Paul
a665a3416e llvmpipe: increase max 3D texture size to 256 2009-09-24 16:07:45 -06:00
Brian Paul
29d27229a9 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/vbo/vbo_exec_array.c
2009-09-24 16:06:21 -06:00
Brian Paul
940ca2e837 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-24 16:01:26 -06:00
Vinson Lee
1730b8db12 softpipe: Increase GL_MAX_3D_TEXTURE_SIZE to 256. 2009-09-24 15:59:57 -06:00
Eric Anholt
726a04a2cd i965: Emit zero initialization for NV VP temporaries as required.
This is similar to what r300 does inside the driver, but I've added it as
a generic option since it seems most hardware will want it.

Fixes piglit nv-init-zero-reg.vpfp and nv-init-zero-addr.vpfp.
2009-09-24 13:34:06 -07:00
Eric Anholt
a9a47afe7e i965: Remove assert about NV_vp now that it somewhat works. 2009-09-24 13:34:06 -07:00
Eric Anholt
9018a7dd17 i965: Load NV program matrices when required. 2009-09-24 13:34:06 -07:00
Eric Anholt
601769a2c0 mesa: Initialize NV_vertex_program fields for the parameter lists and such.
This helps let drivers treat NV_vp like ARB_vp.
2009-09-24 13:34:06 -07:00
Brian Paul
60b152a1b3 mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/warning
At the time of the enable there may not be a Z buffer, but one
may be attached to the FBO later.
2009-09-24 14:24:14 -06:00
Brian Paul
adfa778c8e mesa: remove rgbMode check in enable_texture()
If the currently bound FBO isn't yet validated it's possible for
rgbMode to be zero so we'll lose the texture enable.
This could fix some FBO rendering glitches, but I don't know of
any specific instances.
2009-09-24 14:19:06 -06:00
Brian Paul
b849c6f1b3 intel: use default array/element buffers in intel_generate_mipmap()
If there happened to be a bound VBO when intel_generate_mipmap() was
called we blew up because of a bad vertex array pointer.

Fixes regnumonline, bug 23859.
2009-09-24 12:41:14 -06:00
Brian Paul
f0339f502c mesa: replace assertion with no-op function assignment 2009-09-24 12:37:34 -06:00
Brian Paul
964792b025 mesa: added comment 2009-09-24 12:37:06 -06:00
Brian Paul
1a81611725 vbo: limit number of warnings to 10
Otherwise some apps will emit tons of warnings.
2009-09-24 12:36:05 -06:00
Pauli Nieminen
fd56bee6c4 Merge branch 'mesa_7_6_branch' 2009-09-24 20:39:16 +03:00
Pauli Nieminen
1d2dca194c radeon: Fix scissors for r600 KMS.
Radeon generic scissors code had problem that some of code was using exclusive
and some inclusive bottom right corner. Only r600 driver is using exclusive
coordinate so changed generic code to pass inclusive coordinate and r600 driver
changes BR coordinate to be exclusive.
2009-09-24 20:37:55 +03:00
Brian Paul
c9f7a23ef0 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/dri/r600/r700_assembler.c
	src/mesa/drivers/dri/r600/r700_chip.c
	src/mesa/drivers/dri/r600/r700_render.c
	src/mesa/drivers/dri/r600/r700_vertprog.c
	src/mesa/drivers/dri/r600/r700_vertprog.h
	src/mesa/drivers/dri/radeon/radeon_span.c
2009-09-24 11:03:16 -06:00
Brian Paul
7549a8397b Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-24 10:52:15 -06:00
Brian Paul
6be2bc56af gallium/trace: casts to silence warnings 2009-09-24 10:47:42 -06:00
Brian Paul
f85816354c tgsi/sse: remove old comments 2009-09-24 10:45:36 -06:00
Brian Paul
35cd0bbfb1 tgsi/sse: implement SEQ, SGT, SLE, SNE 2009-09-24 10:45:35 -06:00
Brian Paul
a64d4516a0 tgsi/sse: Pass the lodbias, not zero. More comments.
This fixes the glean/glsl1 "texture2D(), with bias" test when using SSE.
2009-09-24 10:28:09 -06:00
Brian Paul
a491e25b1f mesa: added default case return to silence warning 2009-09-24 10:28:09 -06:00
Brian Paul
00ddd4f9e9 glsl: init var to silence warning 2009-09-24 10:28:09 -06:00
Brian Paul
e44c084be5 glsl: fix missing initializers warning 2009-09-24 10:28:09 -06:00
Keith Whitwell
09a23ac3c1 progs/perf: fix warnings in readpixels test 2009-09-24 16:52:14 +01:00
Keith Whitwell
d93f022936 progs/perf: fix typo in sconscript 2009-09-24 16:50:27 +01:00
Keith Whitwell
90dcfb3b47 trace: fix printf warnings 2009-09-24 16:49:40 +01:00
Keith Whitwell
d3beaf2f32 softpipe: fix compiler warnings 2009-09-24 16:49:27 +01:00
Keith Whitwell
fca7f38441 pipebuffer: fix printf warnings 2009-09-24 16:49:05 +01:00
Keith Whitwell
0c55dd8094 pipebuffer: fix warnings 2009-09-24 16:48:49 +01:00
Keith Whitwell
cd362334ad draw: fix warning 2009-09-24 16:44:58 +01:00
Keith Whitwell
6e0b56edf8 progs/perf: accept GL3.x also 2009-09-24 16:43:15 +01:00
Richard Li
5f06064b61 r600 : fix draw_prim bug: vertex fetcher setting. 2009-09-24 11:29:44 -04:00
José Fonseca
9659aa6482 softpipe: Use portable INLINE macro. 2009-09-24 15:28:55 +01:00
José Fonseca
e8e6d8853d softpipe: Update SConscript. 2009-09-24 15:28:54 +01:00
Richard Li
41c5f113b5 r600 : disable draw_prim for now. 2009-09-24 10:15:19 -04:00
Andre Maasikas
2058dfaa47 r600: add support for CUBE textures, also TXP
seems to work here ...
2009-09-24 10:03:37 -04:00
Alex Deucher
639fb1472d r600: fix typo in the last commit
128 gprs, 256 reg-based consts
2009-09-24 10:03:22 -04:00
Alex Deucher
28308c9260 r600: various cleanups
- max texture size is 8k, but mesa doesn't support
that at the moment.
- attempt to set shader limits to what the hw actually
supports
- clean up some old r300 cruft
- no need to explicitly disable irqs.  This is fixed
in the drm now.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-09-24 10:03:08 -04:00
Andre Maasikas
ed91d10347 r600: fix some issues with LIT instruction
- MUL_LIT is ALU.Trans instruction
- some Trans instructions can take 3 arguments
- don't clobber dst.x, use dst.z as temp, it'll get written correct
  value in last insn
- respect source swizzles
2009-09-24 10:02:37 -04:00
Alex Deucher
48559c7605 r600: fix point sizes
registers takes radius
2009-09-24 10:02:22 -04:00
Alex Deucher
095db818c6 r600: fix polygon offset 2009-09-24 10:02:08 -04:00
Alex Deucher
ec14d59afa radeon: don't build non-r600 span code on r600 2009-09-24 10:01:56 -04:00
Alex Deucher
dbec27be85 r600: minor span cleanups 2009-09-24 10:01:41 -04:00
Andre Maasikas
2cd2dc34ac r600: support position_invariant programs 2009-09-24 10:00:58 -04:00
Alex Deucher
9437ac9bcc r600: add span support for 1D tiles
1D tile span support for depth/stencil/color/textures

Z and stencil buffers are always tiled, so this fixes
sw access to Z and stencil buffers.  color and textures
are currently linear, but this adds span support when we
implement 1D tiling.

This fixes the text in progs/demos/engine and progs/tests/z*
2009-09-24 09:59:45 -04:00
Alex Deucher
93a7ea6ba0 r600: fix warning
Noticed by rnoland on IRC.
2009-09-24 09:59:32 -04:00
Andre Maasikas
7f5a958c80 r600: fix texcoords from constants
with some minor updates from Richard.
2009-09-24 09:59:15 -04:00
Andre Maasikas
9edd1a441c r600: enable caching of vertex programs 2009-09-24 09:59:00 -04:00
Alex Deucher
6552a103f9 r600: check if textures are actually enabled before submission
noticed by taiu on IRC.
2009-09-24 09:58:36 -04:00
Alex Deucher
65b01d449c r600: fix ftp for dri1
We use t->bo for dri1 since r600 uses CS for dri1.
2009-09-24 09:58:17 -04:00
Dave Airlie
b1e417413f r600: don't setup hardware state if TFP
if we have a BO here it means TFP and we should have set it
up already.

tested by b0le on #radeon
2009-09-24 09:57:45 -04:00
Alex Deucher
cbab3d7f2a r600: fix dri2 clipping 2009-09-24 09:56:18 -04:00
José Fonseca
86962d6f6e gdi: Update for WGL state tracker interface changes. 2009-09-24 13:12:51 +01:00
José Fonseca
4e5ed05b02 wgl: DWM integration. 2009-09-24 13:12:51 +01:00
José Fonseca
9ea277ba7a scons: Don't require -liberty on MinGW.
Not always present.
2009-09-24 13:12:50 +01:00
José Fonseca
622bdecabd mesa: Fix missing finite symbol error on Windows.
Caused by some weird logic regarding the __WIN32__ define which made
the finite definition dependent on the header include order.
2009-09-24 13:12:50 +01:00
Alex Deucher
1bf0651d9b r600: fix up ordering of functions in draw prims path
Shaders and IB need to be updated and allocated before
calling validatebuffers.
2009-09-23 19:42:07 -04:00
Maciej Cencora
84c7afd9e0 r300: fallback to software rendering if we are out of free texcoords
Fixes #22741
2009-09-23 23:22:33 +02:00
Alex Deucher
20e7738293 r600: fix r700PredictRenderSize for draw prims path 2009-09-23 16:54:12 -04:00
Richard Li
8a2b0f6415 r600 : add hw index buffer draw support. 2009-09-23 16:16:11 -04:00
Brian Paul
fa0816b17c progs/perf: added glReadPixels benchmark 2009-09-23 14:05:05 -06:00
Brian Paul
489f8bc86f progs/perf: also request a stencil buffer 2009-09-23 14:05:05 -06:00
Brian Paul
2acd5de226 swrast: add lod bias when texture sampling
Mostly fixes progs/demos/lodbias when MESA_TEX_PROG=1.  But the LOD still
seems off by -1 or so.
May be an issue with the params passed to _swrast_compute_lambda()
2009-09-23 13:36:44 -06:00
Brian Paul
890f37d4d9 mesa: don't bias LOD in shader interpreter; do it in swrast 2009-09-23 13:36:44 -06:00
Brian Paul
ad935c3f47 swrast: fix typo in partial derivatives parameter passing 2009-09-23 13:36:43 -06:00
Adam Jackson
8abe77a75a Finish removing glcore 2009-09-23 15:22:19 -04:00
Alex Deucher
53051b8cb5 r600: fix copy/paste typo 2009-09-23 15:02:19 -04:00
Alex Deucher
ec205bbd57 r600: fix some warnings 2009-09-23 14:58:46 -04:00
Andre Maasikas
2d2f49c919 r600: add support for CUBE textures, also TXP
seems to work here ...
2009-09-23 14:58:46 -04:00
Michal Krol
a0549f6634 progs/perf: Actually bind the newly created vbo. 2009-09-23 20:24:35 +02:00
Keith Whitwell
be66ff51ec st/mesa: trim calculated userbuffer size
In get_array_bounds we were previously defining a user buffer sized as
(nr_vertices * stride).  The trouble is that if the vertex data
occupies less than stride bytes, the extra tailing (stride - size)
bytes may extend outside the memory actually allocated by the app and
caused a segfault.

To fix this, define a the buffer bounds to be:

   ptr .. ptr + (nr-1)*stride + element_size
2009-09-23 18:55:46 +01:00
Brian Paul
35af3f94a3 llvmpipe: move tile cache datatypes into .c file since they're private 2009-09-23 11:53:12 -06:00
Brian Paul
b4a40d1052 softpipe: replace macros with inline functions
And update comments.
2009-09-23 11:51:52 -06:00
Brian Paul
e2329f2795 softpipe: white-space/formatting fixes and updated comments 2009-09-23 11:35:33 -06:00
Brian Paul
5244ce786a llvmpipe: added max texture/surface size sanity check
Carried over from softpipe driver.
2009-09-23 11:05:00 -06:00
Brian Paul
b26f1df920 llvmpipe: increase MAX_WIDTH/HEIGHT to match max texture size 2009-09-23 11:04:07 -06:00
Brian Paul
de25f82067 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-09-23 11:00:04 -06:00
Brian Paul
e41707beca softpipe: added max texture/surface size sanity check 2009-09-23 10:50:38 -06:00
Brian Paul
84b956c29b softpipe: increase MAX_WIDTH/HEIGTH 4096 to match max texture size 2009-09-23 10:46:27 -06:00
Keith Whitwell
890679d432 Merge branch 'softpipe-opt'
Conflicts:
	progs/demos/cubemap.c
	src/gallium/drivers/softpipe/sp_tex_sample.c
	src/gallium/drivers/softpipe/sp_texture.c
2009-09-23 17:37:28 +01:00
Keith Whitwell
a1fa770c01 gallium/include: update some comments 2009-09-23 17:04:48 +01:00
Zack Rusin
1ddb217d8e st/xorg: fix a typo
it'd be too easy, eh
2009-09-23 12:05:13 -04:00
Zack Rusin
5a7f708530 st/xorg: keep the user buffer contents around
Michel noticed that they were getting out of scope
2009-09-23 12:03:35 -04:00
Brian Paul
aae77319c0 progs/perf: set TexSubImage4=FALSE 2009-09-23 08:06:37 -06:00
José Fonseca
31f1571d1f wgl: Eliminate the shared layer; implement WGL API on top of the ICD callbacks.
While the WGL API has been stale for decades now, the ICD interface has
been updated with new Windows versions, so it is much easier to define
everything in terms of the ICD interfaces, which is pretty much what
Microsoft's opengl32.dll does anyway.
2009-09-23 10:32:52 +01:00
José Fonseca
f8c11526c0 gdi: Update for WGL statetracker source reorg. 2009-09-23 10:32:51 +01:00
José Fonseca
f724036f00 wgl: Flatten the source tree.
It is easier to have the WGL API on top of the ICD callbacks as
Microsoft's own implementation does, than to have a seperate shared
entity. This source reorganization is in antecipation of that.
2009-09-23 10:32:51 +01:00
José Fonseca
8d1af5991d wgl: Fix debug_printf format specifiers. 2009-09-23 10:32:51 +01:00
José Fonseca
21a949365d gallium: Update vendor string. 2009-09-23 10:32:50 +01:00
root
75276ea316 softpipe: fix bugs in POT texture sampling when texture is not square
Before, if level was greater than the logbase2(base size) we were
doing a negative bit shift and winding up with garbage values.
2009-09-22 20:14:10 -06:00
Brian Paul
5dbedf3d7e softpipe: additional assertions 2009-09-22 16:59:28 -06:00
Brian Paul
0670df5cb2 softpipe: disable a _debug_printf() 2009-09-22 16:42:15 -06:00
Brian Paul
02f2bcdf1d Merge branch 'mesa_7_6_branch' 2009-09-22 16:06:18 -06:00
Brian Paul
926b965ed5 mesa: don't re-use the meta glDrawPixels VBO; create a new one each time
This should help to work around bugs 24083 and 23670.
2009-09-22 15:58:49 -06:00
Brian Paul
d04fa73cec progs/perf: added glCopyTex[Sub]Image2D test 2009-09-22 15:39:05 -06:00
Richard Li
98d5ec10d0 r600 : add draw_prim support, make up one lost change. 2009-09-22 17:26:23 -04:00
Richard Li
81283b0bf0 r600 : add draw_prim support. 2009-09-22 17:04:49 -04:00
Brian Paul
f338de4018 mesa: fix more buffer object error messages 2009-09-22 13:47:49 -06:00
Keith Whitwell
fe9ca0f718 softpipe: need to write depth/stencil values even when stencil fails 2009-09-22 20:47:37 +01:00
Keith Whitwell
207764894b softpipe: set quad->facing value 2009-09-22 20:47:07 +01:00
Brian Paul
ba002eb196 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Conflicts:

	src/mesa/main/bufferobj.c
2009-09-22 13:44:43 -06:00
Brian Paul
bc75464760 glx: include string.h to silence missing memset() prototype warning 2009-09-22 13:19:15 -06:00
Brian Paul
52cadf7592 mesa: fix error message text 2009-09-22 13:19:11 -06:00
Nicolai Hähnle
8cc12ffb34 r300: Fix crash reported in bug #24066
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-22 21:00:01 +02:00
Keith Whitwell
b1139e9ad8 softpipe: fix polygon stipple 2009-09-22 19:38:34 +01:00
Brian Paul
da0e4e557b progs/perf: test glGetTexImage() also 2009-09-22 12:26:12 -06:00
Keith Whitwell
b626176f06 softpipe: fix occlusion counting 2009-09-22 19:26:08 +01:00
Jakob Bornecrantz
bade906ed1 st/xorg: Fix two leeks
We where leaking both surfaces in the composit code
	and textures from pixmaps.
2009-09-22 11:06:57 -07:00
Jakob Bornecrantz
19798e17fe i915g: Activate trace 2009-09-22 11:06:57 -07:00
Jakob Bornecrantz
e369294f76 i915g: Do propper references of surfaces in context 2009-09-22 11:06:56 -07:00
Brian Paul
67d7021ae0 progs/perf: add missing texture enable in fbobind.c 2009-09-22 11:15:11 -06:00
Brian Paul
ed113da12e progs/perf: added fbobind.c test to test FBO binding speed 2009-09-22 11:15:11 -06:00
Brian Paul
cfb0f2489d progs/perf: added PerfExtensionSupported() helper 2009-09-22 11:15:11 -06:00
Keith Whitwell
0ec26cce36 teximage: add more tests, image formats
Add a test which creates a new texture from scratch before uploading.
Add more image formats.
Don't run all tests on all image formats.
2009-09-22 18:00:11 +01:00
Brian Paul
bae2d58827 progs/perf: add another VBO test for Create/Draw/Destroy pattern
Report both MB/sec and draw/sec.
2009-09-22 09:53:35 -06:00
Brian Paul
7e5004b298 progs/perf: simplify the code 2009-09-22 09:43:08 -06:00
Brian Paul
aa80851e16 progs/perf: fix comment 2009-09-22 09:29:27 -06:00
Brian Paul
32979ae15f progs/perf: updated comments 2009-09-22 07:50:12 -06:00
Keith Whitwell
6a09c9d2d8 progs/perf: make teximage results easier to read, more reproducible
Always run the same tests on different drivers, give zero results
where test image is too big for driver.

Add a newline between groups of tests.
2009-09-22 12:35:56 +01:00
Keith Whitwell
89f2799dac progs/perf: reset row_length after subimage test
Also test fewer sizes in teximage generally.
2009-09-22 11:58:09 +01:00
Keith Whitwell
bf014d03fe progs/perf: clean up swapbuffers test a bit 2009-09-22 11:27:18 +01:00
Keith Whitwell
ac6a5107e2 progs/perf: break up long runs of fullscreen quads
Not all drivers cope gracefully with command-buffers with zillions of
fullscreen quads.
2009-09-22 11:21:10 +01:00
Keith Whitwell
a7b2659f02 progs/perf: add first attempt at a swapbuffers rate test
This is pretty ugly as the original framework assumed you'd set
a single window size at startup and keep it throughout, but for
swapbuffers you want to test the rate at various window sizes.

With luck a nicer solution can be found, but this at least lays out
a marker.
2009-09-22 11:21:09 +01:00
Brian Paul
94a020cfe6 vbo: added comment about max array index 2009-09-21 16:54:35 -06:00
Brian Paul
9a3333f436 vbo: restore some lost warning output 2009-09-21 16:51:34 -06:00
Tormod Volden
e857303305 GLX: Warn only once about applications calling GLX 1.3 functions
The warnings introduced in 1f309c40b8
would pour out generously from some applications. This patch adds a
"warn once" wrapper macro, heavily inspired by
src/mesa/drivers/dri/r600/radeon_debug.h

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-09-21 15:29:52 -07:00
Brian Paul
972e995b14 vbo: disable the GL_ARB_draw_elements_base_vertex rebase path
This was introduced with commit 92d7ed8a20.
It causes rendering of stray polygons (with sw rendering at least) when
running the OGL Distilled / Picking demo (click on an object).

This needs additional debugging to fix/restore.

Found one suspect thing: in _tnl_draw_prims() there's some mixed signed/
unsigned arithmetic/comparing at line 422 that may be incorrect.
2009-09-21 16:10:50 -06:00
Adam Jackson
83019ffc07 selinux: Fix mmap() return value check 2009-09-21 17:04:22 -04:00
Brian Paul
40603526f4 mesa: refine the error checking vbo_exec_DrawRangeElements()
If the 'end' index is out of bounds issue a warning as before.  But instead
of just no-op'ing the draw call, examine the actual array indices to see
if they're OK.  If the max array index is out of bounds, issue another
warning and no-op the draw call.  Otherwise, draw normally.  This is a
debug build-only feature since it could impact performance.

This "fixes" the missing torus in the OGL Distilled / Picking demo.
2009-09-21 14:56:58 -06:00
Brian Paul
e5d29ebb5e mesa: make max_buffer_index() a non-static function 2009-09-21 14:56:40 -06:00
Maciej Cencora
4916a5a2e7 radeon: update buffer map/unmap code for changes introduced in 92033a9516 and 822c796481 2009-09-21 14:56:11 -06:00
Maciej Cencora
d100cbf721 mesa: add some debug info to teximage.c 2009-09-21 14:56:11 -06:00
Maciej Cencora
b1c9c5a800 r300: fix a typo 2009-09-21 14:56:11 -06:00
Brian Paul
d504a7669d swrast: fix cube face selection
If arx and ary are equal, we still want to choose from one of them,
and not arz.

This is the same as Michal's softpipe fix.
2009-09-21 14:56:10 -06:00
Brian Paul
6559eaef59 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-21 14:49:46 -06:00
Alex Deucher
c63e78b3e5 r600: fix typo in the last commit
128 gprs, 256 reg-based consts
2009-09-21 16:48:55 -04:00
Alex Deucher
1869bdabba r600: various cleanups
- max texture size is 8k, but mesa doesn't support
that at the moment.
- attempt to set shader limits to what the hw actually
supports
- clean up some old r300 cruft
- no need to explicitly disable irqs.  This is fixed
in the drm now.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-09-21 16:33:11 -04:00
Brian Paul
2655d43756 mesa: refine the error checking vbo_exec_DrawRangeElements()
If the 'end' index is out of bounds issue a warning as before.  But instead
of just no-op'ing the draw call, examine the actual array indices to see
if they're OK.  If the max array index is out of bounds, issue another
warning and no-op the draw call.  Otherwise, draw normally.  This is a
debug build-only feature since it could impact performance.

This "fixes" the missing torus in the OGL Distilled / Picking demo.
2009-09-21 14:25:39 -06:00
Brian Paul
44d260329e mesa: make max_buffer_index() a non-static function 2009-09-21 14:25:39 -06:00
Maciej Cencora
ff5535c521 radeon: update buffer map/unmap code for changes introduced in 92033a9516 and 822c796481 2009-09-21 21:13:01 +02:00
Maciej Cencora
db928a5e91 mesa: add some debug info to teximage.c 2009-09-21 21:12:55 +02:00
Maciej Cencora
ab4ec85f6c r300: fix a typo 2009-09-21 21:12:31 +02:00
José Fonseca
734a498ed4 mesa: Ensure TGSI tokens are freed with gallium's free.
To avoid breaking the gallium's builtin malloc debugging.
2009-09-21 20:12:03 +01:00
Brian Paul
9297e6968a progs/perf: added fill-rate test
Many more fill modes could be tested, but this hits the basics including
blending, texturing and shaders.
2009-09-21 12:17:49 -06:00
Brian Paul
05bce08980 progs/perf: added helpers for creating simple textures and shader programs 2009-09-21 11:58:03 -06:00
Brian Paul
83fbee6e0b progs/perf: offsetof() should be defined in stddef.h, include it
If this breaks mingw, feel free to revert this.
2009-09-21 11:09:47 -06:00
Eric Anholt
2b83483fb4 intel: Mark the FBO as incomplete if there's no intel_renderbuffer for it.
This happens to rendering with textures with a border, which had resulted
in a segfault on dereferencing the irb.

(cherry-picked from commit 8bba183b9e)
2009-09-21 10:02:38 -06:00
Nicolai Hähnle
9ca94f91a3 r300g: Fix bad formatting parameters in calls to debug_printf
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-21 17:41:54 +02:00
Nicolai Hähnle
496137d8eb gallium debug: Add gcc printf hint to debug_printf
This causes gcc to issue warnings when format parameters do not match up
with the format string in calls to debug_printf.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-21 17:41:54 +02:00
Keith Whitwell
7ce0421fb7 progs/perf: a few more vbo upload modes
Some tests, eg small SubData are probably overwhelmed by the cost of
performing the draw after each upload.  Add a varient which does a lot
of subdata uploads and then a single draw.

Also try to avoid cache-artifacts in the upload timings.
2009-09-21 15:57:14 +01:00
Keith Whitwell
25a580c841 progs/perf: human-readable drawoverhead output 2009-09-21 15:57:14 +01:00
Keith Whitwell
6ab7c127f7 progs/perf: human-format vertexrate output 2009-09-21 15:57:14 +01:00
Keith Whitwell
ed63bd62d8 progs/perf: add human-readable float formatter 2009-09-21 15:57:13 +01:00
Vinson Lee
d17af7d1e1 progs/glsl: Include local headers before installed headers during compilation.
Fixes compilation errors on platforms with insufficient older installed
GL headers.
2009-09-21 08:44:56 -06:00
Brian Paul
5a0b29050f softpipe: Fix cube face selection.
If arx and ary are equal, we still want to choose from one of them,
and not arz.

(cherry picked from commit de685b37a9)
2009-09-21 08:36:05 -06:00
Brian Paul
077e3de989 swrast: fix cube face selection
If arx and ary are equal, we still want to choose from one of them,
and not arz.

This is the same as Michal's softpipe fix.
2009-09-21 08:36:05 -06:00
Andre Maasikas
2d729e6e3b r600: fix some issues with LIT instruction
- MUL_LIT is ALU.Trans instruction
- some Trans instructions can take 3 arguments
- don't clobber dst.x, use dst.z as temp, it'll get written correct
  value in last insn
- respect source swizzles
2009-09-21 10:14:25 -04:00
Nicolai Hähnle
81c7561d9d Merge branch 'master' into r300-compiler
There were additional non-textual conflicts.

Conflicts:
	src/gallium/drivers/r300/r300_tgsi_to_rc.c
	src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
	src/mesa/drivers/dri/r300/compiler/radeon_program.c
	src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
2009-09-21 13:26:50 +02:00
Nicolai Hähnle
3083ba38f4 Merge branch 'mesa_7_6_branch' 2009-09-21 13:08:34 +02:00
Nicolai Hähnle
526430ade1 r300: Zero-initialize register for NV_vertex_program
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-21 12:56:16 +02:00
Nicolai Hähnle
736e1ae42f r300: Fix handling of NV_vertex_program parameters
The handling is a bit inefficient, unfortunately, but I don't want to make
any intrusive changes for Mesa 7.6.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-21 12:56:16 +02:00
Michel Dänzer
c67bb22fe7 Merge branch 'mesa_7_6_branch' 2009-09-21 10:48:32 +02:00
Michel Dänzer
1d4dbd8d9b Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-21 10:39:20 +02:00
Michel Dänzer
999592745f intel: Fix crash in intel_flush().
Since commit 2921a2555d ('intel: Deassociated
drawables from private context struct in intelUnbindContext'),
intel->driDrawable may be NULL in intel_flush().
2009-09-21 10:28:37 +02:00
Ben Skeggs
774db70506 nouveau: allow building modesetting_drv.so 2009-09-21 14:51:39 +10:00
Ben Skeggs
344e2fd1f2 nouveau: drm_api create_screen()'s 'arg' argument can be NULL 2009-09-21 14:46:50 +10:00
Brian Paul
e3384a0d53 windows: call _mesa_meta_init/free() 2009-09-20 22:19:28 -06:00
Brian Paul
2c1937480a xlib: always call _mesa_meta_init/free() 2009-09-20 22:19:06 -06:00
Brian Paul
4a4914e414 dri/swrast: call _mesa_meta_init/free() 2009-09-20 22:13:28 -06:00
Brian Paul
1741bc1a79 osmesa: call _mesa_meta_init/free() 2009-09-20 22:13:09 -06:00
Brian Paul
a1cf9b6abe Revert "st/mesa: Compile in meta.c."
This reverts commit 6c5726cd39.
2009-09-20 22:08:30 -06:00
Brian Paul
1eda10d073 Revert "scons: add meta.c to sources"
This reverts commit 41fefe88c5.
2009-09-20 22:08:21 -06:00
Brian Paul
da9d8f1924 Revert "mesa: move _mesa_meta_init/free() calls to core Mesa"
This reverts commit 651cffd626.

The commit inadvertantly introduced a new gallium dependency on the meta code.
2009-09-20 22:06:03 -06:00
Brian Paul
41fefe88c5 scons: add meta.c to sources 2009-09-20 21:31:45 -06:00
Chia-I Wu
6c5726cd39 st/mesa: Compile in meta.c.
meta was moved to core Mesa since
651cffd626.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-20 21:31:45 -06:00
Chia-I Wu
81bac6e2a8 intel: meta clear has a new name.
It was renamed to _mesa_meta_Clear.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-20 21:31:45 -06:00
Dave Airlie
e9d6ab72be xorg/st: fixup builds against later dpms headers. 2009-09-21 13:26:48 +10:00
Pauli Nieminen
284a7af274 radeon: Fix legacy bo not to reuse dma buffers before refcount is 1.
This should help detecting possible memory leaks with dma buffers and prevent
possible visual corruption if data would be overwriten too early.
2009-09-20 22:28:52 +03:00
Nicolai Hähnle
7e3b8b0d8f r300/compiler: Fix trig instructions in R300 fp
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-20 20:43:32 +02:00
Pauli Nieminen
3640e4acde radeon: Fix typo in variable name. 2009-09-20 21:08:42 +03:00
Pauli Nieminen
5fa9a7a9a9 radeon: Improve WARN_ONCE macro to appear as single statement.
Do-while makes macro safe to be used with if and for constructions.

Also remove __LINE__ macro from variable name because scope is local to macro anyway.
2009-09-20 20:15:52 +03:00
José Fonseca
1a9eec84bd scons: Drop gprof support for profile builds; tweak optimization flags instead.
gprof is useful for shared libraries, hence our drivers. Nevertheless
profilers like oprofile can benefit from disabling some relatively
minor optimizations for more accurate / complete results.
2009-09-20 18:09:34 +01:00
José Fonseca
911a7a82cd llvmpipe: Fix lp_get_cached_tile.
Align coordinates to tile boundaries.
2009-09-20 18:09:34 +01:00
José Fonseca
76c2e34b22 llvmpipe: Update tile status on flush. 2009-09-20 18:09:34 +01:00
Nicolai Hähnle
94a3c5979f radeon: Fix "verts" debugging enable
Copy'n'paste apparently prevented the RADEON_VERTS flag from being enabled.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-20 18:45:32 +02:00
Brian Paul
ebf2710b2f Merge branch 'mesa_7_6_branch'
Conflicts:
	src/mesa/drivers/dri/intel/intel_clear.c
2009-09-20 10:36:45 -06:00
Nicolai Hähnle
82c2f7756a Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-20 16:59:03 +02:00
Nicolai Hähnle
e617dd14ab mesa/st: Create front renderbuffer on the fly when supplied with a surface
Normally, the mesa/st would create a fake front buffer out of a
client-allocated surface.

In the DRI setting, however, st/dri provides a front buffer surface which is
created and maintained by the X server. Prefer to use this surface instead,
so that front buffer rendering and reading works correctly.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-20 16:58:53 +02:00
Nicolai Hähnle
c4ce6f6a7c mesa/st: Initialize format bits of framebuffer renderbuffers
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-20 16:54:40 +02:00
Nicolai Hähnle
c8c5de9e9a docs: Document new features in radeon/r200/r300 drivers
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-20 16:47:40 +02:00
Nicolai Hähnle
6c323a2473 r300/compiler: Fix R300 fragment program regression introduced by 0723cd1...
We obviously need to move the code addr register backwards because their may
be overlap.

This bug affected in particular the Compiz water plugin.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-20 16:34:47 +02:00
Brian Paul
ed4076b5b8 mesa: remove redundant readbuffer check 2009-09-19 17:26:14 -06:00
Brian Paul
4de8e2123e mesa: rename functions to be more consistant with rest of mesa 2009-09-19 17:06:15 -06:00
Brian Paul
232fc7d333 swrast: remove obsolete s_imaging.c file 2009-09-19 16:43:18 -06:00
Brian Paul
7e0f2ce941 swrast: remove prototypes for obsolete functions 2009-09-19 16:43:17 -06:00
Brian Paul
58e843dda0 mesa: remove s_imaging.c from build 2009-09-19 16:43:17 -06:00
Brian Paul
32e4b6c607 windows: replace old ColorTable, Convolution functions with new 2009-09-19 16:43:17 -06:00
Brian Paul
bc1c8d4af7 mesa: use new meta functions 2009-09-19 16:43:17 -06:00
Brian Paul
3e5a35269b mesa: meta functions for glCopyColorTable, glCopyConvolutionFilter, etc 2009-09-19 16:43:17 -06:00
Brian Paul
dc3839ef3d mesa: move readbuffer tests 2009-09-19 16:43:17 -06:00
Brian Paul
883dd9d770 mesa: use _mesa_get_current_tex_unit() helper 2009-09-19 16:43:17 -06:00
Brian Paul
3ed9dab19c mesa: use _mesa_get_current_tex_unit() helper 2009-09-19 16:43:16 -06:00
Brian Paul
b0e9ea6084 mesa: fix some glCopyTex[Sub]Image regressions related to convolution 2009-09-19 16:43:16 -06:00
Brian Paul
651cffd626 mesa: move _mesa_meta_init/free() calls to core Mesa 2009-09-19 16:43:16 -06:00
Alex Deucher
b8477f079b r600: fix point sizes
registers takes radius
2009-09-19 15:18:42 -04:00
Alex Deucher
368fb578f8 r600: fix polygon offset 2009-09-19 14:48:44 -04:00
Brian Paul
67cad78e08 swrast: remove obsolete s_texstore.c
Replaced by new, simpler meta functions.
2009-09-19 11:09:25 -06:00
Brian Paul
2f89044e6f swrast: remove prototypes for obsolete functions 2009-09-19 11:08:49 -06:00
Brian Paul
14869c0984 mesa: remove s_texstore.c from makefile/project files 2009-09-19 11:08:20 -06:00
Brian Paul
a9c64daf02 glapi: replace old TexCopy functions w/ new 2009-09-19 11:05:54 -06:00
Brian Paul
41a171b714 windows: replace old TexCopy functions w/ new 2009-09-19 11:03:33 -06:00
Brian Paul
e2e0735e0e gldirect: remove refs to soon-to-be-obsolete functions
I don't know if this driver is anywhere near build-able, but anyway.
2009-09-19 11:01:27 -06:00
Brian Paul
6f9dbe7739 mesa: use new _mesa_meta_CopyTex[Sub]Image() functions 2009-09-19 10:58:11 -06:00
Brian Paul
af69346446 intel: use new _mesa_meta_CopyTex[Sub]Image() functions 2009-09-19 10:58:07 -06:00
Brian Paul
22f02509f2 glapi: regenerated files 2009-09-19 10:00:55 -06:00
Brian Paul
c9a87ff441 glapi: added tokens, function for GL_ARB_provoking_vertex 2009-09-19 10:00:19 -06:00
Michal Krol
18d0f9a7a3 llvmpipe: Respect input interpolators for the shader.
Cherry-picked from fb2c7b6743
2009-09-19 14:57:24 +01:00
José Fonseca
fdd605e446 mesa: Allow BlitFramebuffer from a texture.
Although GL_EXT_framebuffer_blit does not mention textures, it doesn't
forbid them either, and some thirdparty driver appear to support this.
2009-09-19 14:33:35 +01:00
Michal Krol
de685b37a9 softpipe: Fix cube face selection.
If arx and ary are equal, we still want to choose from one of them,
and not arz.
2009-09-18 14:36:59 +01:00
Zou Nan hai
1e4c353511 [i965] add a missing header file 2009-09-18 16:04:41 +08:00
Zou Nan hai
a66bab0e37 [i965] use intel_batchbuffer_flush to flush the clear 2009-09-18 13:29:28 +08:00
Michal Krol
fb2c7b6743 softpipe: Respect input interpolators for the shader. 2009-09-17 16:06:11 +01:00
Michal Krol
5f0b49e7a9 tgsi: Scan input interpolators, too. 2009-09-17 16:06:09 +01:00
Keith Whitwell
2884c31d94 progs/perf: convert some DOS line-endings
It seems like some of these files were committed with CRLF initially.
2009-09-17 12:09:16 +01:00
Keith Whitwell
e95a3a23dc progs/perf: add scons support, get working under mingw 2009-09-17 12:08:04 +01:00
Brian Paul
21caa29fbd mesa: begin some texstore code refactoring
Next step will be to move the calls to ctx->Driver.ChooseTextureFormat()
into the teximage.c functions so drivers don't have to do it.
2009-09-16 21:50:04 -06:00
Brian Paul
fac38e8c8f mesa: fix clip plane, fog issues 2009-09-16 21:22:02 -06:00
Brian Paul
1d8fbef4f2 mesa: meta driver functions for glCopyTex[Sub]Image()
Implement in terms of glReadPixels + glTex[Sub]Image().
This will allow us to get rid of some swrast texture code.
2009-09-16 20:09:07 -06:00
Brian Paul
9abbedad09 progs/perf: initial set of simple performance test programs
Initial tests include:
  drawoverhead - measure overhead of state changes w.r.t drawing commands
  teximage - measure glTexImage2D() and glTexSubImage2D() speed
  vbo - measure glBufferData() and glBufferSubData() speed
  vertexrate - measure vertex rate for immediate mode, glDrawArrays, VBOs, etc.
2009-09-16 19:33:01 -06:00
Brian Paul
4df2f7af5e progs/glsl: minor Makefile clean-ups 2009-09-16 19:28:55 -06:00
Brian Paul
8d47b4906b swrast: remove mipmap generation checks (done in core Mesa now) 2009-09-16 19:28:55 -06:00
Brian Paul
4e84b96d92 s3v: remove unneeded initializations 2009-09-16 19:28:54 -06:00
Brian Paul
1b1125c239 ffb: remove disabled code 2009-09-16 19:28:54 -06:00
Ian Romanick
9666529b5a glx: Use initstate_r / random_r instead of corrupting global random number state
Previously srandom and random were used.  This cause the global random
number generator state to be modified.  This caused problems for
applications that called srandom before calling into GLX.  By using
local state the global state is left unmodified.

This should fix bug #23774.
2009-09-16 16:43:50 -07:00
José Fonseca
f911d196cf llvmpipe: Don't assert due to unsupported texture wrap modes.
Issue a warning and fallback to clamping.
2009-09-16 20:42:09 +01:00
Brian Paul
08d39251a7 st/mesa: fix some incorrect branching/clean-up code in TexImage functions
We need to be sure to call the _mesa_unmap_teximage_pbo() function if we
called _mesa_validate_pbo_teximage().
2009-09-16 13:07:15 -06:00
Brian Paul
cfa1a0a609 st/mesa: fix texture memory allocation bug
The following example caused an incorrect GL_OUT_OF_MEMORY error to be
raised in glTexSubImage2D:

   glTexImage2D(level=0, width=32, height=32, pixels=NULL);
   glTexImage2D(level=0, width=64, height=64, pixels=NULL);
   glTexSubImage2D(level=0, pixels!=NULL);

The second glTexImage2D() call needs to cause the first image to be
deallocated then reallocated at the new size.  This was not happening
because we were testing for pixels==NULL too early.
2009-09-16 12:57:26 -06:00
Ian Romanick
5ce72c559c Merge branch 'mesa_7_6_branch' 2009-09-16 08:05:36 -07:00
Brian Paul
aabcc6cb23 gallium: remove incorrect 'return' stmt 2009-09-16 08:59:32 -06:00
Ian Romanick
88e3a57605 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Conflicts:
	src/mesa/main/dlist.c
2009-09-16 07:57:19 -07:00
Ian Romanick
2921a2555d intel: Deassociated drawables from private context struct in intelUnbindContext
The generic DRI infrastructure makes sure that __DRIcontextRec::driDrawablePriv
and __DRIcontextRec::driReadablePriv are set to NULL after unbinding a
context.  However, the intel_context structure keeps cached copies of
these pointers.  If these cached pointers are not NULLed and the
drawable is actually destroyed after unbinding the context (typically
by way of glXDestroyWindow), freed memory will be dereferenced in
intelDestroyContext.

This should fix bug #23418.
2009-09-16 07:39:58 -07:00
José Fonseca
c29905aa31 gallium: Deprecate PIPE_CAP_S3TC.
No longer used. S3TC support is queried via
pipe_screen::is_format_supported.
2009-09-16 14:33:52 +01:00
Michal Krol
ec48396e0f softpipe: Do not advertise Z32_UNORM as a supported format. 2009-09-16 13:56:58 +01:00
José Fonseca
b60e1d7630 gdi: Integrate with llvmpipe where available. 2009-09-16 11:35:23 +01:00
José Fonseca
459ea0095c llvmpipe: Make the code portable for MinGW. 2009-09-16 11:35:23 +01:00
Zou Nan hai
76e836a41a i965: do a flush in clear, fix openarena render issue,
fd.o bug# 23857
2009-09-16 13:25:46 +08:00
Dave Airlie
858a2a2ac7 radeon: cleanup compile defines mess.
I inherited this and really it stayed around far too long,
make it nice and simple.
2009-09-16 13:48:45 +10:00
Dave Airlie
a6a21eb00d radeon: oops remove debugging left on in previous patch 2009-09-16 13:25:02 +10:00
Dave Airlie
2fdb0e5d3b radeon: use txformat to decide to emit rect tex state.
This is more logical, and fixes a TFP issue.
2009-09-16 13:13:43 +10:00
Brian Paul
2914f2b7fd mesa: move generate mipmap calls
Per the suggestion in the Intel driver, move the calls to
ctx->Driver.GenerateMipmap() into core Mesa so that drivers don't
have to worry about it.
2009-09-15 18:17:43 -06:00
Brian Paul
ef6ee07fc7 mesa: minor clean-up 2009-09-15 18:17:43 -06:00
Brian Paul
a31ac84d74 mesa: remove last of gotos 2009-09-15 18:17:43 -06:00
Brian Paul
c352566933 mesa: more goto removal 2009-09-15 18:17:43 -06:00
Brian Paul
ecf6f37fc2 mesa: remove some gotos
This will make some subsequent changes easier...
2009-09-15 18:17:42 -06:00
Brian Paul
c26c2006df mesa: clean-up fbo debug code 2009-09-15 18:17:42 -06:00
Brian Paul
0b0fc4072f progs/demos: use non-default texobj in cubemap.c 2009-09-15 18:17:42 -06:00
Brian Paul
7f86da6c60 progs/demos: create a texture object in lodbias.c
Before, we were using the default texture object (name=0).  This caused
the intel_generate_mipmap() path to fail since passing texture=0 to
glFramebufferTexture2DEXT() causes us to _unbind_ the texture if present.
2009-09-15 18:17:42 -06:00
Zack Rusin
a016043386 st/xorg: fixing copies and composite shaders
copies were busted when src == dst. also the composite shaders
were incorrectly using the fragments instead of the texture coordinate.
2009-09-15 19:50:36 -04:00
Zack Rusin
8adcad0c70 st/xorg: lots of fixes
fixes blending binding and copy coordinates
2009-09-15 19:50:34 -04:00
Brian Paul
f9574e05c2 docs: GL_ARB_provoking_vertex 2009-09-15 16:01:51 -06:00
Brian Paul
2e7a1dd8ca mesa: added GL_ARB_provoking_vertex (same as EXT version) 2009-09-15 16:01:51 -06:00
Alex Deucher
87d40a95bf radeon: don't build non-r600 span code on r600 2009-09-15 17:13:08 -04:00
Alex Deucher
49fc41eeed r600: minor span cleanups 2009-09-15 17:13:08 -04:00
Brian Paul
d9ddbc3f47 docs: glUniform functions are now compiled into display lists 2009-09-15 15:12:29 -06:00
Brian Paul
41fff1b9a1 mesa: compile glUniformMatrix() functions into display lists
I believe this is the last of the shader-related functions that needed
display list treatment.
2009-09-15 15:10:29 -06:00
Brian Paul
6681981fe1 mesa: implement more glUniform display list functions 2009-09-15 14:56:55 -06:00
Brian Paul
3ad108b77f docs: document glUseProgram display list fix 2009-09-15 14:38:52 -06:00
Brian Paul
f42c66c138 mesa: compile glUniform4f() into display lists
Note: there are more glUniform functions to compile...
2009-09-15 14:37:45 -06:00
Brian Paul
81de9d68f7 mesa: compile glUseProgram/glUseProgramObjectARB into display lists
Fixes bug 23746
2009-09-15 14:37:45 -06:00
Ian Romanick
ac4e23d784 Merge branch 'mesa_7_6_branch' 2009-09-15 13:14:38 -07:00
Ian Romanick
6c6fe0a704 Merge commit 'origin/mesa_7_5_branch' into mesa_7_6_branch 2009-09-15 13:13:35 -07:00
Ian Romanick
1f309c40b8 GLX: Complain when buggy applications call GLX 1.3 functions. 2009-09-15 13:12:22 -07:00
Zack Rusin
f1ce6b09cd st/xorg: Brian suggested that those could be mad's
optimizes the common paths
2009-09-15 15:21:42 -04:00
Brian Paul
b0c52e491d mesa: remove incorrect texture state check
Fixes incorrectly textured bitmap text in engine demo.
It's incorrect to test the texture enable bits here since they may have
been changed by disabling the shader above.  Optimization is still possible
but will have to be reexamined.
2009-09-15 12:36:55 -06:00
Maarten Maathuis
26860a6e2f nv50: avoid excessive FIRE_RING
- And reduce RING_SPACE to 2, instead of 3.
2009-09-15 18:59:53 +02:00
Maarten Maathuis
db37279e0b nv50: use flush_notify to reduce number of relocs 2009-09-15 18:59:53 +02:00
Michel Dänzer
0469465c31 st/xorg: Only unreference texture on pixmap destruction, don't destroy it.
Fixes memory corruption if e.g. the driver still has references to the texture.
2009-09-15 18:31:07 +02:00
Michel Dänzer
45cf2696ca st/xorg: Explicitly check whether the driver supports the pixmap formats.
Rather than arbitrarily checking for pixmap depth < 15.
2009-09-15 18:30:58 +02:00
Michel Dänzer
be94a1d3bc st/xorg: Use A8 format for depth 8 pixmaps.
The inconsistent bpp caused issues with UploadTo/DownloadFromScreen.
2009-09-15 18:23:00 +02:00
Brian Paul
be0cdd77ea st/mesa: disable accidentally committed _mesa_print_program() call 2009-09-15 09:52:27 -06:00
Brian Paul
41bbc83951 Merge branch 'mesa_7_6_branch' 2009-09-15 09:47:35 -06:00
Brian Paul
5d526ed21a Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-15 09:45:18 -06:00
Brian Paul
c0cf9dc05e ARB prog parser: regenerated file 2009-09-15 09:40:26 -06:00
Brian Paul
2aad3a855b ARB prog parser: more detailed error message for out of bounds ADDR offsets 2009-09-15 09:40:25 -06:00
Brian Paul
2b992dc327 gl: restore some PFNGL typedefs
Commit d33c315d9e removed a few too many
typedefs.  We need the typedefs in glext.h which are protected by #ifdef
GL_VERSION_1_2 but we can exclude the ones protected by
GL_VERSION_1_2_DEPRECATED.
2009-09-15 09:36:31 -06:00
Andre Maasikas
5ef40337ab r600: support position_invariant programs 2009-09-15 11:27:51 -04:00
José Fonseca
a18301790c gallium: Use the enum for pipe_transfer::usage. 2009-09-15 16:02:55 +01:00
José Fonseca
cb5f1bce23 gallium: pipe_transfer_destroy helper inline. 2009-09-15 16:02:54 +01:00
Christoph Bumiller
d3a9cf54c0 nv50: fix stupid thinko in emit_set
When swapping sources 0 and 1, EQ of course does *not*
become NE, etc.

Introduced in 2b963f5c72.
2009-09-15 15:37:10 +02:00
Michal Krol
7aee53002c gallium: Fix pointer type casts. 2009-09-15 12:00:27 +01:00
Christoph Bumiller
750c6cae3d nv50: let programs use the whole param buffer
Allocation is unnecessary since all uniforms are
uploaded on every constant buffer change anyway.
2009-09-15 12:13:23 +02:00
Christoph Bumiller
01670ca807 nv50: add preliminary support for point sprites 2009-09-15 12:13:23 +02:00
Christoph Bumiller
06dac41cc5 nv50: add support for point size per vertex 2009-09-15 12:13:23 +02:00
Christoph Bumiller
4d7b4781c8 nv50: add support for light-twoside 2009-09-15 12:13:23 +02:00
Christoph Bumiller
6516594c8e nv50: proper linkage between VP and FP
This moves construction of the mapping between VP outputs
and FP inputs into validation.

The map also contains slots for special outputs like clip
distance and point size, so we need to at least merge the
VP related and FP related parts on validation if we want
to support those.

Now we match every single FP input component with results
from the VP and leave those not read out of the map, or
replace those not written by 0 (xyz) or 1 (w).
The bitmap indicating linear interpolants is also filled,
and flat FP inputs are mapped in only after non-flat ones,
as is required.

Furthermore, we can save some space by only fetching VP
attrs we actually use, and avoid wasting any output regs
because of TGSI using less than 4 components.
2009-09-15 12:13:23 +02:00
Christoph Bumiller
38849c529e nv50: move allocation of pc regs
Make use of tgsi_shader_info to determine how many nv50_regs we
need to allocate, whether program uses KIL, or writes DEPR.
2009-09-15 12:13:23 +02:00
Christoph Bumiller
e0951797cb nv50: nicer initialization of nv50_regs 2009-09-15 12:13:23 +02:00
Christoph Bumiller
849885c7a6 nv50: handle CEIL and TRUNC opcodes 2009-09-15 12:13:23 +02:00
Christoph Bumiller
2b963f5c72 nv50: handle SEQ, SGT, SLE, SNE opcodes 2009-09-15 12:13:23 +02:00
Christoph Bumiller
e774b3c0f2 nv50: SIN and COS use src0.w for dst.w 2009-09-15 12:13:22 +02:00
Christoph Bumiller
81de711fc8 nv50: use broadcast TEMP reg in tx_insn
Makes some opcode cases nicer and might reduce the total
nr of TEMPs required, or save some MOVs.
2009-09-15 12:13:22 +02:00
Christoph Bumiller
234d82ed63 nv50: add nv50_tgsi_insn to handle swizzles safely 2009-09-15 12:13:22 +02:00
Christoph Bumiller
2da8608ad7 nv50: add functions for swizzle resolution
We're going to try to reorder the scalar ops of a vector instr
to accomodate swizzles that would otherwise require us to emit
to an additional TEMP first (like MOV R0.xy, R0.zx).
2009-09-15 12:13:22 +02:00
Christoph Bumiller
5d141b3e3e nv50: extend insn src mask function
Extend its usage to avoiding e.g. emission of negation
instructions in tx_insn for sources we don't need.
2009-09-15 12:13:22 +02:00
Cooper Yuan
287f0072d2 st/g3dvl: pass color values to softpipe clear function 2009-09-15 15:25:47 +08:00
Cooper Yuan
2ef8c60e55 xvmc: Generate new resource ID in _XIDHandler, otherwise it's invalid. 2009-09-15 13:16:56 +08:00
Brian Paul
799631acb1 progs/vp: print program and error info when program does not compile 2009-09-14 17:48:17 -06:00
Brian Paul
ac3c8e3b53 glsl: added some link debug code (disabled) 2009-09-14 17:32:03 -06:00
Brian Paul
3129b2403e docs: document linker/preprocessor bug fix 2009-09-14 17:27:47 -06:00
Brian Paul
b8b774c775 glsl: remove extra #version directives from concatenated shader sources
When we concatenate shaders to do our form of poor-man linking, if there's
multiple #version directives, preprocessing fails.  This change disables
the extra #version directives by changing the first two chars to //.

This should help with some Wine issues such as bug 23946.
2009-09-14 17:24:25 -06:00
Zack Rusin
ef77462171 st/xorg: add some debugging helpers 2009-09-14 19:03:28 -04:00
Alex Deucher
364ca57aff r600: add span support for 1D tiles
1D tile span support for depth/stencil/color/textures

Z and stencil buffers are always tiled, so this fixes
sw access to Z and stencil buffers.  color and textures
are currently linear, but this adds span support when we
implement 1D tiling.

This fixes the text in progs/demos/engine and progs/tests/z*
2009-09-14 18:10:24 -04:00
Alex Deucher
f662cedae4 r600: fix warning
Noticed by rnoland on IRC.
2009-09-14 18:10:24 -04:00
Brian Paul
909ab3377f st/mesa: minor whitespace, comment clean-ups 2009-09-14 16:01:27 -06:00
Brian Paul
5a87a25a65 st/xorg: fix ureg_DECL_constant() parameters
This fixes the compilation errors reported in bug 23945 but someone more
familiar with the code should review for correctness and close the bug
report.
2009-09-14 15:47:13 -06:00
José Fonseca
d3f5a2e5ab scons: Allow to use only the WINDDK headers. 2009-09-14 20:12:02 +01:00
José Fonseca
a4a4553a80 scons: Allow to use MS's DXSDK headers with MinGW. 2009-09-14 20:12:01 +01:00
José Fonseca
c51bd94a14 gallium: Add pipe_transfer_map/unmap inlines. 2009-09-14 20:12:01 +01:00
José Fonseca
88b88bba68 util: Add _BitScanForward intrinsic's declaration.
It is missing in some Microsoft DDKs.
2009-09-14 20:12:01 +01:00
Brian Paul
aa522e6cc4 intel: minor code clean-ups 2009-09-14 12:42:18 -06:00
Brian Paul
8ec456c68c intel: fix renderbuffer map/unmap regression
Commit 36dd53a3cd caused a few regressions
because the glReadBuffer() buffer wasn't getting mapped when GL_READ_BUFFER
!= GL_DRAW_BUFFER.
2009-09-14 12:42:18 -06:00
Brian Paul
3c31049439 intel: remove unneeded driver function assignments
These default swrast functions are already installed by
_mesa_init_driver_functions().
2009-09-14 12:42:18 -06:00
Brian Paul
284d3b2d9c progs/tests: exercise display lists and pixelstore 2009-09-14 12:42:17 -06:00
Vinson Lee
2729db8976 gallium: Add Mac OS to pipe/p_thread.h.
Mac OS also has POSIX threads.
2009-09-14 11:50:48 -06:00
Thierry Vignaud
1402ea8f39 configure: fix comment 2009-09-14 11:48:51 -06:00
Keith Whitwell
d7512521fd mesa/st: remove dead comment 2009-09-14 17:11:09 +01:00
Keith Whitwell
4295b34d25 st/mesa: convert to new tgsi_ureg mechanism for shader emit
Should be easier to read and work with than the older ways of emitting
TGSI tokens.

Also, emit simpler TGSI than previously:
  - translate away source and dest extended modifiers
  - translate away the SWZ opcode
2009-09-14 17:09:15 +01:00
Marcin Kościelnicki
d8a191e314 nv50: Fix m2mf positions. 2009-09-14 12:12:03 +02:00
José Fonseca
b4835ea03d llvmpipe: Make lp_type a regular union.
Union not worth the hassle of violating C99 or adding a name to
the structure.
2009-09-14 11:05:38 +01:00
José Fonseca
fa150debf0 util: Fix a1r5g5b5's format description. 2009-09-14 11:05:38 +01:00
Cooper Yuan
aad0deee4b g3dvl: update tgsi_opcode in order to build g3dvl library 2009-09-14 16:23:03 +08:00
Keith Whitwell
66a7eedaa2 tgsi: handle some src/dst aliasing in tgsi_sse2.c
Src/Dst aliasing (aka SOA dependencies) requires some care to ensure
intermediate results do not overwrite yet-to-be read source registers.

This change ensures that MOV/SWZ handle this correctly, which is poor but
no worse than the current tgsi_exec.c path.  Remove the fallback as there
is nothing to be gained correctness-wise between the two implementations now.

Fixing this properly looks like a bit of work in this code, but might be
easily achieved by sending destination writes to temporary storage.
2009-09-13 11:59:24 -07:00
José Fonseca
86226d5ea1 llvmpipe: Compute derivatives. 2009-09-13 16:22:27 +01:00
José Fonseca
4b32dd3007 llvmpipe: Remove dead references to pipe_winsys. 2009-09-13 16:13:12 +01:00
José Fonseca
5e13e987da llvmpipe: Use const keyword for input array arguments. 2009-09-13 16:12:48 +01:00
José Fonseca
faec23387e llvmpipe: Delay storing into the dst register to prevent clobbering the src registers.
How I'm thankful for regular expressions -- just a couple of them were
all that was needed to do this otherwise tiresome and bug prone change.
2009-09-13 14:42:52 +01:00
José Fonseca
873773ee2b llvmpipe: Translate more TGSI opcodes.
Basically cover all low hanging fruit, and mark the still missing opcodes
as "fixme" or deprecated.
2009-09-13 13:55:08 +01:00
José Fonseca
00dd0156e0 llvmpipe: Add a few more common arithmetic functions.
We are relying on SSE4.1 for round/trunc/ceil/floor. We'll need to
eventually find alternatives for the rest of the world.
2009-09-13 13:50:19 +01:00
José Fonseca
d7aa114e16 llvmpipe: Rename function to free up lp_build_trunc to the usual arithmetic meaning. 2009-09-13 13:45:48 +01:00
Keith Whitwell
18e5f1cee4 tgsi: implement saturation
Fix recent performance regression.
2009-09-12 18:33:46 -07:00
Keith Whitwell
055fe5768c tgsi: add missing implementation of constant decl change 2009-09-12 16:27:25 -07:00
Cooper Yuan
bffa18624d r300g: delete unused flag due to commit: 09b566e161 2009-09-13 07:10:34 -04:00
Keith Whitwell
11f41f54cf ureg: add a mechanism to get the built tokens rather than a full shader
Previously ureg would always call the driver's create-shader function.  This
allows the caller the opportunity to hold onto the tokens if it needs to
reuse them, eg. to create an internal draw shader.
2009-09-12 14:18:50 -07:00
Keith Whitwell
c23894295b ureg: add generic emitters for tex and branch instructions
Couldn't previously emit these except by calling the opcode-specific helper.
2009-09-12 14:18:00 -07:00
Keith Whitwell
ae4704eabc tgsi/ureg: give ureg_DECL_constant an explicit index parameter
Avoid the need to emit all constant declarations in order.  Makes
referring to a specific constant in the constant buffer much easier.
2009-09-12 14:16:00 -07:00
Keith Whitwell
09b566e161 mesa: remove unused SATURATE_PLUS_MINUS_ONE flag
Never set in mesa.  Remove from tgsi translation as well.
2009-09-12 14:15:15 -07:00
Keith Whitwell
6d8dbd3d1e tgsi/ureg: VS inputs don't have any semantic tags, just an index
Fix ureg_DECL_vs_input to reflect this and fix up all callers.
2009-09-12 14:12:35 -07:00
Keith Whitwell
149945c432 tgsi: free tokens on error 2009-09-12 14:07:48 -07:00
Keith Whitwell
e90fb86ac3 tgsi: sanity check ureg programs 2009-09-12 14:05:37 -07:00
Keith Whitwell
983b261e6d tgsi: add const qualifier 2009-09-12 14:04:36 -07:00
Dan Nicholson
9c8b69302c Use CFLAGS as HOST_CFLAGS by default
Unless we're cross compiling, the HOST_CFLAGS should be the same as the
normal CFLAGS. This allows the x86 and x86_64 asm to be built correctly
with a native compiler using -m32/-m64.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-09-12 09:35:43 -07:00
Nicolai Hähnle
3cb30e55e4 r300g: There is no such thing as "texture stride"
Individual texture images have a stride, but textures as a whole do not.

There are still pieces of code which are confused about this, but the core of
the confusion is hopefully gone.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-12 16:55:25 +02:00
Brian Paul
280933f793 docs: mention the new Gallium llvmpipe driver 2009-09-11 13:43:51 -06:00
Brian Paul
d81086a86b llvmpipe: asst fixes for 'make linux-llvmpipe' 2009-09-11 13:39:14 -06:00
Vinson Lee
0fa1692f14 mesa: raise GL_INVALID_ENUM not GL_INVALID_VALUE for glTexParamter errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-09-11 08:04:37 -06:00
Ian Romanick
b8e1e8d2d8 Merge branch 'master' into asm-shader-rework-2
Conflicts:
	src/mesa/shader/lex.yy.c
	src/mesa/shader/program_parse.tab.c
	src/mesa/shader/program_parse.tab.h
2009-09-10 15:33:45 -07:00
Pauli Nieminen
796c96de80 radeon: Remove structure allocation from iterator variable.
dma_bo varaible is only used for iterating so allocating memory for it only
causes memory leaks.
2009-09-11 01:29:07 +03:00
Ian Romanick
81722c5d7e NV fp parser: Add support for condition codes
Conditional write masks and the condition-code based KIL instruction
are all supported.  The specific behavior of KIL in the following
shader may or may not match the behavior of other implementations:

!!ARBfp1.0
	TEMP	GT;
	MOVC	GT, fragment.texcoord[0];
	KIL	GT.x;
	END

Should be it interpreted as 'KIL srcReg' or as 'KIL ccTest'?  The
current parser will interpret it as 'KIL srcReg'.
2009-09-10 15:04:24 -07:00
Ian Romanick
cdb7193994 ARB prog lexer: Add missing #include to silence compile warning 2009-09-10 14:55:36 -07:00
Ian Romanick
0e7953366f ARB prog parser: Differentiate between used and unused names in the lexer
The lexer will return IDENTIFIER only when the name does not have an
associated symbol.  Otherwise USED_IDENTIFIER is returned.
2009-09-10 14:35:33 -07:00
Nicolai Hähnle
f02f63997c Merge branch 'master' into r300-compiler
Conflicts:
	src/gallium/drivers/r300/r300_tgsi_to_rc.c
2009-09-06 13:15:04 +02:00
Nicolai Hähnle
e95e76e125 r300/compiler: New dataflow structures and passes
This replaces the old NQSSADCE code with the same functionality, but quite
different design. Instead of doing a single integerated pass, we now build
explicit data structures representing the dataflow.

This will enable analysis of flow control instruction, and could potentially
open an avenue for several dataflow based optimizations, such as peephole
optimization, fusing MUL+ADD to MAD, and so on.
2009-09-06 11:47:40 +02:00
Ian Romanick
d0adebb8d5 NV fp parser: Support instruction and TEMP / OUTPUT sizes
Adds support for declaring TEMP and OUTPUT variables as 'LONG' or
'SHORT' precision.  The precision specifiers are parsed, but they are
currently ignored.  Some support for this may be added in the future,
but neither Intel hardware nor, as far as I'm aware, Radeon hardware
support multiple precisions.

Also adds support for instruction precision ('X', 'H', and 'R')
suffixes and instruction condition code output ('C') suffix.  This
results in a fairly major change to the lexer.  Instructions are
matched with all the possible suffix strings.  The suffix string are
then carved off by a context (i.e., which program mode and options are
set) aware parser that converts the suffixes to bits in
prog_instruction.

This could have been handled in the same way _SAT was originally
handled in the lexer, but it would have resulted in a very large lexer
with lots of opportunity for cut-and-paste errors.
2009-09-04 17:31:05 -07:00
Ian Romanick
9ea4319744 ARB prog parser: Add new constructor for asm_instruction
The new constructor copies fields from the prog_instruction that the
parser expects the lexer to set.
2009-09-04 16:35:50 -07:00
Ian Romanick
eeb1402c05 NV fp parser: Add support for absolute value operator on instruction operands 2009-09-03 14:32:48 -07:00
Ian Romanick
5db8ebb8f5 Enable GL_NV_fragment_program_option for software rendering
At this point the extension is not fully implemented.
2009-09-03 14:07:07 -07:00
Ian Romanick
b8e389bb03 NV fp parser: Support new scalar constant behavior
ARBfp requires scalar constants have a '.x' suffix, but NVfp_option
does not.  This shows up with instructions that require a scalar
parameter (e.g., COS).
2009-09-03 14:05:18 -07:00
Ian Romanick
8ca6fd8a83 NV fp parser: Parse TXD instruction 2009-09-01 14:16:03 -07:00
Ian Romanick
ede0cd4d8c NV fp lexer: Add new opcodes 2009-08-31 17:00:31 -07:00
Ian Romanick
dc8ec05ace NV fp: Parse 'OPTION NV_fragment_program' in ARB assembly shaders 2009-08-31 16:57:49 -07:00
Ian Romanick
efff7aa980 NV fp: Add tracking for NV_fragment_program_option 2009-08-31 16:43:39 -07:00
Nicolai Hähnle
d1b4351e60 r300: Remove all Mesa dependencies from the shader compiler
In particular, this removes the dependency on prog_instruction, which
unfortunately creates some code duplication, but also opens a path towards
adding some hardware-specific things in there.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-08-30 18:51:46 +02:00
Nicolai Hähnle
d6d71e5bf4 r300: Move Mesa -> RC program conversion to classic Mesa driver
This really doesn't belong into the compiler itself, since the compiler
should eventually be independent of Mesa's program representation.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-08-30 17:57:20 +02:00
Keith Whitwell
67d4a5b15c mesa/swrast: use one fewer divide in swrast's choose_cube_face also
Same change as for softpipe
2009-08-24 08:26:33 +01:00
Keith Whitwell
fd19e8adcd softpipe: use one fewer divide in sample_cube
GCC won't do this for us.  Makes a bigger difference to cubemap fps
than previous set of compilcated rearrangements.
2009-08-24 08:26:33 +01:00
Keith Whitwell
60adc15ba5 softpipe: separate out 2d and cube img filter functions 2009-08-24 08:26:32 +01:00
Keith Whitwell
81601d85ef softpipe: make the various get_texel routines more similar
Remove arguments, return const float * by default.  Add specialized 3d
versions and remove 3d texture support from the others.
2009-08-24 08:26:17 +01:00
Keith Whitwell
75312b6555 progs/demos: add fps output to cubemap 2009-08-23 23:53:41 +01:00
Keith Whitwell
153e474d22 softpipe: lift tex_address construction up to img_filter
For fastpaths at least, can avoid recalculating this sometimes.
2009-08-23 13:38:10 +01:00
Keith Whitwell
4fe0fc3eba softpipe: remove old prim_setup draw stage
Everything now goes through the draw_vbuf handler, the same as
regular drivers.
2009-08-23 11:22:41 +01:00
Keith Whitwell
47800c572f softpipe: add missing header 2009-08-23 11:13:20 +01:00
Keith Whitwell
7670102468 Merge branch 'tex-tilecache' into softpipe-opt
Conflicts:
	src/gallium/drivers/softpipe/sp_state_derived.c
	src/gallium/drivers/softpipe/sp_state_sampler.c
	src/gallium/drivers/softpipe/sp_tex_sample.c
	src/gallium/drivers/softpipe/sp_tex_sample.h
	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-08-23 10:23:46 +01:00
Brian Paul
0f24886f92 softpipe: remove duplicate #include, move another 2009-08-21 14:07:37 -06:00
Brian Paul
d204659c8c softpipe: remove tex sample dependencies on softpipe
The texture sampling code doesn't really have any dependencies on the
rest of softpipe, just the tile cache.
2009-08-21 14:04:51 -06:00
Brian Paul
3adc8c3779 softpipe: minor code refactoring to remove softpipe/tile cache dependencies
The tile cache code now has no hard dependencies on softpipe.
2009-08-21 14:01:58 -06:00
Brian Paul
4256c5829f softpipe: remove unused #includes, white-space clean-up 2009-08-21 13:47:50 -06:00
Brian Paul
46fbc87288 softpipe: remove unneeded const qualifier 2009-08-21 13:45:16 -06:00
Brian Paul
a29447c33d softpipe: per-unit sampler varients
Can't share sampler varients across multiple tex units because the texture
pointer is in the sampler varient.  That prevents different textures per unit.

Fixes progs/demos/multiarb, progs/glsl/samplers, etc.
2009-08-21 12:44:04 -06:00
Brian Paul
87ec83afd5 softpipe: add missing PIPE_TEXTURE_CUBE case in get_lambda_func()
Fixes progs/demos/cubemap
2009-08-21 11:47:31 -06:00
Keith Whitwell
ecfa8be150 softpipe: add missing sp_sampler_varient_destroy 2009-08-21 18:44:56 +01:00
Brian Paul
cf102b031e softpipe: remove redundant comparison, make test easier to understand 2009-08-21 11:43:48 -06:00
Brian Paul
41483627f0 softpipe: fix min/mag filter typo 2009-08-21 11:41:29 -06:00
Brian Paul
4e5c385d21 softpipe: fix s/t/p typos 2009-08-21 11:40:33 -06:00
Keith Whitwell
4fc7d0345a softpipe: rework texture sampling code
Split into component pieces, stitch together at runtime using function
pointers.  Make it possible to utilize the existing fastpaths as image-level
filters for generic mip-filtering routines.

Remove special case for rectangle filtering, as it can now be handled by
the 2d path.

As most of the mesa demo texturing was already covered by fast paths, its
harder to find examples of speedups, but tunnel gets a boost as mip-nearest
filtering is now able to access the img_2d_linear_wrap_POT functions
for sampling within a mipmap level.
2009-08-21 18:14:19 +01:00
Keith Whitwell
b1cc196e6d util: add util_is_power_of_two function 2009-08-21 18:07:35 +01:00
Keith Whitwell
00c8359182 softpipe: allow the existing sampler routines to be hooked up directly
Let eg. sp_get_samples_rect be hooked directly in as the tgsi sampler
routine.

Add a field to determine whether this is a vertex or fragment sampling
call, and massage parameters to match the tgsi call.
2009-08-20 18:36:57 +01:00
Keith Whitwell
0d9979d9ec softpipe: fix xpot calculation typo in sp_get_samples_2d_nearest_clamp_POT 2009-08-20 18:13:25 +01:00
Keith Whitwell
1fd40e506c softpipe: slightly optimized tiling calculation 2009-08-20 18:12:44 +01:00
Keith Whitwell
79a7ddb57a softpipe: fix glitch in texel lookups on fastpaths
Fixes two issues - firstly for mipmap levels with one or more
dimensions smaller than tilesize, the code was sampling off the edge
of the texture (but still within the tile).

Secondly, in the linear_mipmap_linear case, both the default code and
new fastpath were incorrect.  This change fixes the fastpath and adds
a comment to the default path, which still needs to be fixed.
Basically the issue is that the coordinates in the smaller texture
level are/were being computed by just dividing thecoordinates from the
larger texture level by two, as in:

               x0[j] /= 2;
               y0[j] /= 2;
               x1[j] /= 2;
               y1[j] /= 2;

The issues with this are signficant.  Initially x1 is most often equal
to x0+1, but after this, it will likely be equal to x0, so we will not
actually be performing the linear blend within the smaller mipmap.

The fastpath code avoided this (recalculated x1), but was still using
the weighting factors from the larger mipmap level (xw, yw), which
were incorrect.

Change the fastpath code to do two full, independent linear samples of
the two mipmap levels before blending.  The default code needs to do
the same thing.
2009-08-20 17:59:39 +01:00
Keith Whitwell
4f409da345 softpipe: optimized path for simple mipmap sampling
linear-mip-linear-repeat-POT sampling faspath, provides a very nice
speedup to apps that do this common type of texturing.

Test case: demos/terrain, turn fog off, turn texturing on.
Without patch: 12 fps
With patch: 20 fps.
2009-08-20 11:25:20 +01:00
Keith Whitwell
c84abe36a9 softpipe: fix typo in clear_tile 2009-08-18 16:55:10 +01:00
Keith Whitwell
80c78472ad softpipe: split texture and surface tile caches
These do similar jobs but with largely disjoint code.  Will want
to evolve them separately going forward.
2009-08-18 16:55:10 +01:00
Keith Whitwell
d12bae9368 softpipe: move flatshade-first check out of loop 2009-08-18 16:21:12 +01:00
Keith Whitwell
99ec78d946 Revert "softpipe: rearrange blend fastpaths"
This reverts commit 1295cf423e.

The original formulation was easier to understand & work with.  Will
revisit this later.
2009-08-11 18:23:28 +01:00
Keith Whitwell
da319095f2 softpipe: reduce textual differences between exec and sse shader paths
Unshare one function (setup_pos_vector) as we want to push this code
into the generated shader in the SSE case.
2009-08-11 18:06:16 +01:00
Keith Whitwell
b5c389721a softpipe: remove gallivm fragment shaders
However we do llvm integration, it will be different & more comprehensive
than this.
2009-08-11 18:03:01 +01:00
Keith Whitwell
95f7ed4638 softpipe: setup quad outputs from with fs->run 2009-07-30 11:59:32 +01:00
Keith Whitwell
1295cf423e softpipe: rearrange blend fastpaths 2009-07-30 11:35:50 +01:00
Keith Whitwell
73a6178a73 softpipe: add depth-lequal z16 path 2009-07-30 11:35:08 +01:00
Keith Whitwell
572c2fb5bb softpipe: remove unused variable in shade_quad 2009-07-30 11:34:36 +01:00
Keith Whitwell
5fdac2dcea softpipe: fix off-by-one in nearest texcoord routines
Stray '- 0.5' copied from linear versions.
2009-07-27 15:51:15 +01:00
Keith Whitwell
6142de393f softpipe: example fast paths for simple samplers
All these fastpaths are examples of the types of things we'd code-generate
in a more sophisticated version of softpipe.
2009-07-27 12:44:58 +01:00
Keith Whitwell
c611458205 softpipe: fastpath for interpolated z16 less depthtesting
Because this is interpolated (ie. early) depth, we can build in an
assumption about the quads emitted by triangle setup, ie that they
are actually linear spans.  Interpolate z over those spans in z16
format to save on math & conversion.
2009-07-27 12:11:16 +01:00
Keith Whitwell
1078844d18 softpipe: cope with nr_cbufs == 0
Disable blend code when no color buffer
2009-07-27 11:23:51 +01:00
Keith Whitwell
bac8e34c9e softpipe: move all depth/stencil/alpha pixel processing into one stage 2009-07-27 08:17:45 +01:00
Keith Whitwell
85613cc4f1 softpipe: fix error in scissor state dependencies 2009-07-25 11:01:48 +01:00
Keith Whitwell
ade8984f50 softpipe: cleanup framebuffer state routine slightly 2009-07-25 10:01:06 +01:00
Keith Whitwell
a2f7ab1d15 softpipe: move all color-combine code into sp_quad_blend.c
Consolidate the read-modify-write color combining code from
the blend, colormask and output stages.
2009-07-24 20:19:18 +01:00
Keith Whitwell
42f1757189 softpipe: fix typo 2009-07-24 20:18:52 +01:00
Keith Whitwell
333ec94380 softpipe: example fastpaths in blending 2009-07-24 18:46:17 +01:00
Keith Whitwell
a1dbd7aa15 softpipe: actually pass >1 quad from triangle routine
First attempt
2009-07-24 18:17:05 +01:00
Keith Whitwell
ab9fb51670 softpipe: expand quad pipeline to process >1 quad at a time
This is part one -- we still only pass a single quad down, but
the code can now cope with more.  The quads must all be from the same
tile.
2009-07-24 16:49:35 +01:00
Keith Whitwell
6153a1c28f softpipe: rip out old mulithread support 2009-07-24 16:12:48 +01:00
Keith Whitwell
93a026d4ba softpipe: avoid flushing depth buffer cache on swapbuffers
There's no need to push out depth buffer contents on swapbuffers.

Note that this change doesn't throw away depth buffer changes, it simply
holds them in the cache over calls to swapbuffers.  The hope is
that swapbuffers will be followed by a clear() which means in that case
we won't have to write the changes out.
2009-07-23 11:14:39 +01:00
Keith Whitwell
19097907ef softpipe: also shortcircuit non-texture tile lookups 2009-07-23 09:35:33 +01:00
Keith Whitwell
f911c3b989 softpipe: shortcircuit repeated lookups of the same tile
The sp_tile_cache is often called repeatedly to look up the same
tile.  Add a cache (to the cache) of the single tile most recently
retreived and make a quick inline check to see if this matches the
subsequent request.

Add a tile_address bitfield struct to make this check easier.
2009-07-22 15:08:42 +01:00
Keith Whitwell
13e2d35764 softpipe: remove unused vars in sp_setup.c 2009-07-22 12:48:01 +01:00
Keith Whitwell
0ed99f4552 softpipe: use bitwise logic to setup quad masks in sp_setup 2009-07-22 12:48:00 +01:00
Keith Whitwell
73e7356385 softpipe: simplify flush_spans
No loss of performance, but simpler code.
2009-07-22 12:48:00 +01:00
Keith Whitwell
b5d583efef softpipe: make some small steps to flush texture cache less frequently
No performance gain yet, but the code is a bit cleaner.
2009-07-22 12:48:00 +01:00
Keith Whitwell
07bb026900 gallium/xlib: use XSHM for swapbuffers
Makes some difference, but suprisingly little.  Barely worth the effort.
2009-07-22 12:47:59 +01:00
Keith Whitwell
0ac879dca7 util: _debug_printf should print even when DEBUG is not defined
The leading underscore is meaningful...  This function is used by
_warning and _error functions as well as the more common
debug_printf().

debug_printf (without underscore) gets turned off when DEBUG is
disabled, but warning/error messages still use this function to get
their message out.
2009-07-22 12:47:59 +01:00
Keith Whitwell
aa5db68438 softpipe: remove backwards dependency from tilecache to softpipe
The tile cache is a utility, it shouldn't know anything about the
entity which is making use of it (ie softpipe).

Remove softpipe parameter to all the tilecache function calls, and
also remove the need to keep a softpipe pointer in the sampler structs.
2009-07-22 12:47:59 +01:00
1496 changed files with 868987 additions and 88722 deletions

View File

@@ -182,7 +182,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.7-devel
VERSION=7.7-rc2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
@@ -415,6 +415,12 @@ DEMO_FILES = \
$(DIRECTORY)/progs/demos/README \
$(DIRECTORY)/progs/fbdev/Makefile \
$(DIRECTORY)/progs/fbdev/glfbdevtest.c \
$(DIRECTORY)/progs/objviewer/*.[ch] \
$(DIRECTORY)/progs/objviewer/*.obj \
$(DIRECTORY)/progs/objviewer/*.mtl \
$(DIRECTORY)/progs/objviewer/*.rgb \
$(DIRECTORY)/progs/objviewer/Makefile \
$(DIRECTORY)/progs/objviewer/README.txt \
$(DIRECTORY)/progs/osdemos/Makefile \
$(DIRECTORY)/progs/osdemos/*.c \
$(DIRECTORY)/progs/xdemos/Makefile* \
@@ -433,8 +439,7 @@ DEMO_FILES = \
$(DIRECTORY)/progs/windml/Makefile.ugl \
$(DIRECTORY)/progs/windml/*.c \
$(DIRECTORY)/progs/windml/*.bmp \
$(DIRECTORY)/progs/ggi/*.c \
$(DIRECTORY)/windows/VC7/progs/progs.sln
$(DIRECTORY)/progs/ggi/*.c
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
@@ -457,9 +462,7 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/mini/glut.pc.in \
$(DIRECTORY)/src/glut/directfb/Makefile \
$(DIRECTORY)/src/glut/directfb/NOTES \
$(DIRECTORY)/src/glut/directfb/*[ch] \
$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj
$(DIRECTORY)/src/glut/directfb/*[ch]
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
@@ -499,9 +502,11 @@ rm_depend:
touch $$dep ; \
done
lib_gz:
rm -f configs/current ; \
rm -f configs/autoconf ; \
rm_config:
rm -f configs/current
rm -f configs/autoconf
lib_gz: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
@@ -519,9 +524,7 @@ glut_gz:
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
lib_bz2:
rm -f configs/current ; \
rm -f configs/autoconf ; \
lib_bz2: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
@@ -539,9 +542,7 @@ glut_bz2:
bzip2 $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
lib_zip:
rm -f configs/current ; \
rm -f configs/autoconf ; \
lib_zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
@@ -570,5 +571,7 @@ md5:
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend lib_gz demo_gz glut_gz lib_bz2 demo_bz2 \
glut_bz2 lib_zip demo_zip glut_zip md5
.PHONY: tarballs rm_depend rm_config md5 \
lib_gz demo_gz glut_gz \
lib_bz2 demo_bz2 glut_bz2 \
lib_zip demo_zip glut_zip

View File

@@ -32,10 +32,10 @@ import common
default_statetrackers = 'mesa'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
default_drivers = 'softpipe,failover,i915simple,trace,identity,llvmpipe'
default_drivers = 'softpipe,failover,svga,i915,trace,identity,llvmpipe'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
default_drivers = 'softpipe,i915simple,trace,identity'
default_drivers = 'softpipe,svga,i915,trace,identity'
default_winsys = 'all'
else:
default_drivers = 'all'
@@ -46,9 +46,9 @@ common.AddOptions(opts)
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python', 'xorg']))
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace', 'r300', 'identity', 'llvmpipe']))
['softpipe', 'failover', 'svga', 'i915', 'cell', 'trace', 'r300', 'identity', 'llvmpipe']))
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
['xlib', 'intel', 'gdi', 'radeon']))
['xlib', 'vmware', 'intel', 'gdi', 'radeon']))
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -1,309 +0,0 @@
#!/usr/bin/env python
##########################################################################
#
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
# 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, 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 TUNGSTEN GRAPHICS AND/OR ITS 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.
#
##########################################################################
import sys
import optparse
import re
import struct
from gprof2dot import Call, Function, Profile
from gprof2dot import CALLS, SAMPLES, TIME, TIME_RATIO, TOTAL_TIME, TOTAL_TIME_RATIO
from gprof2dot import DotWriter, TEMPERATURE_COLORMAP
__version__ = '0.1'
class ParseError(Exception):
pass
class MsvcDemangler:
# http://www.kegel.com/mangle.html
def __init__(self, symbol):
self._symbol = symbol
self._pos = 0
def lookahead(self):
return self._symbol[self._pos]
def consume(self):
ret = self.lookahead()
self._pos += 1
return ret
def match(self, c):
if self.lookahead() != c:
raise ParseError
self.consume()
def parse(self):
self.match('?')
name = self.parse_name()
qualifications = self.parse_qualifications()
return '::'.join(qualifications + [name])
def parse_name(self):
if self.lookahead() == '?':
return self.consume() + self.consume()
else:
name = self.parse_id()
self.match('@')
return name
def parse_qualifications(self):
qualifications = []
while self.lookahead() != '@':
name = self.parse_id()
qualifications.append(name)
self.match('@')
return qualifications
def parse_id(self):
s = ''
while True:
c = self.lookahead()
if c.isalnum() or c in '_':
s += c
self.consume()
else:
break
return s
def demangle(name):
if name.startswith('_'):
name = name[1:]
idx = name.rfind('@')
if idx != -1 and name[idx+1:].isdigit():
name = name[:idx]
return name
if name.startswith('?'):
demangler = MsvcDemangler(name)
return demangler.parse()
return name
class Reader:
def __init__(self):
self.symbols = []
self.symbol_cache = {}
self.base_addr = None
def read_map(self, mapfile):
# See http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
last_addr = 0
last_name = 0
for line in file(mapfile, "rt"):
fields = line.split()
try:
section_offset, name, addr, type, lib_object = fields
except ValueError:
continue
if type != 'f':
continue
section, offset = section_offset.split(':')
addr = int(offset, 16)
self.symbols.append((addr, name))
last_addr = addr
last_name = name
# sort symbols
self.symbols.sort(key = lambda (addr, name): addr)
def lookup_addr(self, addr):
try:
return self.symbol_cache[addr]
except KeyError:
pass
tolerance = 4196
s, e = 0, len(self.symbols)
while s != e:
i = (s + e)//2
start_addr, name = self.symbols[i]
try:
end_addr, next_name = self.symbols[i + 1]
except IndexError:
end_addr = start_addr + tolerance
if addr < start_addr:
e = i
continue
if addr == end_addr:
return next_name, addr - start_addr
if addr > end_addr:
s = i
continue
return name, addr - start_addr
raise ValueError
def lookup_symbol(self, name):
for symbol_addr, symbol_name in self.symbols:
if name == symbol_name:
return symbol_addr
return 0
def read_data(self, data):
profile = Profile()
fp = file(data, "rb")
entry_format = "IIII"
entry_size = struct.calcsize(entry_format)
caller = None
caller_stack = []
while True:
entry = fp.read(entry_size)
if len(entry) < entry_size:
break
caller_addr, callee_addr, samples_lo, samples_hi = struct.unpack(entry_format, entry)
if caller_addr == 0 and callee_addr == 0:
continue
if self.base_addr is None:
ref_addr = self.lookup_symbol('___debug_profile_reference@0')
if ref_addr:
self.base_addr = (caller_addr - ref_addr) & ~(options.align - 1)
else:
self.base_addr = 0
sys.stderr.write('Base addr: %08x\n' % self.base_addr)
samples = (samples_hi << 32) | samples_lo
try:
caller_raddr = caller_addr - self.base_addr
caller_sym, caller_ofs = self.lookup_addr(caller_raddr)
try:
caller = profile.functions[caller_sym]
except KeyError:
caller_name = demangle(caller_sym)
caller = Function(caller_sym, caller_name)
profile.add_function(caller)
caller[CALLS] = 0
caller[SAMPLES] = 0
except ValueError:
caller = None
if not callee_addr:
if caller:
caller[SAMPLES] += samples
else:
callee_raddr = callee_addr - self.base_addr
callee_sym, callee_ofs = self.lookup_addr(callee_raddr)
try:
callee = profile.functions[callee_sym]
except KeyError:
callee_name = demangle(callee_sym)
callee = Function(callee_sym, callee_name)
profile.add_function(callee)
callee[CALLS] = samples
callee[SAMPLES] = 0
else:
callee[CALLS] += samples
if caller is not None:
try:
call = caller.calls[callee.id]
except KeyError:
call = Call(callee.id)
call[CALLS] = samples
caller.add_call(call)
else:
call[CALLS] += samples
if options.verbose:
if not callee_addr:
sys.stderr.write('%s+%u: %u\n' % (caller_sym, caller_ofs, samples))
else:
sys.stderr.write('%s+%u -> %s+%u: %u\n' % (caller_sym, caller_ofs, callee_sym, callee_ofs, samples))
# compute derived data
profile.validate()
profile.find_cycles()
profile.aggregate(SAMPLES)
profile.ratio(TIME_RATIO, SAMPLES)
profile.call_ratios(CALLS)
profile.integrate(TOTAL_TIME_RATIO, TIME_RATIO)
return profile
def main():
parser = optparse.OptionParser(
usage="\n\t%prog [options] [file] ...",
version="%%prog %s" % __version__)
parser.add_option(
'-a', '--align', metavar='NUMBER',
type="int", dest="align", default=16,
help="section alignment")
parser.add_option(
'-m', '--map', metavar='FILE',
type="string", dest="map",
help="map file")
parser.add_option(
'-b', '--base', metavar='FILE',
type="string", dest="base",
help="base addr")
parser.add_option(
'-n', '--node-thres', metavar='PERCENTAGE',
type="float", dest="node_thres", default=0.5,
help="eliminate nodes below this threshold [default: %default]")
parser.add_option(
'-e', '--edge-thres', metavar='PERCENTAGE',
type="float", dest="edge_thres", default=0.1,
help="eliminate edges below this threshold [default: %default]")
parser.add_option(
'-v', '--verbose',
action="count",
dest="verbose", default=0,
help="verbose output")
global options
(options, args) = parser.parse_args(sys.argv[1:])
reader = Reader()
if options.base is not None:
reader.base_addr = int(options.base, 16)
if options.map is not None:
reader.read_map(options.map)
for arg in args:
profile = reader.read_data(arg)
profile.prune(options.node_thres/100.0, options.edge_thres/100.0)
output = sys.stdout
dot = DotWriter(output)
colormap = TEMPERATURE_COLORMAP
dot.graph(profile, colormap)
if __name__ == '__main__':
main()

View File

@@ -124,7 +124,7 @@ INSTALL_INC_DIR = $(includedir)
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@

View File

@@ -23,6 +23,7 @@ HOST_CC = $(CC)
CFLAGS = -O
CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
# Compiler for building demos/tests/etc
@@ -86,16 +87,16 @@ SRC_DIRS = mesa gallium egl gallium/winsys glu glut/glx glew glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples glsl xdemos
PROGRAM_DIRS = demos redbook samples glsl objviewer xdemos
# EGL directories
EGL_DRIVERS_DIRS = demo
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARY_DIRS = rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices
GALLIUM_AUXILIARY_DIRS = rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices vl
GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
GALLIUM_DRIVERS_DIRS = softpipe i915simple failover trace identity
GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 trace identity
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = xlib egl_xlib
GALLIUM_WINSYS_DRM_DIRS =

View File

@@ -23,11 +23,11 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -Wdeclaration-after-statement \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
-Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(X11_INCLUDES)
CXXFLAGS = -Wall -Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing

View File

@@ -4,5 +4,6 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g -ansi -pedantic
OPT_FLAGS = -g
CFLAGS += -ansi -pedantic
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -60,8 +60,8 @@ EGL_DRIVERS_DIRS = demo glx
DRIVER_DIRS = dri
WINDOW_SYSTEM = dri
GALLIUM_WINSYS_DIRS = drm
GALLIUM_WINSYS_DRM_DIRS = intel
GALLIUM_WINSYS_DRM_DIRS = vmware intel
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb swrast
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome ffb swrast

View File

@@ -11,6 +11,6 @@ ARCH_FLAGS = -DDEBUG
#DRI_DIRS = i915tex i915
#DRI_DIRS = i965
#DRI_DIRS = radeon r200 r300
#DRI_DIRS = unichrome sis trident
#DRI_DIRS = unichrome sis
#DRI_DIRS = i810 mga r128 tdfx

View File

@@ -68,5 +68,5 @@ WINDOW_SYSTEM=dri
# gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome ffb

View File

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR([bin])
AC_CANONICAL_HOST
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.3
LIBDRM_REQUIRED=2.4.15
DRI2PROTO_REQUIRED=1.99.3
dnl Check for progs
@@ -230,6 +230,8 @@ else
LIB_EXTENSION='dylib' ;;
cygwin* )
LIB_EXTENSION='dll' ;;
aix* )
LIB_EXTENSION='a' ;;
* )
LIB_EXTENSION='so' ;;
esac
@@ -417,7 +419,7 @@ WINDOW_SYSTEM=""
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_WINSYS_DIRS=""
GALLIUM_WINSYS_DRM_DIRS=""
GALLIUM_AUXILIARY_DIRS="rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices"
GALLIUM_AUXILIARY_DIRS="rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices vl"
GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
GALLIUM_STATE_TRACKERS_DIRS=""
@@ -647,6 +649,13 @@ AC_ARG_WITH([dri-driverdir],
[DRI_DRIVER_INSTALL_DIR="$withval"],
[DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
AC_SUBST([DRI_DRIVER_INSTALL_DIR])
dnl Extra search path for DRI drivers
AC_ARG_WITH([dri-searchpath],
[AS_HELP_STRING([--with-dri-searchpath=DIRS...],
[semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
[DRI_DRIVER_SEARCH_DIR="$withval"],
[DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
AC_SUBST([DRI_DRIVER_SEARCH_DIR])
dnl Direct rendering or just indirect rendering
AC_ARG_ENABLE([driglx-direct],
[AS_HELP_STRING([--disable-driglx-direct],
@@ -766,8 +775,8 @@ if test "$mesa_driver" = dri; then
# default drivers
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon s3v \
savage sis tdfx trident unichrome ffb swrast"
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
savage sis tdfx unichrome ffb swrast"
fi
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
@@ -1134,7 +1143,14 @@ yes)
GALLIUM_STATE_TRACKERS_DIRS=glx
;;
dri)
test "x$enable_egl" = xyes && GALLIUM_STATE_TRACKERS_DIRS=egl
GALLIUM_STATE_TRACKERS_DIRS="dri"
if test "x$enable_egl" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
fi
# Have only tested st/xorg on 1.6.0 servers
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0],
HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_XORG="no")
;;
esac
;;
@@ -1148,6 +1164,11 @@ yes)
if test "$tracker" = egl && test "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
if test "$tracker" = xorg; then
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
;;
@@ -1175,17 +1196,32 @@ AC_ARG_WITH([max-height],
[AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
)
dnl
dnl Gallium SVGA configuration
dnl
AC_ARG_ENABLE([gallium-svga],
[AS_HELP_STRING([--disable-gallium-svga],
[build gallium SVGA @<:@default=enabled@:>@])],
[enable_gallium_svga="$enableval"],
[enable_gallium_svga=yes])
if test "x$enable_gallium_svga" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
fi
dnl
dnl Gallium Intel configuration
dnl
AC_ARG_ENABLE([gallium-intel],
[AS_HELP_STRING([--disable-gallium-intel],
[build gallium intel @<:@default=enabled@:>@])],
[AS_HELP_STRING([--enable-gallium-intel],
[build gallium intel @<:@default=disabled@:>@])],
[enable_gallium_intel="$enableval"],
[enable_gallium_intel=yes])
[enable_gallium_intel=auto])
if test "x$enable_gallium_intel" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915simple"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
elif test "x$enable_gallium_intel" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
fi
dnl
@@ -1202,7 +1238,7 @@ if test "x$enable_gallium_radeon" = xyes; then
fi
dnl
dnl Gallium Radeon configuration
dnl Gallium Nouveau configuration
dnl
AC_ARG_ENABLE([gallium-nouveau],
[AS_HELP_STRING([--enable-gallium-nouveau],

View File

@@ -27,12 +27,6 @@ using the SDK with Visual Studio Express can be found at
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
If you are stuck using VC6 or VC7, you may start with these project
files, but you may need to modify them to reflect changes in the
Mesa source code tree. If you sucessfully update the project files,
please submit them to the author of this document so that they may
be included in the next distribution.
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
@@ -106,23 +100,6 @@ should build all the demos.
Build System Notes
----- ------ -----
VC6 (not actively supported)
---
Visual Studio 6 does not recognize files with the .cc extension as C++
language files, without a lot of unnatural tweaking. So, the VC6
build process uses custom build steps to compile these files in the
GLU library.
Two additional configurations are provided, Debug x86 and Release x86
that activate the shader code compilation by defining SLANG_86. It is
unknown if and how this works.
VC7 (not actively supported)
---
The above-mentioned .cc problem does not exist in this version.
VC8
---

View File

@@ -28,6 +28,7 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
and disable the GL_EXT_bar extension.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language options</a>
</ul>
<p>

View File

@@ -35,14 +35,14 @@
<h3>1.1 Prerequisites for DRI and hardware acceleration</h3>
<p>
The following are required for DRI-based hardware acceleration with Mesa 7.3:
The following are required for DRI-based hardware acceleration with Mesa:
</p>
<ul>
<li><a href="http://xorg.freedesktop.org/releases/individual/proto/">dri2proto</a> version 1.99.3 or later
<li>Linux 2.6.28
<li><a href="http://dri.freedesktop.org/libdrm/" target="_parent">libDRM</a>
version 2.4.3 or later
version 2.4.15 or later
<li>Xorg server version 1.5 or later
</ul>
</p>

197
docs/libGL.txt Normal file
View File

@@ -0,0 +1,197 @@
Introduction
------------
This document describes the implementation of the XFree86 4.0 libGL.so
library defined by the Linux/OpenGL Base specification found at
http://reality.sgi.com/opengl/linux/linuxbase.html.
The documentation is divided into two sections:
User's Guide
Driver Developer's Guide
Author: Brian Paul (brian@precisioninsight.com)
Date: February 2000
User's Guide
------------
Using libGL.so
The libGL.so library defines the gl- and glX-prefixed functions needed to
run OpenGL programs. OpenGL client applications should link with the
-lGL option to use it.
libGL.so serves two primary functions: GLX protocol generation for indirect
rendering and loading/management of hardware drivers for direct rendering.
When libGL.so initializes itself it uses the DRI to determine the
appropriate hardware driver for each screen on the local X display.
The hardware drivers are expected to be in the /usr/X11R6/lib/modules/dri/
directory. Drivers are named with the convention <name>_dri.so where
<name> is a driver such as "tdfx", "i810", "gamma", etc.
The LIBGL_DRIVERS_DIR environment variable may be used to specify a
different DRI modules directory, overriding /usr/X11R6/lib/modules/dri/.
This environment variable is ignored in setuid programs for security
reasons.
When libGL.so is unable to locate appropriate hardware drivers it will
fall back to using indirect GLX rendering.
To aid in solving problems, libGL.so will print diagnostic messages to
stderr if the LIBGL_DEBUG environment variable is defined.
libGL.so is thread safe. The overhead of thread safety for common,
single-thread clients is negligible. However, the overhead of thread
safety for multi-threaded clients is significant. Each GL API call
requires two calls to pthread_get_specific() which can noticably
impact performance. Warning: libGL.so is thread safe but individual
DRI drivers may not be. Please consult the documentation for a driver
to learn if it is thread safe.
Indirect Rendering
You can force indirect rendering mode by setting the LIBGL_ALWAYS_INDIRECT
environment variable. Hardware acceleration will not be used.
libGL.so Extensibility
libGL.so is designed to be extended without upgrading. That is,
drivers may install new OpenGL extension functions into libGL.so
without requiring libGL.so to be replaced. Clients of libGL.so should
use the glXGetProcAddressEXT() function to obtain the address of
functions by name. For more details of GLX_ARB_get_proc_address see
http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.spec
libGL.so is also designed with flexibility such that it may be used
with many generations of hardware drivers to come.
Driver Developer's Guide
------------------------
This section describes the requirements to make an XFree86 4.0
libGL.so-compatible hardware driver. It is not intended for end
users of libGL.so.
XFree86 source files
libGL.so is built inside XFree86 with sources found in xc/lib/GL/.
Specifically, libGL.so is built from:
xc/lib/GL/glx/*.c
xc/lib/dri/XF86dri.c
xc/lib/dri/dri_glx.c
xc/lib/GL/mesa/src/glapi.c
xc/lib/GL/mesa/src/glapitemp.h
xc/lib/GL/mesa/src/glapitable.h
xc/lib/GL/mesa/src/glapioffsets.h
xc/lib/GL/mesa/src/glapinoop.c
xc/lib/GL/mesa/src/glheader.h
xc/lib/GL/mesa/src/glthread.c
xc/lib/GL/mesa/src/glthread.h
xc/lib/GL/mesa/src/X86/glapi_x86.S
xc/lib/GL/mesa/src/X86/assyntax.h
Understand that the mesa/src/gl*.[ch] files are not tied to Mesa. They
have no dependencies on the rest of Mesa and are designed to be reusable
in a number of projects.
The glapi_x86.X and assyntax.h files implement x86-optimized dispatch
of GL functions. They are not required; C-based dispatch can be used
instead, with a slight performance penalty.
Driver loading and binding
When libGL.so initializes itself (via the __glXInitialize function) a
call is made to driCreateDisplay(). This function uses DRI facilities
to determine the driver file appropriate for each screen on the local
display. Each screen's driver is then opened with dlopen() and asked
for its __driCreateScreen() function. The pointers to the __driCreateScreen()
functions are kept in an array, indexed by screen number, in the
__DRIdisplayRec struct.
When a driver's __driCreateScreen() function is called, it must initialize
a __DRIscreenRec struct. This struct acts as the root of a tree of
function pointers which are called to create and destroy contexts and
drawables and perform all the operations needed by the GLX interface.
See the xc/lib/GL/glx/glxclient.h file for details.
Dynamic Extension Function Registration
In order to provide forward compatibility with future drivers, libGL.so
allows drivers to register new OpenGL extension functions which weren't
known when libGL.so was built.
The register_extensions() function in xc/lib/GL/dri/dri_glx.c is called
as soon as libGL.so is loaded. This is done with gcc's constructor
attribute. This mechanism will likely have to be changed for other compilers.
register_extensions() loops over all local displays and screens, determines
the DRI driver for each, and calls the driver's __driRegisterExtensions()
function, if present.
The __driRegisterExtensions() function can add new entrypoints to libGL
by calling:
GLboolean _glapi_add_entrypoint(const char *funcName, GLuint offset)
The parameters are the name of the function (such as "glFoobarEXT") and the
offset of the dispatch slot in the API dispatch table. The return value
indicates success (GL_TRUE) or failure (GL_FALSE).
_glapi_add_entrypoint() will synthesize entrypoint code in assembly
language. Assembly languages is required since parameter passing
can't be handled correctly using a C-based solution.
The address of the new entrypoint is obtained by calling the
glXGetProcAddressARB() function.
The dispatch offset number MUST be a number allocated by SGI in the same
manner in which new GL_* constants are allocated. Using an arbitrary
offset number will result in many problems.
Dispatch Management
When a GL context is made current, the driver must install its dispatch
table as the current dispatch table. This is done by calling
void _glapi_set_dispatch(struct _glapi_table *dispatch);
This will install the named dispatch table for the calling thread.
The current dispatch table for a thread can be obtained by calling
struct _glapi_table *_glapi_get_dispatch(void);
For higher performance in the common single-thread case, the global
variable _glapi_Dispatch will point to the current dispatch table.
This variable will be NULL when in multi-thread mode.
Context Management
libGL.so uses the XFree86 xthreads package to manage a thread-specific
current context pointer. See __glXGet/SetCurrentContext() in glext.c
Drivers may use the _glapi_set/get_context() functions to maintain
a private thread-specific context pointer.

View File

@@ -10,6 +10,24 @@
<H1>News</H1>
<h2>November XX, 2009</h2>
<p>
<a href="relnotes-7.6.1.html">Mesa 7.6.1</a> is released. This is a bug-fix
release fixing issues found in the 7.6 release.
</p>
<h2>September 28, 2009</h2>
<p>
<a href="relnotes-7.6.html">Mesa 7.6</a> is released. This is a new feature
release. Those especially concerned about stability may want to wait for the
follow-on 7.6.1 bug-fix release.
</p>
<p>
<a href="relnotes-7.5.2.html">Mesa 7.5.2</a> is also released.
This is a stable release fixing bugs since the 7.5.1 release.
</p>
<h2>September 3, 2009</h2>
<p>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.5.2 Release Notes, (date tbd)</H1>
<H1>Mesa 7.5.2 Release Notes, 28 September 2009</H1>
<p>
Mesa 7.5.2 is a bug-fix release fixing issues found since the 7.5.1 release.
@@ -31,7 +31,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
43a90191dd9f76cd65dcc1ac91f3be70 MesaLib-7.5.2.tar.gz
94e47a499f1226803869c2e37a6a8e3a MesaLib-7.5.2.tar.bz2
1ecb822b567ad67a0617361d45206b67 MesaLib-7.5.2.zip
2718fdce7e075911d6147beb8f27104b MesaDemos-7.5.2.tar.gz
4e0f5ccd58afe21eddcd94327d926e86 MesaDemos-7.5.2.tar.bz2
f621f8c223b278d7c8e49a012d56ca25 MesaDemos-7.5.2.zip
83c16c1d6bcfcc3f97aab5d2fe430b4c MesaGLUT-7.5.2.tar.gz
e5d03bedae369ea3705783573bb33813 MesaGLUT-7.5.2.tar.bz2
e82ba28e00d653e6f437d32be8ca8481 MesaGLUT-7.5.2.zip
</pre>
@@ -45,8 +53,15 @@ tbd
<ul>
<li>Assorted bug fixes for i965/i945 drivers
<li>Fixed Gallium glDrawPixels(GL_STENCIL_INDEX) failure.
<li>Fixed GLSL linker/preprocessor version directive issue seen in Wine
(such as bug 23946)
<li>glUseProgram() is now compiled into display lists (bug 23746).
<li>glUniform functions are now compiled into display lists
<li>Auto mipmap generation didn't work reliably with Gallium.
<li>Fixed random number usage in GLX code.
<li>Fixed invalid GL_OUT_OF_MEMORY error sometimes raised by glTexSubImage2D
when using Gallium.
</ul>
</body>
</html>

70
docs/relnotes-7.6.1.html Normal file
View File

@@ -0,0 +1,70 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.6.1 Release Notes, (date tbd)</H1>
<p>
Mesa 7.6.1 is a bug-fix release fixing issues since version 7.6.
</p>
<p>
Mesa 7.6.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
tbd
</pre>
<h2>New features</h2>
<ul>
<li>Upgraded GL/glext.h to version 56, GL/glxext.h to version 25,
GL/wglext.h to version 17
<li>New 3D driver, r600, for Radeon R6xx, R7xx hardware
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fixed crash caused by glXCopyContext() and glXDestroyContext(), bug 24217
<li>glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211)
<li>GLSL sqrt(0) returned unpredictable results
<li>Fixed default texture binding bug when a bound texture was deleted.
<li>r300: Work around an issue with very large fragment programs on R500.
<li>Fake glXQueryDrawable() didn't return good values (bug 24320)
<li>Fixed AUX buffer breakage (bug 24426).
<li>Fixed locale-dependent float parsing bug in GLSL compiler (bug 24531)
<li>Fixed Gallium Cell driver compilation failure.
<li>Fixed glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT) query so that
it returns the actual compressed format chosen.
<li>Fixed glBitmap bugs in Intel drivers.
<li>Fixed a number of Microsoft Visual Studio compilation problems.
<li>Fixed clipping / provoking vertex bugs in i965 driver.
<li>Assorted build fixes for AIX.
<li>Endianness fixes for the DRI swrast driver (bug 22767).</li>
<li>Point sprite fixes for i915/945 driver.
<li>Fixed assorted memory leaks (usually on error paths)
</ul>
<h2>Changes</h2>
<ul>
<li>Removed old VC6, VC7 project files for Windows
</ul>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.6 Release Notes / date TBD</H1>
<H1>Mesa 7.6 Release Notes, 28 September 2009</H1>
<p>
Mesa 7.6 is a new development release.
@@ -28,7 +28,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
5ffa7d7abf8973f57a1bc4f813e6dade MesaLib-7.6.tar.gz
8c75f90cd0303cfac9e4b6d54f6759ca MesaLib-7.6.tar.bz2
27fcfd69708599c978cb34ba5cd363e1 MesaLib-7.6.zip
e7befb3ae604f591806194a4da445628 MesaDemos-7.6.tar.gz
0ede7adf217951acd90dbe4551210c07 MesaDemos-7.6.tar.bz2
ed9298409cf6613bc0964525ca4afc8a MesaDemos-7.6.zip
666955668e44ff14acf7d15dc78407d3 MesaGLUT-7.6.tar.gz
b8b59706f827d18d1b784a0ff98b4dc2 MesaGLUT-7.6.tar.bz2
c49c19c2bbef4f3b7f1389974dff25f4 MesaGLUT-7.6.zip
</pre>
@@ -50,6 +58,8 @@ This was written by Zack Rusin at Tungsten Graphics.
<li>Rewritten radeon/r200/r300 driver using a buffer manager
<li>radeon/r200/r300 GL_EXT_framebuffer_object support when used with
kernel memory manager
<li>radeon/r200/r300 support for GL_ARB_occlusion_query</li>
<li>r300 driver supports OpenGL 1.5</li>
<li>r300 driver support for GL_EXT_vertex_array_bgra, GL_EXT_texture_sRGB
<li>i915/945 driver support for GL_ARB_point_sprite, GL_EXT_stencil_two_side
and GL_ATI_separate_stencil extensions
@@ -57,6 +67,10 @@ This was written by Zack Rusin at Tungsten Graphics.
GL_ARB_fragment_program.</li>
<li>Added configure --with-max-width=W, --with-max-height=H options to specify
max framebuffer, viewport size.
<li>Initial version of Gallium llvmpipe driver. This is a new driver based
on LLVM which makes exensive use of run-time code generation. This is
an "alpha" stage driver. See the src/gallium/drivers/llvmpipe/README
file for more information.
</ul>
@@ -66,10 +80,5 @@ This was written by Zack Rusin at Tungsten Graphics.
buffers (GLSL uniforms)
</ul>
<h2>Changes</h2>
<ul>
</ul>
</body>
</html>

View File

@@ -34,19 +34,28 @@ tbd
<h2>New features</h2>
<ul>
<li>VMware "SVGA" Gallium driver. This is a Gallium3D driver which targets the
VMware virtual graphics device. It allows Linux OpenGL guest applications
to utilize the 3D graphics hardware of the host operating system.
<li>GL_ARB_draw_elements_base_vertex (supported in Intel i965 and software drivers)</li>
<li>GL_ARB_depth_clamp (supported in Intel i965 DRI and software drivers)</li>
<li>GL_NV_depth_clamp (supported in Intel i965 DRI and software drivers)</li>
<li>GL_ARB_provoking_vertex (same as GL_EXT_provoking_vertex)</li>
<li>Wavefront .obj file loader/viewer demo (progs/demos/objviewer)
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Many assorted i965 driver fixes.
<li>Many r300-gallium driver fixes; this driver is now considered unstable-quality instead of experimental-quality.
</ul>
<h2>Changes</h2>
<ul>
<li>New Mesa texture/surface format infrastructure
<li>Removed some unused Mesa device driver hooks
</ul>
</body>

View File

@@ -14,6 +14,7 @@ The release notes summarize what's new or changed in each Mesa release.
<UL>
<LI><A HREF="relnotes-7.7.html">7.7 release notes</A>
<LI><A HREF="relnotes-7.6.1.html">7.6.1 release notes</A>
<LI><A HREF="relnotes-7.6.html">7.6 release notes</A>
<LI><A HREF="relnotes-7.5.2.html">7.5.2 release notes</A>
<LI><A HREF="relnotes-7.5.1.html">7.5.1 release notes</A>

View File

@@ -39,7 +39,8 @@ Contents
<p>
The <b>MESA_GLSL</b> environment variable can be set to a comma-separated
list of keywords to control some aspects of the GLSL compiler:
list of keywords to control some aspects of the GLSL compiler and shader
execution. These are generally used for debugging.
</p>
<ul>
<li>dump - print GLSL shader code to stdout at link time
@@ -49,6 +50,12 @@ list of keywords to control some aspects of the GLSL compiler:
<li>nopt - disable compiler optimizations
<li>opt - force compiler optimizations
<li>uniform - print message to stdout when glUniform is called
<li>nopvert - force vertex shaders to be a simple shader that just transforms
the vertex position with ftransform() and passes through the color and
texcoord[0] attributes.
<li>nopfrag - force fragment shader to be a simple shader that passes
through the color attribute.
<li>useprog - log glUseProgram calls to stderr
</ul>
<p>
Example: export MESA_GLSL=dump,nopt

View File

@@ -33,8 +33,7 @@
- Pipe drivers:
- \ref softpipe
- \ref i915simple
- Simple 965 driver (brw_context.h, brw_winsys.h)
- \ref i915g
- Cell driver (cell_context.h, cell_winsys.h)
- \ref failover
@@ -120,7 +119,7 @@
\sa sp_winsys.h
*/
/** \page i915simple Simple i915 Driver
/** \page i915g i915 Driver
The i915 Gallium3D Driver is an initial hardware driver implementation within
the Gallium3D driver architecture. We expect that once complete this driver
@@ -163,7 +162,7 @@
The Draw module is effectively the part of \ref softpipe which is concerned with
vertex processing, split off into a separate module so that it can be reused
by drivers for rasterization-only hardware. As such it is also instantiated
by the \ref i915simple driver.
by the \ref i915g driver.
Additionally, there are cases in the Mesa OpenGL state_tracker where it is
required to obtain transformed vertices and yet it is anticipated that using

View File

@@ -1740,6 +1740,9 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
/*
@@ -1945,6 +1948,18 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
/*
* GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
*/

View File

@@ -108,12 +108,20 @@
#define glBlendColorEXT MANGLE(BlendColorEXT)
#define glBlendColor MANGLE(BlendColor)
#define glBlendEquationEXT MANGLE(BlendEquationEXT)
#define glBlendEquationi MANGLE(BlendEquationi)
#define glBlendEquationIndexedAMD MANGLE(BlendEquationIndexedAMD)
#define glBlendEquation MANGLE(BlendEquation)
#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
#define glBlendEquationSeparatei MANGLE(BlendEquationSeparatei)
#define glBlendEquationSeparateIndexedAMD MANGLE(BlendEquationSeparateIndexedAMD)
#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
#define glBlendFunci MANGLE(BlendFunci)
#define glBlendFuncIndexedAMD MANGLE(BlendFuncIndexedAMD)
#define glBlendFunc MANGLE(BlendFunc)
#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
#define glBlendFuncSeparatei MANGLE(BlendFuncSeparatei)
#define glBlendFuncSeparateIndexedAMD MANGLE(BlendFuncSeparateIndexedAMD)
#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
@@ -148,6 +156,7 @@
#define glClientActiveTexture MANGLE(ClientActiveTexture)
#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
#define glClientAttribDefaultEXT MANGLE(ClientAttribDefaultEXT)
#define glClientWaitSync MANGLE(ClientWaitSync)
#define glClipPlane MANGLE(ClipPlane)
#define glColor3b MANGLE(Color3b)
#define glColor3bv MANGLE(Color3bv)
@@ -320,6 +329,7 @@
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
#define glDeleteShader MANGLE(DeleteShader)
#define glDeleteSync MANGLE(DeleteSync)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
@@ -341,6 +351,7 @@
#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
#define glDisable MANGLE(Disable)
#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
#define glDisableVertexAttribAPPLE MANGLE(DisableVertexAttribAPPLE)
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
@@ -354,7 +365,9 @@
#define glDrawBuffers MANGLE(DrawBuffers)
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
#define glDrawElementsInstanced MANGLE(DrawElementsInstanced)
#define glDrawElements MANGLE(DrawElements)
@@ -362,6 +375,7 @@
#define glDrawPixels MANGLE(DrawPixels)
#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE)
#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
@@ -378,6 +392,7 @@
#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
#define glEnable MANGLE(Enable)
#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
#define glEnableVertexAttribAPPLE MANGLE(EnableVertexAttribAPPLE)
#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
#define glEndConditionalRender MANGLE(EndConditionalRender)
@@ -409,6 +424,7 @@
#define glExecuteProgramNV MANGLE(ExecuteProgramNV)
#define glExtractComponentEXT MANGLE(ExtractComponentEXT)
#define glFeedbackBuffer MANGLE(FeedbackBuffer)
#define glFenceSync MANGLE(FenceSync)
#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV)
#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX)
#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE)
@@ -469,9 +485,11 @@
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
#define glFramebufferTextureFace MANGLE(FramebufferTextureFace)
#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
#define glFramebufferTexture MANGLE(FramebufferTexture)
#define glFrameTerminatorGREMEDY MANGLE(FrameTerminatorGREMEDY)
#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
@@ -523,6 +541,7 @@
#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
#define glGetBooleani_v MANGLE(GetBooleani_v)
#define glGetBooleanv MANGLE(GetBooleanv)
#define glGetBufferParameteri64v MANGLE(GetBufferParameteri64v)
#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
@@ -586,6 +605,8 @@
#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
#define glGetInfoLogARB MANGLE(GetInfoLogARB)
#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
#define glGetInteger64i_v MANGLE(GetInteger64i_v)
#define glGetInteger64v MANGLE(GetInteger64v)
#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
#define glGetIntegeri_v MANGLE(GetIntegeri_v)
#define glGetIntegerv MANGLE(GetIntegerv)
@@ -615,6 +636,7 @@
#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
#define glGetMultisamplefv MANGLE(GetMultisamplefv)
#define glGetMultisamplefvNV MANGLE(GetMultisamplefvNV)
#define glGetMultiTexEnvfvEXT MANGLE(GetMultiTexEnvfvEXT)
#define glGetMultiTexEnvivEXT MANGLE(GetMultiTexEnvivEXT)
@@ -642,6 +664,7 @@
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
#define glGetObjectParameterivAPPLE MANGLE(GetObjectParameterivAPPLE)
#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB)
#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
@@ -698,6 +721,7 @@
#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
#define glGetStringi MANGLE(GetStringi)
#define glGetString MANGLE(GetString)
#define glGetSynciv MANGLE(GetSynciv)
#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
#define glGetTexEnvfv MANGLE(GetTexEnvfv)
@@ -715,6 +739,7 @@
#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
#define glGetTexParameterIuiv MANGLE(GetTexParameterIuiv)
#define glGetTexParameteriv MANGLE(GetTexParameteriv)
#define glGetTexParameterPointervAPPLE MANGLE(GetTexParameterPointervAPPLE)
#define glGetTextureImageEXT MANGLE(GetTextureImageEXT)
#define glGetTextureLevelParameterfvEXT MANGLE(GetTextureLevelParameterfvEXT)
#define glGetTextureLevelParameterivEXT MANGLE(GetTextureLevelParameterivEXT)
@@ -825,12 +850,14 @@
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
#define glIsRenderbuffer MANGLE(IsRenderbuffer)
#define glIsShader MANGLE(IsShader)
#define glIsSync MANGLE(IsSync)
#define glIsTextureEXT MANGLE(IsTextureEXT)
#define glIsTexture MANGLE(IsTexture)
#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
#define glIsVertexArray MANGLE(IsVertexArray)
#define glIsVertexAttribEnabledAPPLE MANGLE(IsVertexAttribEnabledAPPLE)
#define glLightEnviSGIX MANGLE(LightEnviSGIX)
#define glLightf MANGLE(Lightf)
#define glLightfv MANGLE(Lightfv)
@@ -877,6 +904,10 @@
#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
#define glMapParameterfvNV MANGLE(MapParameterfvNV)
#define glMapParameterivNV MANGLE(MapParameterivNV)
#define glMapVertexAttrib1dAPPLE MANGLE(MapVertexAttrib1dAPPLE)
#define glMapVertexAttrib1fAPPLE MANGLE(MapVertexAttrib1fAPPLE)
#define glMapVertexAttrib2dAPPLE MANGLE(MapVertexAttrib2dAPPLE)
#define glMapVertexAttrib2fAPPLE MANGLE(MapVertexAttrib2fAPPLE)
#define glMaterialf MANGLE(Materialf)
#define glMaterialfv MANGLE(Materialfv)
#define glMateriali MANGLE(Materiali)
@@ -907,9 +938,11 @@
#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
#define glMinmaxEXT MANGLE(MinmaxEXT)
#define glMinmax MANGLE(Minmax)
#define glMinSampleShading MANGLE(MinSampleShading)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
#define glMultiDrawArrays MANGLE(MultiDrawArrays)
#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE)
#define glMultiDrawElementsBaseVertex MANGLE(MultiDrawElementsBaseVertex)
#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
#define glMultiDrawElements MANGLE(MultiDrawElements)
#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
@@ -1072,6 +1105,8 @@
#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
#define glNormalStream3sATI MANGLE(NormalStream3sATI)
#define glNormalStream3svATI MANGLE(NormalStream3svATI)
#define glObjectPurgeableAPPLE MANGLE(ObjectPurgeableAPPLE)
#define glObjectUnpurgeableAPPLE MANGLE(ObjectUnpurgeableAPPLE)
#define glOrtho MANGLE(Ortho)
#define glPassTexCoordATI MANGLE(PassTexCoordATI)
#define glPassThrough MANGLE(PassThrough)
@@ -1162,6 +1197,7 @@
#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
#define glProgramParameteriARB MANGLE(ProgramParameteriARB)
#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
#define glProgramParameteri MANGLE(ProgramParameteri)
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
@@ -1200,6 +1236,7 @@
#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
#define glProvokingVertexEXT MANGLE(ProvokingVertexEXT)
#define glProvokingVertex MANGLE(ProvokingVertex)
#define glPushAttrib MANGLE(PushAttrib)
#define glPushClientAttribDefaultEXT MANGLE(PushClientAttribDefaultEXT)
#define glPushClientAttrib MANGLE(PushClientAttrib)
@@ -1283,6 +1320,7 @@
#define glSampleCoverage MANGLE(SampleCoverage)
#define glSampleMapATI MANGLE(SampleMapATI)
#define glSampleMaskEXT MANGLE(SampleMaskEXT)
#define glSampleMaski MANGLE(SampleMaski)
#define glSampleMaskIndexedNV MANGLE(SampleMaskIndexedNV)
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
@@ -1454,8 +1492,10 @@
#define glTexGeniv MANGLE(TexGeniv)
#define glTexImage1D MANGLE(TexImage1D)
#define glTexImage2D MANGLE(TexImage2D)
#define glTexImage2DMultisample MANGLE(TexImage2DMultisample)
#define glTexImage3DEXT MANGLE(TexImage3DEXT)
#define glTexImage3D MANGLE(TexImage3D)
#define glTexImage3DMultisample MANGLE(TexImage3DMultisample)
#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
#define glTexParameterf MANGLE(TexParameterf)
#define glTexParameterfv MANGLE(TexParameterfv)
@@ -1487,6 +1527,7 @@
#define glTextureParameterIivEXT MANGLE(TextureParameterIivEXT)
#define glTextureParameterIuivEXT MANGLE(TextureParameterIuivEXT)
#define glTextureParameterivEXT MANGLE(TextureParameterivEXT)
#define glTextureRangeAPPLE MANGLE(TextureRangeAPPLE)
#define glTextureRenderbufferEXT MANGLE(TextureRenderbufferEXT)
#define glTextureSubImage1DEXT MANGLE(TextureSubImage1DEXT)
#define glTextureSubImage2DEXT MANGLE(TextureSubImage2DEXT)
@@ -1828,6 +1869,7 @@
#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
#define glViewport MANGLE(Viewport)
#define glWaitSync MANGLE(WaitSync)
#define glWeightbvARB MANGLE(WeightbvARB)
#define glWeightdvARB MANGLE(WeightdvARB)
#define glWeightfvARB MANGLE(WeightfvARB)

View File

@@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2009-08-03 02:13:51 -0700 (Mon, 03 Aug 2009) $ */
/* glext.h last updated $Date: 2009-09-24 13:55:03 -0700 (Thu, 24 Sep 2009) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 54
#define GL_GLEXT_VERSION 56
/* Function declaration macros - to move into glplatform.h */
@@ -4236,7 +4236,7 @@ extern "C" {
#define GL_LUMINANCE16_SNORM 0x9019
#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
#define GL_INTENSITY16_SNORM 0x901B
/* reuse GL_R_SNORM */
/* reuse GL_RED_SNORM */
/* reuse GL_RG_SNORM */
/* reuse GL_RGB_SNORM */
/* reuse GL_RGBA_SNORM */
@@ -4311,6 +4311,88 @@ extern "C" {
#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
#endif
#ifndef GL_APPLE_rgb_422
#define GL_RGB_422_APPLE 0x8A1F
/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */
/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */
#endif
#ifndef GL_NV_video_capture
#define GL_VIDEO_BUFFER_NV 0x9020
#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
#define GL_FIELD_UPPER_NV 0x9022
#define GL_FIELD_LOWER_NV 0x9023
#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
#define GL_PARTIAL_SUCCESS_NV 0x902E
#define GL_SUCCESS_NV 0x902F
#define GL_FAILURE_NV 0x9030
#define GL_YCBYCR8_422_NV 0x9031
#define GL_YCBAYCR8A_4224_NV 0x9032
#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
#endif
#ifndef GL_NV_copy_image
#endif
#ifndef GL_EXT_separate_shader_objects
#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
#endif
#ifndef GL_NV_parameter_buffer_object2
#endif
#ifndef GL_NV_shader_buffer_load
#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
#define GL_GPU_ADDRESS_NV 0x8F34
#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
#endif
#ifndef GL_NV_vertex_buffer_unified_memory
#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
#endif
#ifndef GL_NV_texture_barrier
#endif
/*************************************************************/
@@ -9245,6 +9327,136 @@ typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType,
#define GL_APPLE_row_bytes 1
#endif
#ifndef GL_APPLE_rgb_422
#define GL_APPLE_rgb_422 1
#endif
#ifndef GL_NV_video_capture
#define GL_NV_video_capture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint);
GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint, GLuint, GLenum, GLintptrARB);
GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint, GLuint, GLenum, GLenum, GLuint);
GLAPI void APIENTRY glEndVideoCaptureNV (GLuint);
GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint, GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint, GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint, GLuint, GLenum, GLdouble *);
GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint, GLuint *, GLuint64EXT *);
GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint, GLuint, GLenum, const GLint *);
GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint, GLuint, GLenum, const GLfloat *);
GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint, GLuint, GLenum, const GLdouble *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
#endif
#ifndef GL_NV_copy_image
#define GL_NV_copy_image 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCopyImageSubDataNV (GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifndef GL_EXT_separate_shader_objects
#define GL_EXT_separate_shader_objects 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUseShaderProgramEXT (GLenum, GLuint);
GLAPI void APIENTRY glActiveProgramEXT (GLuint);
GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum, const GLchar *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
#endif
#ifndef GL_NV_parameter_buffer_object2
#define GL_NV_parameter_buffer_object2 1
#endif
#ifndef GL_NV_shader_buffer_load
#define GL_NV_shader_buffer_load 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMakeBufferResidentNV (GLenum, GLenum);
GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum);
GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum);
GLAPI void APIENTRY glNamedMakeBufferResidentNV (GLuint, GLenum);
GLAPI void APIENTRY glNamedMakeBufferNonResidentNV (GLuint);
GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint);
GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum, GLenum, GLuint64EXT *);
GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint, GLenum, GLuint64EXT *);
GLAPI void APIENTRY glGetIntegerui64vNV (GLenum, GLuint64EXT *);
GLAPI void APIENTRY glUniformui64NV (GLint, GLuint64EXT);
GLAPI void APIENTRY glUniformui64vNV (GLint, GLsizei, const GLuint64EXT *);
GLAPI void APIENTRY glGetUniformui64vNV (GLuint, GLint, GLuint64EXT *);
GLAPI void APIENTRY glProgramUniformui64NV (GLuint, GLint, GLuint64EXT);
GLAPI void APIENTRY glProgramUniformui64vNV (GLuint, GLint, GLsizei, const GLuint64EXT *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
typedef void (APIENTRYP PFNGLNAMEDMAKEBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
typedef void (APIENTRYP PFNGLNAMEDMAKEBUFFERNONRESIDENTNVPROC) (GLuint buffer);
typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#endif
#ifndef GL_NV_vertex_buffer_unified_memory
#define GL_NV_vertex_buffer_unified_memory 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBufferAddressRangeNV (GLenum, GLuint, GLuint64EXT, GLsizeiptr);
GLAPI void APIENTRY glVertexFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glNormalFormatNV (GLenum, GLsizei);
GLAPI void APIENTRY glColorFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glIndexFormatNV (GLenum, GLsizei);
GLAPI void APIENTRY glTexCoordFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei);
GLAPI void APIENTRY glSecondaryColorFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glFogCoordFormatNV (GLenum, GLsizei);
GLAPI void APIENTRY glVertexAttribFormatNV (GLuint, GLint, GLenum, GLboolean, GLsizei);
GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint, GLint, GLenum, GLsizei);
GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum, GLuint, GLuint64EXT *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
#endif
#ifndef GL_NV_texture_barrier
#define GL_NV_texture_barrier 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTextureBarrierNV (void);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
#endif
#ifdef __cplusplus
}

View File

@@ -76,6 +76,7 @@
/* GLX 1.4 */
#define glXGetProcAddress mglXGetProcAddress
#define glXGetProcAddressARB mglXGetProcAddressARB
#endif

View File

@@ -48,9 +48,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2009/08/03 */
/* glxext.h last updated 2009/10/08 */
/* Current version at http://www.opengl.org/registry/ */
#define GLX_GLXEXT_VERSION 23
#define GLX_GLXEXT_VERSION 25
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
@@ -382,6 +382,20 @@ extern "C" {
#ifndef GLX_NV_swap_group
#endif
#ifndef GLX_NV_video_capture
#define GLX_DEVICE_ID_NV 0x20CD
#define GLX_UNIQUE_ID_NV 0x20CE
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#endif
#ifndef GLX_EXT_swap_control
#define GLX_SWAP_INTERVAL_EXT 0x20F1
#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
#endif
#ifndef GLX_NV_copy_image
#endif
/*************************************************************/
@@ -415,6 +429,14 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
#ifndef GLX_NV_video_output
typedef unsigned int GLXVideoDeviceNV;
#endif
#ifndef GLX_NV_video_capture
typedef XID GLXVideoCaptureDeviceNV;
#endif
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
@@ -827,14 +849,80 @@ typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawab
#ifndef GLX_NV_present_video
#define GLX_NV_present_video 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern unsigned int * glXEnumerateVideoDevicesNV (Display *, int, int *);
extern int glXBindVideoDeviceNV (Display *, unsigned int, unsigned int, const int *);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
#endif
#ifndef GLX_NV_video_out
#define GLX_NV_video_out 1
#ifndef GLX_NV_video_output
#define GLX_NV_video_output 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXGetVideoDeviceNV (Display *, int, int, GLXVideoDeviceNV *);
extern int glXReleaseVideoDeviceNV (Display *, int, GLXVideoDeviceNV);
extern int glXBindVideoImageNV (Display *, GLXVideoDeviceNV, GLXPbuffer, int);
extern int glXReleaseVideoImageNV (Display *, GLXPbuffer);
extern int glXSendPbufferToVideoNV (Display *, GLXPbuffer, int, unsigned long *, GLboolean);
extern int glXGetVideoInfoNV (Display *, int, GLXVideoDeviceNV, unsigned long *, unsigned long *);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
#ifndef GLX_NV_swap_group
#define GLX_NV_swap_group 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXJoinSwapGroupNV (Display *, GLXDrawable, GLuint);
extern Bool glXBindSwapBarrierNV (Display *, GLuint, GLuint);
extern Bool glXQuerySwapGroupNV (Display *, GLXDrawable, GLuint *, GLuint *);
extern Bool glXQueryMaxSwapGroupsNV (Display *, int, GLuint *, GLuint *);
extern Bool glXQueryFrameCountNV (Display *, int, GLuint *);
extern Bool glXResetFrameCountNV (Display *, int);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
#endif
#ifndef GLX_NV_video_capture
#define GLX_NV_video_capture 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXBindVideoCaptureDeviceNV (Display *, unsigned int, GLXVideoCaptureDeviceNV);
extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *, int, int *);
extern void glXLockVideoCaptureDeviceNV (Display *, GLXVideoCaptureDeviceNV);
extern int glXQueryVideoCaptureDeviceNV (Display *, GLXVideoCaptureDeviceNV, int, int *);
extern void glXReleaseVideoCaptureDeviceNV (Display *, GLXVideoCaptureDeviceNV);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
#endif
#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXSwapIntervalEXT (Display *, GLXDrawable, int);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
#endif
#ifndef GLX_NV_copy_image
#define GLX_NV_copy_image 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXCopyImageSubDataNV (Display *, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif

View File

@@ -48,9 +48,9 @@ extern "C" {
/*************************************************************/
/* Header file version number */
/* wglext.h last updated 2009/08/03 */
/* wglext.h last updated 2009/09/16 */
/* Current version at http://www.opengl.org/registry/ */
#define WGL_WGLEXT_VERSION 15
#define WGL_WGLEXT_VERSION 17
#ifndef WGL_ARB_buffer_region
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
@@ -388,6 +388,14 @@ extern "C" {
#define WGL_GPU_NUM_SPI_AMD 0x21A8
#endif
#ifndef NV_video_capture
#define WGL_UNIQUE_ID_NV 0x20CE
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#endif
#ifndef NV_copy_image
#endif
/*************************************************************/
@@ -400,7 +408,7 @@ DECLARE_HANDLE(HPBUFFEREXT);
#ifndef WGL_NV_present_video
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
#endif
#ifndef WGL_NV_video_out
#ifndef WGL_NV_video_output
DECLARE_HANDLE(HPVIDEODEV);
#endif
#ifndef WGL_NV_gpu_affinity
@@ -415,6 +423,9 @@ typedef struct _GPU_DEVICE {
RECT rcVirtualScreen;
} GPU_DEVICE, *PGPU_DEVICE;
#endif
#ifndef WGL_NV_video_capture
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
#endif
#ifndef WGL_ARB_buffer_region
#define WGL_ARB_buffer_region 1
@@ -750,8 +761,8 @@ typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVide
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
#endif
#ifndef WGL_NV_video_out
#define WGL_NV_video_out 1
#ifndef WGL_NV_video_output
#define WGL_NV_video_output 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetVideoDeviceNV (HDC, int, HPVIDEODEV *);
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV);
@@ -826,6 +837,30 @@ typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif
#ifndef WGL_NV_video_capture
#define WGL_NV_video_capture 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT, HVIDEOINPUTDEVICENV);
extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC, HVIDEOINPUTDEVICENV *);
extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC, HVIDEOINPUTDEVICENV);
extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC, HVIDEOINPUTDEVICENV, int, int *);
extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC, HVIDEOINPUTDEVICENV);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#endif
#ifndef WGL_NV_copy_image
#define WGL_NV_copy_image 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC, GLuint, GLenum, GLint, GLint, GLint, GLint, HGLRC, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifdef __cplusplus
}

1
progs/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.dSYM

View File

@@ -15,7 +15,7 @@ message:
subdirs:
@for dir in $(SUBDIRS) ; do \
@list='$(SUBDIRS)'; for dir in $$list ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
@@ -25,7 +25,7 @@ subdirs:
install:
clean:
-@for dir in $(SUBDIRS) tests ; do \
@list='$(SUBDIRS)'; for dir in $$list tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \

View File

@@ -10,4 +10,5 @@ SConscript([
'vpglsl/SConscript',
'fp/SConscript',
'wgl/SConscript',
'perf/SConscript',
])

View File

@@ -58,6 +58,9 @@ static GLint ClampIndex = 0;
static GLboolean supportFBO = GL_FALSE;
static GLboolean supportSeamless = GL_FALSE;
static GLboolean seamless = GL_FALSE;
static GLuint TexObj = 0;
static GLint T0 = 0;
static GLint Frames = 0;
static struct {
@@ -282,6 +285,20 @@ static void draw( void )
glPopMatrix();
glutSwapBuffers();
Frames++;
{
GLint t = glutGet(GLUT_ELAPSED_TIME);
if (t - T0 >= 5000) {
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
fflush(stdout);
T0 = t;
Frames = 0;
}
}
}
@@ -543,6 +560,10 @@ static void init( GLboolean useImageFiles )
printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
glGenTextures(1, &TexObj);
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, TexObj);
if (useImageFiles) {
load_envmaps();
}

View File

@@ -938,7 +938,14 @@ reshape(int width, int height)
static void
init_fbotexture()
{
static const GLenum depthFormats[] = {
GL_DEPTH_COMPONENT,
GL_DEPTH_COMPONENT16,
GL_DEPTH_COMPONENT32
};
static int numDepthFormats = sizeof(depthFormats) / sizeof(depthFormats[0]);
GLint i;
GLenum stat;
/* gen framebuffer id, delete it, do some assertions, just for testing */
glGenFramebuffersEXT(1, &MyFB);
@@ -969,18 +976,31 @@ init_fbotexture()
/* make depth renderbuffer */
glGenRenderbuffersEXT(1, &DepthRB);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
TexWidth, TexHeight);
CheckError(__LINE__);
/* we may have to try several formats */
for (i = 0; i < numDepthFormats; i++) {
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, depthFormats[i],
TexWidth, TexHeight);
CheckError(__LINE__);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, DepthRB);
CheckError(__LINE__);
stat = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (stat == GL_FRAMEBUFFER_COMPLETE_EXT) {
break;
}
}
if (stat != GL_FRAMEBUFFER_COMPLETE_EXT) {
fprintf(stderr, "Error: unable to get usable FBO combination!\n");
exit(1);
}
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
CheckError(__LINE__);
printf("Depth renderbuffer size = %d bits\n", i);
/* attach DepthRB to MyFB */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, DepthRB);
CheckError(__LINE__);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
/*

View File

@@ -15,8 +15,6 @@
#define DEPTH 5.0f
static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
static GLfloat camz;
static GLint fogMode;

View File

@@ -353,6 +353,7 @@ MakeSphere(void)
glNewList(SphereList, GL_COMPILE);
gluSphere(obj, 2.0f, 10, 5);
glEndList();
gluDeleteQuadric(obj);
}
static void

View File

@@ -133,6 +133,8 @@ initdlists(void)
glEndList();
}
gluDeleteQuadric(obj);
}
static void

View File

@@ -43,6 +43,7 @@ static GLboolean Anim = GL_TRUE;
static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
static GLint BiasMin = -400, BiasMax = 400;
static int win = 0;
static GLuint TexObj = 0;
static void
@@ -214,6 +215,9 @@ static void Init( void )
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &TexObj);
glBindTexture(GL_TEXTURE_2D, TexObj);
if (glutExtensionSupported("GL_SGIS_generate_mipmap")) {
/* test auto mipmap generation */
GLint width, height, i;

View File

@@ -887,5 +887,6 @@ int main(int argc, char **argv)
glutIdleFunc( idle_ );
glutDisplayFunc( draw );
glutMainLoop();
return 0;
}

View File

@@ -27,6 +27,8 @@
#define ANIMATE 10
#define QUIT 100
static GLint T0 = 0;
static GLint Frames = 0;
static GLboolean Animate = GL_TRUE;
static GLint NumUnits = 1;
static GLboolean TexEnabled[8];
@@ -105,6 +107,20 @@ static void Display( void )
glPopMatrix();
glutSwapBuffers();
Frames++;
{
GLint t = glutGet(GLUT_ELAPSED_TIME);
if (t - T0 >= 5000) {
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
fflush(stdout);
T0 = t;
Frames = 0;
}
}
}

View File

@@ -245,6 +245,10 @@ loadImageTextures(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
free(texData3);
free(texData4);
free(image);
}
}

View File

@@ -834,6 +834,8 @@ initdlists(void)
gluQuadricTexture(obj, GL_TRUE);
gluSphere(obj, SPHERE_RADIUS, 16, 16);
glEndList();
gluDeleteQuadric(obj);
}
int

View File

@@ -57,7 +57,7 @@ Idle(void)
{
Xrot = glutGet(GLUT_ELAPSED_TIME) * 0.02;
Yrot = glutGet(GLUT_ELAPSED_TIME) * 0.04;
//Zrot += 2.0;
/*Zrot += 2.0;*/
glutPostRedisplay();
}

View File

@@ -34,14 +34,9 @@ TestScreens(EGLDisplay dpy)
* Print table of all available configurations.
*/
static void
PrintConfigs(EGLDisplay d)
PrintConfigs(EGLDisplay d, EGLConfig *configs, EGLint numConfigs)
{
EGLConfig *configs;
EGLint numConfigs, i;
eglGetConfigs(d, NULL, 0, &numConfigs);
configs = malloc(sizeof(*configs) *numConfigs);
eglGetConfigs(d, configs, numConfigs, &numConfigs);
EGLint i;
printf("Configurations:\n");
printf(" bf lv d st colorbuffer dp st supported \n");
@@ -83,7 +78,6 @@ PrintConfigs(EGLDisplay d)
red, green, blue, alpha,
depth, stencil, surfString);
}
free(configs);
}
@@ -94,7 +88,8 @@ main(int argc, char *argv[])
int maj, min;
EGLContext ctx;
EGLSurface pbuffer;
EGLConfig configs[10];
EGLConfig *configs;
EGLint numConfigs;
EGLBoolean b;
const EGLint pbufAttribs[] = {
EGL_WIDTH, 500,
@@ -102,10 +97,7 @@ main(int argc, char *argv[])
EGL_NONE
};
/*
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
*/
EGLDisplay d = eglGetDisplay((EGLNativeDisplayType) "!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
@@ -116,7 +108,11 @@ main(int argc, char *argv[])
printf("EGL version = %d.%d\n", maj, min);
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
PrintConfigs(d);
eglGetConfigs(d, NULL, 0, &numConfigs);
configs = malloc(sizeof(*configs) *numConfigs);
eglGetConfigs(d, configs, numConfigs, &numConfigs);
PrintConfigs(d, configs, numConfigs);
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
if (ctx == EGL_NO_CONTEXT) {
@@ -130,6 +126,8 @@ main(int argc, char *argv[])
return 0;
}
free(configs);
b = eglMakeCurrent(d, pbuffer, pbuffer, ctx);
if (!b) {
printf("make current failed\n");

View File

@@ -7,6 +7,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <EGL/egl.h>
@@ -119,10 +120,7 @@ main(int argc, char *argv[])
EGLScreenMESA screen;
EGLint count;
/*
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
*/
EGLDisplay d = eglGetDisplay((EGLNativeDisplayType) "!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
@@ -132,6 +130,11 @@ main(int argc, char *argv[])
printf("EGL version = %d.%d\n", maj, min);
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
"EGL_MESA_screen_surface")) {
printf("EGL_MESA_screen_surface is not supported\n");
exit(1);
}
eglGetConfigs(d, configs, 10, &numConfigs);
printf("Got %d EGL configs:\n", numConfigs);

View File

@@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -551,15 +552,6 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
}
}
#include "../../src/egl/main/egldisplay.h"
typedef struct fb_display
{
_EGLDisplay Base; /* base class/object */
void *pFB;
} fbDisplay;
int
main(int argc, char *argv[])
{
@@ -571,16 +563,14 @@ main(int argc, char *argv[])
EGLModeMESA mode;
EGLint numConfigs, count;
EGLBoolean b;
const GLubyte *bitmap;
const EGLint screenAttribs[] = {
EGL_WIDTH, 1024,
EGL_HEIGHT, 768,
EGL_NONE
};
/*
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
*/
EGLDisplay d = eglGetDisplay("!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
@@ -590,6 +580,11 @@ main(int argc, char *argv[])
printf("EGL version = %d.%d\n", maj, min);
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
"EGL_MESA_screen_surface")) {
printf("EGL_MESA_screen_surface is not supported\n");
exit(1);
}
eglGetConfigs(d, configs, 10, &numConfigs);
eglGetScreensMESA(d, &screen, 1, &count);
@@ -620,17 +615,24 @@ main(int argc, char *argv[])
Init();
Reshape(1024, 768);
/* some drivers crash when rendering to front buffer */
#if 0
glDrawBuffer( GL_FRONT );
glClearColor( 0, 1.0, 0, 1);
glClear( GL_COLOR_BUFFER_BIT );
#endif
doubleBuffer = 1;
glDrawBuffer( GL_BACK );
Draw(d, screen_surf);
sleep(2);
write_ppm("dump.ppm", ((struct fb_display *)_eglLookupDisplay(d))->pFB, 1024, 768);
/* TODO EGL_KHR_lock_surface */
bitmap = NULL;
if (bitmap)
write_ppm("dump.ppm", bitmap, 1024, 768);
eglDestroySurface(d, screen_surf);
eglDestroyContext(d, ctx);

View File

@@ -274,10 +274,10 @@ draw(void)
static void
reshape(int width, int height)
{
glViewport(0, 0, (GLint) width, (GLint) height);
GLfloat h = (GLfloat) height / (GLfloat) width;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
@@ -333,6 +333,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
double st = current_time();
double ct = st;
int frames = 0;
GLfloat seconds, fps;
while (ct - st < ttr)
{
double tt = current_time();
@@ -352,8 +354,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
frames++;
}
GLfloat seconds = ct - st;
GLfloat fps = frames / seconds;
seconds = ct - st;
fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
}
@@ -388,7 +390,7 @@ main(int argc, char *argv[])
}
/* DBR : Create EGL context/surface etc */
d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
assert(d);
if (!eglInitialize(d, &maj, &min)) {

View File

@@ -147,8 +147,7 @@ int
main(int argc, char *argv[])
{
int maj, min;
//EGLDisplay d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
EGLDisplay d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (!eglInitialize(d, &maj, &min)) {
printf("eglinfo: eglInitialize failed\n");

View File

@@ -55,7 +55,7 @@ main(int argc, char *argv[])
EGLint count, chosenMode;
EGLint width = 0, height = 0;
d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
assert(d);
if (!eglInitialize(d, &maj, &min)) {

View File

@@ -127,12 +127,11 @@ static void run(EGLDisplay dpy, EGLSurface surf, int ttr)
double st = current_time();
double ct = st;
int frames = 0;
GLfloat seconds, fps;
while (ct - st < ttr)
{
double tt = current_time();
double dt = tt - ct;
ct = tt;
ct = current_time();
draw();
@@ -141,8 +140,8 @@ static void run(EGLDisplay dpy, EGLSurface surf, int ttr)
frames++;
}
GLfloat seconds = ct - st;
GLfloat fps = frames / seconds;
seconds = ct - st;
fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
}
@@ -174,7 +173,7 @@ int main(int argc, char *argv[])
}
/* DBR : Create EGL context/surface etc */
d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
assert(d);
if (!eglInitialize(d, &maj, &min)) {

View File

@@ -274,10 +274,10 @@ draw(void)
static void
reshape(int width, int height)
{
glViewport(0, 0, (GLint) width, (GLint) height);
GLfloat h = (GLfloat) height / (GLfloat) width;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
@@ -333,6 +333,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
double st = current_time();
double ct = st;
int frames = 0;
GLfloat seconds, fps;
while (ct - st < ttr)
{
double tt = current_time();
@@ -352,8 +354,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
frames++;
}
GLfloat seconds = ct - st;
GLfloat fps = frames / seconds;
seconds = ct - st;
fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
}
@@ -385,7 +387,7 @@ main(int argc, char *argv[])
}
/* DBR : Create EGL context/surface etc */
d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
assert(d);
if (!eglInitialize(d, &major, &minor)) {

View File

@@ -95,9 +95,6 @@ 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 GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */
/*
*
* Draw a gear wheel. You'll probably want to call this function when
@@ -327,122 +324,235 @@ init(void)
}
/*
* Create an RGB, double-buffered X window.
* Return the window and context handles.
*/
static void
make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
const char *name,
int x, int y, int width, int height,
Window *winRet,
EGLContext *ctxRet,
EGLSurface *surfRet)
{
static const EGLint attribs[] = {
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
/*EGL_DOUBLEBUFFER,*/
EGL_DEPTH_SIZE, 1,
EGL_NONE
};
struct egl_manager {
EGLNativeDisplayType xdpy;
EGLNativeWindowType xwin;
EGLNativePixmapType xpix;
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visInfo, visTemplate;
int num_visuals;
EGLDisplay dpy;
EGLConfig conf;
EGLContext ctx;
EGLConfig config;
EGLint num_configs, vid;
scrnum = DefaultScreen( x_dpy );
root = RootWindow( x_dpy, scrnum );
EGLSurface win;
EGLSurface pix;
EGLSurface pbuf;
EGLBoolean verbose;
EGLint major, minor;
};
static struct egl_manager *
egl_manager_new(EGLNativeDisplayType xdpy, const EGLint *attrib_list,
EGLBoolean verbose)
{
struct egl_manager *eman;
const char *ver;
EGLint num_conf;
eman = calloc(1, sizeof(*eman));
if (!eman)
return NULL;
eman->verbose = verbose;
eman->xdpy = xdpy;
eman->dpy = eglGetDisplay(eman->xdpy);
if (eman->dpy == EGL_NO_DISPLAY) {
printf("eglGetDisplay() failed\n");
free(eman);
return NULL;
}
if (!eglInitialize(eman->dpy, &eman->major, &eman->minor)) {
printf("eglInitialize() failed\n");
free(eman);
return NULL;
}
ver = eglQueryString(eman->dpy, EGL_VERSION);
printf("EGL_VERSION = %s\n", ver);
if (!eglChooseConfig(eman->dpy, attrib_list, &eman->conf, 1, &num_conf) ||
!num_conf) {
printf("eglChooseConfig() failed\n");
eglTerminate(eman->dpy);
free(eman);
return NULL;
}
eman->ctx = eglCreateContext(eman->dpy, eman->conf, EGL_NO_CONTEXT, NULL);
if (eman->ctx == EGL_NO_CONTEXT) {
printf("eglCreateContext() failed\n");
eglTerminate(eman->dpy);
free(eman);
return NULL;
}
return eman;
}
static EGLBoolean
egl_manager_create_window(struct egl_manager *eman, const char *name,
EGLint w, EGLint h, EGLBoolean need_surface,
EGLBoolean fullscreen, const EGLint *attrib_list)
{
XVisualInfo vinfo_template, *vinfo = NULL;
EGLint val, num_vinfo;
Window root;
XSetWindowAttributes attrs;
unsigned long mask;
EGLint x = 0, y = 0;
if (!eglGetConfigAttrib(eman->dpy, eman->conf,
EGL_NATIVE_VISUAL_ID, &val)) {
printf("eglGetConfigAttrib() failed\n");
return EGL_FALSE;
}
if (val) {
vinfo_template.visualid = (VisualID) val;
vinfo = XGetVisualInfo(eman->xdpy, VisualIDMask, &vinfo_template, &num_vinfo);
}
/* try harder if window surface is not needed */
if (!vinfo && !need_surface &&
eglGetConfigAttrib(eman->dpy, eman->conf, EGL_BUFFER_SIZE, &val)) {
if (val == 32)
val = 24;
vinfo_template.depth = val;
vinfo = XGetVisualInfo(eman->xdpy, VisualDepthMask, &vinfo_template, &num_vinfo);
}
if (!vinfo) {
printf("XGetVisualInfo() failed\n");
return EGL_FALSE;
}
root = DefaultRootWindow(eman->xdpy);
if (fullscreen) {
x = 0; y = 0;
width = DisplayWidth( x_dpy, scrnum );
height = DisplayHeight( x_dpy, scrnum );
}
if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
printf("Error: couldn't get an EGL visual config\n");
exit(1);
}
if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
printf("Error: eglGetConfigAttrib() failed\n");
exit(1);
}
/* The X window visual must match the EGL config */
visTemplate.visualid = vid;
visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
if (!visInfo) {
printf("Error: couldn't get X visual\n");
exit(1);
x = y = 0;
w = DisplayWidth(eman->xdpy, DefaultScreen(eman->xdpy));
h = DisplayHeight(eman->xdpy, DefaultScreen(eman->xdpy));
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
attr.override_redirect = fullscreen;
attrs.background_pixel = 0;
attrs.border_pixel = 0;
attrs.colormap = XCreateColormap(eman->xdpy, root, vinfo->visual, AllocNone);
attrs.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
attrs.override_redirect = fullscreen;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
win = XCreateWindow( x_dpy, root, 0, 0, width, height,
0, visInfo->depth, InputOutput,
visInfo->visual, mask, &attr );
eman->xwin = XCreateWindow(eman->xdpy, root, x, y, w, h,
0, vinfo->depth, InputOutput,
vinfo->visual, mask, &attrs);
XFree(vinfo);
/* set hints and properties */
{
XSizeHints sizehints;
sizehints.x = x;
sizehints.y = y;
sizehints.width = width;
sizehints.height = height;
sizehints.width = w;
sizehints.height = h;
sizehints.flags = USSize | USPosition;
XSetNormalHints(x_dpy, win, &sizehints);
XSetStandardProperties(x_dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
XSetNormalHints(eman->xdpy, eman->xwin, &sizehints);
XSetStandardProperties(eman->xdpy, eman->xwin, name, name,
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI(EGL_OPENGL_API);
ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
if (!ctx) {
printf("Error: glXCreateContext failed\n");
exit(1);
if (need_surface) {
eman->win = eglCreateWindowSurface(eman->dpy, eman->conf,
eman->xwin, attrib_list);
if (eman->win == EGL_NO_SURFACE) {
printf("eglCreateWindowSurface() failed\n");
XDestroyWindow(eman->xdpy, eman->xwin);
eman->xwin = None;
return EGL_FALSE;
}
}
*surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
XMapWindow(eman->xdpy, eman->xwin);
XFree(visInfo);
*winRet = win;
*ctxRet = ctx;
return EGL_TRUE;
}
static EGLBoolean
egl_manager_create_pixmap(struct egl_manager *eman, EGLNativeWindowType xwin,
EGLBoolean need_surface, const EGLint *attrib_list)
{
XWindowAttributes attrs;
if (!XGetWindowAttributes(eman->xdpy, xwin, &attrs)) {
printf("XGetWindowAttributes() failed\n");
return EGL_FALSE;
}
eman->xpix = XCreatePixmap(eman->xdpy, xwin,
attrs.width, attrs.height, attrs.depth);
if (need_surface) {
eman->pix = eglCreatePixmapSurface(eman->dpy, eman->conf,
eman->xpix, attrib_list);
if (eman->pix == EGL_NO_SURFACE) {
printf("eglCreatePixmapSurface() failed\n");
XFreePixmap(eman->xdpy, eman->xpix);
eman->xpix = None;
return EGL_FALSE;
}
}
return EGL_TRUE;
}
static EGLBoolean
egl_manager_create_pbuffer(struct egl_manager *eman, const EGLint *attrib_list)
{
eman->pbuf = eglCreatePbufferSurface(eman->dpy, eman->conf, attrib_list);
if (eman->pbuf == EGL_NO_SURFACE) {
printf("eglCreatePbufferSurface() failed\n");
return EGL_FALSE;
}
return EGL_TRUE;
}
static void
event_loop(Display *dpy, Window win,
EGLDisplay egl_dpy, EGLSurface egl_surf)
egl_manager_destroy(struct egl_manager *eman)
{
eglMakeCurrent(eman->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglTerminate(eman->dpy);
if (eman->xwin != None)
XDestroyWindow(eman->xdpy, eman->xwin);
if (eman->xpix != None)
XFreePixmap(eman->xdpy, eman->xpix);
free(eman);
}
static void
event_loop(struct egl_manager *eman, EGLint surface_type, EGLint w, EGLint h)
{
GC gc = XCreateGC(eman->xdpy, eman->xwin, 0, NULL);
EGLint orig_w = w, orig_h = h;
if (surface_type == EGL_PBUFFER_BIT)
printf("there will be no screen update if "
"eglCopyBuffers() is not implemented\n");
while (1) {
while (XPending(dpy) > 0) {
while (XPending(eman->xdpy) > 0) {
XEvent event;
XNextEvent(dpy, &event);
XNextEvent(eman->xdpy, &event);
switch (event.type) {
case Expose:
case Expose:
/* we'll redraw below */
break;
case ConfigureNotify:
reshape(event.xconfigure.width, event.xconfigure.height);
break;
break;
case ConfigureNotify:
w = event.xconfigure.width;
h = event.xconfigure.height;
if (surface_type == EGL_WINDOW_BIT)
reshape(w, h);
break;
case KeyPress:
{
char buffer[10];
@@ -476,6 +586,7 @@ event_loop(Display *dpy, Window win,
static int frames = 0;
static double tRot0 = -1.0, tRate0 = -1.0;
double dt, t = current_time();
int x, y;
if (tRot0 < 0.0)
tRot0 = t;
dt = t - tRot0;
@@ -487,7 +598,25 @@ event_loop(Display *dpy, Window win,
angle -= 3600.0;
draw();
eglSwapBuffers(egl_dpy, egl_surf);
switch (surface_type) {
case EGL_WINDOW_BIT:
eglSwapBuffers(eman->dpy, eman->win);
break;
case EGL_PBUFFER_BIT:
eglWaitClient();
if (!eglCopyBuffers(eman->xdpy, eman->pbuf, eman->xpix))
break;
/* fall through */
case EGL_PIXMAP_BIT:
eglWaitClient();
for (x = 0; x < w; x += orig_w) {
for (y = 0; y < h; y += orig_h) {
XCopyArea(eman->xdpy, eman->xpix, eman->xwin, gc,
0, 0, orig_w, orig_h, x, y);
}
}
break;
}
frames++;
@@ -503,6 +632,8 @@ event_loop(Display *dpy, Window win,
}
}
}
XFreeGC(eman->xdpy, gc);
}
@@ -513,6 +644,8 @@ usage(void)
printf(" -display <displayname> set the display to run on\n");
printf(" -fullscreen run in fullscreen mode\n");
printf(" -info display OpenGL renderer info\n");
printf(" -pixmap use pixmap surface\n");
printf(" -pbuffer use pbuffer surface\n");
}
@@ -521,15 +654,23 @@ main(int argc, char *argv[])
{
const int winWidth = 300, winHeight = 300;
Display *x_dpy;
Window win;
EGLSurface egl_surf;
EGLContext egl_ctx;
EGLDisplay egl_dpy;
char *dpyName = NULL;
struct egl_manager *eman;
EGLint attribs[] = {
EGL_SURFACE_TYPE, 0, /* filled later */
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_DEPTH_SIZE, 1,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};
char win_title[] = "xeglgears (window/pixmap/pbuffer)";
EGLint surface_type = EGL_WINDOW_BIT;
GLboolean printInfo = GL_FALSE;
EGLint egl_major, egl_minor;
GLboolean fullscreen = GL_FALSE;
EGLBoolean ret;
int i;
const char *s;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-display") == 0) {
@@ -542,12 +683,21 @@ main(int argc, char *argv[])
else if (strcmp(argv[i], "-fullscreen") == 0) {
fullscreen = GL_TRUE;
}
else if (strcmp(argv[i], "-pixmap") == 0) {
surface_type = EGL_PIXMAP_BIT;
}
else if (strcmp(argv[i], "-pbuffer") == 0) {
surface_type = EGL_PBUFFER_BIT;
}
else {
usage();
return -1;
}
}
/* set surface type */
attribs[1] = surface_type;
x_dpy = XOpenDisplay(dpyName);
if (!x_dpy) {
printf("Error: couldn't open display %s\n",
@@ -555,26 +705,60 @@ main(int argc, char *argv[])
return -1;
}
egl_dpy = eglGetDisplay(x_dpy);
if (!egl_dpy) {
printf("Error: eglGetDisplay() failed\n");
eglBindAPI(EGL_OPENGL_API);
eman = egl_manager_new(x_dpy, attribs, printInfo);
if (!eman) {
XCloseDisplay(x_dpy);
return -1;
}
if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
printf("Error: eglInitialize() failed\n");
return -1;
snprintf(win_title, sizeof(win_title), "xeglgears (%s)",
(surface_type == EGL_WINDOW_BIT) ? "window" :
(surface_type == EGL_PIXMAP_BIT) ? "pixmap" : "pbuffer");
/* create surface(s) */
switch (surface_type) {
case EGL_WINDOW_BIT:
ret = egl_manager_create_window(eman, win_title, winWidth, winHeight,
EGL_TRUE, fullscreen, NULL);
if (ret)
ret = eglMakeCurrent(eman->dpy, eman->win, eman->win, eman->ctx);
break;
case EGL_PIXMAP_BIT:
ret = (egl_manager_create_window(eman, win_title, winWidth, winHeight,
EGL_FALSE, fullscreen, NULL) &&
egl_manager_create_pixmap(eman, eman->xwin,
EGL_TRUE, NULL));
if (ret)
ret = eglMakeCurrent(eman->dpy, eman->pix, eman->pix, eman->ctx);
break;
case EGL_PBUFFER_BIT:
{
EGLint pbuf_attribs[] = {
EGL_WIDTH, winWidth,
EGL_HEIGHT, winHeight,
EGL_NONE
};
ret = (egl_manager_create_window(eman, win_title, winWidth, winHeight,
EGL_FALSE, fullscreen, NULL) &&
egl_manager_create_pixmap(eman, eman->xwin,
EGL_FALSE, NULL) &&
egl_manager_create_pbuffer(eman, pbuf_attribs));
if (ret)
ret = eglMakeCurrent(eman->dpy, eman->pbuf, eman->pbuf, eman->ctx);
}
break;
default:
ret = EGL_FALSE;
break;
}
s = eglQueryString(egl_dpy, EGL_VERSION);
printf("EGL_VERSION = %s\n", s);
make_x_window(x_dpy, egl_dpy,
"glxgears", 0, 0, winWidth, winHeight,
&win, &egl_ctx, &egl_surf);
XMapWindow(x_dpy, win);
eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx);
if (!ret) {
egl_manager_destroy(eman);
XCloseDisplay(x_dpy);
return -1;
}
if (printInfo) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
@@ -590,18 +774,13 @@ main(int argc, char *argv[])
*/
reshape(winWidth, winHeight);
event_loop(x_dpy, win, egl_dpy, egl_surf);
event_loop(eman, surface_type, winWidth, winHeight);
glDeleteLists(gear1, 1);
glDeleteLists(gear2, 1);
glDeleteLists(gear3, 1);
eglDestroyContext(egl_dpy, egl_ctx);
eglDestroySurface(egl_dpy, egl_surf);
eglTerminate(egl_dpy);
XDestroyWindow(x_dpy, win);
egl_manager_destroy(eman);
XCloseDisplay(x_dpy);
return 0;

View File

@@ -17,6 +17,7 @@ SOURCES = \
tri-depth2.c \
tri-depthwrite.c \
tri-depthwrite2.c \
tri-inv.c \
tri-param.c \
fp-tri.c

6
progs/fp/add-sat.txt Normal file
View File

@@ -0,0 +1,6 @@
!!ARBfp1.0
TEMP R0;
MOV R0, fragment.color;
ADD_SAT R0, R0, R0;
MUL result.color, {0.5}.x, R0;
END

View File

@@ -197,7 +197,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

6
progs/fp/mov-alias.txt Normal file
View File

@@ -0,0 +1,6 @@
!!ARBfp1.0
TEMP R0;
MOV R0, fragment.color;
MOV R0, R0.zyxw;
MOV result.color, R0;
END

6
progs/fp/mul-alias.txt Normal file
View File

@@ -0,0 +1,6 @@
!!ARBfp1.0
TEMP R0;
MOV R0, fragment.color;
MUL R0, R0.zyxw, fragment.color;
MOV result.color, R0;
END

View File

@@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -57,7 +57,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -59,7 +59,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -56,7 +56,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -54,7 +54,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -76,7 +76,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
return;
break;
}
glutPostRedisplay();

View File

@@ -31,7 +31,7 @@ void main()
float iter;
// for (iter = 0.0; iter < MaxIterations && r2 < 4.0; ++iter)
for (iter = 0.0; iter < 12 && r2 < 4.0; ++iter)
for (iter = 0.0; iter < 12.0 && r2 < 4.0; ++iter)
{
float tempreal = real;

View File

@@ -10,16 +10,15 @@ LIB_DEP = \
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
INCLUDE_DIRS = -I$(TOP)/progs/util
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \
-l$(GL_LIB) $(APP_LIB_DEPS)
# using : to avoid APP_CC pointing to CC loop
CC:=$(APP_CC)
CFLAGS += -I$(INCDIR)
LDLIBS=$(LIBS)
CC := $(APP_CC)
CFLAGS := -I$(INCDIR) $(CFLAGS)
LDLIBS = $(LIBS)
DEMO_SOURCES = \
PROG_SOURCES = \
array.c \
bitmap.c \
brick.c \
@@ -59,8 +58,8 @@ UTIL_SOURCES = \
readtex.c
UTIL_OBJS = $(UTIL_SOURCES:.c=.o)
PROG_OBJS = $(DEMO_SOURCES:.c=.o)
PROGS = $(DEMO_SOURCES:%.c=%)
PROG_OBJS = $(PROG_SOURCES:.c=.o)
PROGS = $(PROG_SOURCES:%.c=%)
##### TARGETS #####

View File

@@ -36,7 +36,7 @@ static GLint win = 0;
static GLfloat xRot = 20.0f, yRot = 0.0f, zRot = 0.0f;
static GLuint tangentAttrib;
static GLint tangentAttrib;
static GLboolean Anim = GL_FALSE;

View File

@@ -369,7 +369,7 @@ static void keyPress(unsigned char key, int x, int y)
case 27:
exit(0);
default:
return;
break;
}
glutPostRedisplay();
}

View File

@@ -140,6 +140,7 @@ MakeSphere(void)
glNewList(SphereList, GL_COMPILE);
gluSphere(obj, 2.0f, 30, 15);
glEndList();
gluDeleteQuadric(obj);
}

View File

@@ -22,22 +22,22 @@ static const char *FragShaderText[ 4 ] = {
"void main()\n"
"{\n"
" gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].w ) * 0.5 + 0.5;\n"
" gl_FragColor.a = 1;\n"
" gl_FragColor.a = 1.0;\n"
"}\n",
"void main()\n"
"{\n"
" gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xw ) * 0.5 + 0.5;\n"
" gl_FragColor.a = 1;\n"
" gl_FragColor.a = 1.0;\n"
"}\n",
"void main()\n"
"{\n"
" gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xyw ) * 0.5 + 0.5;\n"
" gl_FragColor.a = 1;\n"
" gl_FragColor.a = 1.0;\n"
"}\n",
"void main()\n"
"{\n"
" gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xyzw ) * 0.5 + 0.5;\n"
" gl_FragColor.a = 1;\n"
" gl_FragColor.a = 1.0;\n"
"}\n"
};
@@ -125,6 +125,7 @@ Key(unsigned char key, int x, int y)
case 'a':
Anim = !Anim;
glutIdleFunc(Anim ? Idle : NULL);
break;
case 's':
Slice -= step;
break;
@@ -193,7 +194,7 @@ LoadAndCompileShader(GLuint shader, const char *text)
GLchar log[1000];
GLsizei len;
glGetShaderInfoLog(shader, 1000, &len, log);
fprintf(stderr, "noise: problem compiling shader: %s\n", log);
fprintf(stderr, "multinoise: problem compiling shader: %s\n", log);
exit(1);
}
else {

View File

@@ -369,12 +369,9 @@ InitPrograms(void)
static void
InitGL(void)
{
const char *version = (const char *) glGetString(GL_VERSION);
if (!ShadersSupported())
exit(1);
if (version[0] != '2' || version[1] != '.') {
printf("Warning: this program expects OpenGL 2.0\n");
/*exit(1);*/
}
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
printf("Usage:\n");
printf(" a - toggle arrays vs. immediate mode rendering\n");

View File

@@ -28,7 +28,7 @@ static const char *FragShaderText =
" vec4 p;\n"
" p.xy = gl_TexCoord[0].xy;\n"
" p.z = Slice;\n"
" p.w = 0;\n"
" p.w = 0.0;\n"
" vec4 n = noise4(p * scale);\n"
" gl_FragColor = n * Scale + Bias;\n"
"}\n";
@@ -119,6 +119,7 @@ Key(unsigned char key, int x, int y)
case 'a':
Anim = !Anim;
glutIdleFunc(Anim ? Idle : NULL);
break;
case 's':
Slice -= step;
break;

View File

@@ -627,7 +627,7 @@ Init(void)
NumAttribs = GetAttribs(Program, Attribs);
PrintAttribs(Attribs);
//assert(glGetError() == 0);
/*assert(glGetError() == 0);*/
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);

View File

@@ -16,6 +16,9 @@
#include <GL/glut.h>
#include "shaderutil.h"
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static char *FragProgFile = "skinning.frag";
static char *VertProgFile = "skinning.vert";

View File

@@ -14,6 +14,9 @@
#include <GL/glew.h>
#include <GL/glut.h>
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static GLint WinWidth = 300, WinHeight = 300;
static GLint win = 0;
@@ -307,8 +310,10 @@ MakeMipmap(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
////glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5);
/*
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5);
*/
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
#undef SZ

View File

@@ -400,11 +400,8 @@ InitPrograms(void)
static void
Init(GLboolean useImageFiles)
{
const char *version = (const char *) glGetString(GL_VERSION);
if (version[0] != '2' || version[1] != '.') {
printf("Warning: this program expects OpenGL 2.0\n");
/*exit(1);*/
if (!ShadersSupported()) {
exit(1);
}
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));

View File

@@ -179,9 +179,9 @@ Init(void)
"\n"
"void main() {\n"
" vec2 p = gl_FragCoord.xy; \n"
" if (crs(v1 - v0, p - v0) >= 0 && \n"
" crs(v2 - v1, p - v1) >= 0 && \n"
" crs(v0 - v2, p - v2) >= 0) \n"
" if (crs(v1 - v0, p - v0) >= 0.0 && \n"
" crs(v2 - v1, p - v1) >= 0.0 && \n"
" crs(v0 - v2, p - v2) >= 0.0) \n"
" gl_FragColor = vec4(1.0); \n"
" else \n"
" gl_FragColor = vec4(0.5); \n"

View File

@@ -16,6 +16,9 @@
#include <GL/glut.h>
#include "shaderutil.h"
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static GLint WinWidth = 300, WinHeight = 300;
static char *FragProgFile = NULL;

View File

@@ -0,0 +1,161 @@
# Exported from Wings 3D 0.99.03
# Top flaps
newmtl BottomWing
Ns 100.0
d 1.0
illum 2
Kd 1.0 0.0 0.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd TopBotMap.rgb
newmtl CompBall_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd CompBall_auv.rgb
newmtl EngMat1
Ns 100.0
d 1.0
illum 2
Kd 0.334 0.334 0.334
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl EngMat2
Ns 100.0
d 1.0
illum 2
Kd 0.78688 0.78688 0.78688
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Fuselage_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 0.0 0.0 0.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd SidesMap.rgb
newmtl Glass
Ns 100.0
d 0.5
illum 2
#Kd 0.5533333333333333 1.0 1.0
Kd 1.0 1.0 1.0
#Ka 0.37333333333333335 0.68 1.0
Ka 0.0 0.0 0.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Grip
Ns 100.0
d 1.0
illum 2
Kd 0.47386 0.47386 0.47386
Ka 0.6203799999999999 0.6203799999999999 0.6203799999999999
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Interior
Ns 100.0
d 1.0
illum 2
Kd 0.70696 0.70696 0.70696
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Prop
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 0.6266666666666667
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd PropMap.rgb
# Rudder
newmtl Sides
Ns 100.0
d 1.0
illum 2
Kd 1.0 0.0 0.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd SidesMap.rgb
newmtl TailHoriz
Ns 100.0
d 1.0
illum 2
Kd 1.0 0.0 0.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd TopBotMap.rgb
# Top wing, bot wing, fuselage
newmtl TopWing
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd TopBotMap.rgb
newmtl Wheels
Ns 100.0
d 1.0
illum 2
Kd 0.0 0.0 0.0
Ka 0.0 0.0 0.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd WheelsMap.rgb
newmtl cylinder58_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd cylinder58_auv.rgb
newmtl default
Ns 100.0
d 1.0
illum 2
Kd 0.0 1.0 1.0
Ka 0.0 1.0 1.0
Ks 0.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl gage_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd gage_auv.rgb

File diff suppressed because it is too large Load Diff

83
progs/objviewer/Makefile Normal file
View File

@@ -0,0 +1,83 @@
TOP = ../..
include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) \
-l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
# using : to avoid APP_CC pointing to CC loop
CC := $(APP_CC)
CFLAGS := -I$(INCDIR) $(CFLAGS)
LDLIBS = $(LIBS)
SOURCES = \
glm.c \
glmdraw.c \
objview.c \
trackball.c \
skybox.c \
readtex.c \
shaderutil.c
HEADERS = \
extfuncs.h \
readtex.h \
shaderutil.h \
trackball.h
OBJS = $(SOURCES:.c=.o)
PROG = objview
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
default: $(PROG)
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
$(OBJS): $(HEADERS)
### Extra dependencies
extfuncs.h: $(TOP)/progs/util/extfuncs.h
cp $< .
readtex.c: $(TOP)/progs/util/readtex.c
cp $< .
readtex.h: $(TOP)/progs/util/readtex.h
cp $< .
shaderutil.c: $(TOP)/progs/util/shaderutil.c
cp $< .
shaderutil.h: $(TOP)/progs/util/shaderutil.h
cp $< .
trackball.c: $(TOP)/progs/util/trackball.c
cp $< .
trackball.h: $(TOP)/progs/util/trackball.h
cp $< .
clean:
-rm -f $(PROG) $(OBJS)
-rm -f *.o *~
-rm -f extfuncs.h
-rm -f shaderutil.*
-rm -f trackball.*
-rm -f readtex.*
depend: $(SOURCES)
@$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(SOURCES) \
> /dev/null 2>/dev/null
-include depend

View File

@@ -0,0 +1,23 @@
This .obj viewer is based on the "smooth" program by Nate Robins
found in the Kilgard GLUT package.
The alpine sky box textures come from http://www.hazelwhorley.com/skyboxtex3_bitmaps.html
The bunny.obj and buddha.obj models come from Stanford.
The GreatLakesBiplaneHP.obj model comes from http://www.sharecg.com/v/25978/3D-Model/Great-Lakes-Biplane-Model
The bobcat.obj model comes from http://www.sharecg.com/v/24771/3D-Model/Bobcat,3d-studio-and-wavefront-objects
The .obj file reader code in glm.c isn't perfect. Not all .obj files are
parsed correctly. There are often mistakes in material-to-triangle assignments.
Mouse:
Left = rotate
Middle = scale
Right = menu
Keyboard:
See pop-up menu for keyboard shortcuts, or press 'h'.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,72 @@
# Exported from Wings 3D 0.99.00b
newmtl black
Ns 48.6667
d 1.00000
illum 2
Kd 1.00000e-3 1.00000e-3 1.00000e-3
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl blanco
Ns 100.000
d 1.00000
illum 2
Kd 1.00000 1.00000 1.00000
Ka 0.620380 0.620380 0.620380
Ks 0.806860 0.806860 0.806860
Ke 1.00000e-3 1.00000e-3 1.00000e-3
newmtl blue
Ns 100.000
d 1.00000
illum 2
Kd 0.105111 0.125293 0.366667
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl default
Ns 100.000
d 1.00000
illum 2
Kd 1.00000 1.00000 1.00000
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.10000 0.10000 0.10000
Ks 0.50000 0.50000 0.500000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl gre
Ns 100.000
d 1.00000
illum 2
Kd 0.200800 0.200800 0.200800
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl red
Ns 100.000
d 1.00000
illum 2
Kd 0.460000 0.00000e+0 0.00000e+0
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl rojo
Ns 100.000
d 1.00000
illum 2
Kd 0.700000 0.00000e+0 0.00000e+0
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 1.00000e-3 1.00000e-3 1.00000e-3

9251
progs/objviewer/bobcat.obj Normal file

File diff suppressed because it is too large Load Diff

149990
progs/objviewer/buddha.obj Normal file

File diff suppressed because it is too large Load Diff

104501
progs/objviewer/bunny.obj Normal file

File diff suppressed because it is too large Load Diff

1917
progs/objviewer/glm.c Normal file

File diff suppressed because it is too large Load Diff

287
progs/objviewer/glm.h Normal file
View File

@@ -0,0 +1,287 @@
/*
* GLM library. Wavefront .obj file format reader/writer/manipulator.
*
* Written by Nate Robins, 1997.
* email: ndr@pobox.com
* www: http://www.pobox.com/~ndr
*/
#ifndef GLM_H
#define GLM_H
typedef unsigned int uint;
#ifndef M_PI
#define M_PI 3.14159265
#endif
/* defines */
#define GLM_NONE (0) /* render with only vertices */
#define GLM_FLAT (1 << 0) /* render with facet normals */
#define GLM_SMOOTH (1 << 1) /* render with vertex normals */
#define GLM_TEXTURE (1 << 2) /* render with texture coords */
#define GLM_COLOR (1 << 3) /* render with colors */
#define GLM_MATERIAL (1 << 4) /* render with materials */
/* structs */
/* GLMmaterial: Structure that defines a material in a model.
*/
typedef struct _GLMmaterial
{
char* name; /* name of material */
float diffuse[4]; /* diffuse component */
float ambient[4]; /* ambient component */
float specular[4]; /* specular component */
float emmissive[4]; /* emmissive component */
float shininess; /* specular exponent */
char *map_kd; /* diffuse texture map file */
uint texture_kd; /* diffuse texture map */
uint texture_ks; /* specular texture map */
int uDiffuse, uAmbient, uSpecular, uShininess, uDiffTex, uSpecTex;
uint prog;
} GLMmaterial;
/* GLMtriangle: Structure that defines a triangle in a model.
*/
typedef struct {
uint vindices[3]; /* array of triangle vertex indices */
uint nindices[3]; /* array of triangle normal indices */
uint tindices[3]; /* array of triangle texcoord indices*/
uint findex; /* index of triangle facet normal */
} GLMtriangle;
/* GLMgroup: Structure that defines a group in a model.
*/
typedef struct _GLMgroup {
char* name; /* name of this group */
uint numtriangles; /* number of triangles in this group */
uint* triangles; /* array of triangle indices */
uint material; /* index to material for group */
uint * triIndexes;
uint minIndex, maxIndex;
struct _GLMgroup* next; /* pointer to next group in model */
} GLMgroup;
/* GLMmodel: Structure that defines a model.
*/
typedef struct {
char* pathname; /* path to this model */
char* mtllibname; /* name of the material library */
uint numvertices; /* number of vertices in model */
float* vertices; /* array of vertices */
uint numnormals; /* number of normals in model */
float* normals; /* array of normals */
uint numtexcoords; /* number of texcoords in model */
float* texcoords; /* array of texture coordinates */
uint numfacetnorms; /* number of facetnorms in model */
float* facetnorms; /* array of facetnorms */
uint numtriangles; /* number of triangles in model */
GLMtriangle* triangles; /* array of triangles */
uint nummaterials; /* number of materials in model */
GLMmaterial* materials; /* array of materials */
uint numgroups; /* number of groups in model */
GLMgroup* groups; /* linked list of groups */
float position[3]; /* position of the model */
float scale;
uint vbo; /* OpenGL VBO for vertex data */
uint vertexSize; /* number of floats per vertex */
uint posOffset; /* offset of position within vertex, in bytes */
uint normOffset; /* offset of normal within vertex, in bytes */
uint texOffset; /* offset of texcoord within vertex, in bytes */
} GLMmodel;
/* public functions */
/* glmUnitize: "unitize" a model by translating it to the origin and
* scaling it to fit in a unit cube around the origin. Returns the
* scalefactor used.
*
* model - properly initialized GLMmodel structure
*/
float
glmUnitize(GLMmodel* model);
/* glmDimensions: Calculates the dimensions (width, height, depth) of
* a model.
*
* model - initialized GLMmodel structure
* dimensions - array of 3 floats (float dimensions[3])
*/
void
glmDimensions(GLMmodel* model, float* dimensions);
/* glmScale: Scales a model by a given amount.
*
* model - properly initialized GLMmodel structure
* scale - scalefactor (0.5 = half as large, 2.0 = twice as large)
*/
void
glmScale(GLMmodel* model, float scale);
/* glmReverseWinding: Reverse the polygon winding for all polygons in
* this model. Default winding is counter-clockwise. Also changes
* the direction of the normals.
*
* model - properly initialized GLMmodel structure
*/
void
glmReverseWinding(GLMmodel* model);
/* glmFacetNormals: Generates facet normals for a model (by taking the
* cross product of the two vectors derived from the sides of each
* triangle). Assumes a counter-clockwise winding.
*
* model - initialized GLMmodel structure
*/
void
glmFacetNormals(GLMmodel* model);
/* glmVertexNormals: Generates smooth vertex normals for a model.
* First builds a list of all the triangles each vertex is in. Then
* loops through each vertex in the the list averaging all the facet
* normals of the triangles each vertex is in. Finally, sets the
* normal index in the triangle for the vertex to the generated smooth
* normal. If the dot product of a facet normal and the facet normal
* associated with the first triangle in the list of triangles the
* current vertex is in is greater than the cosine of the angle
* parameter to the function, that facet normal is not added into the
* average normal calculation and the corresponding vertex is given
* the facet normal. This tends to preserve hard edges. The angle to
* use depends on the model, but 90 degrees is usually a good start.
*
* model - initialized GLMmodel structure
* angle - maximum angle (in degrees) to smooth across
*/
void
glmVertexNormals(GLMmodel* model, float angle);
/* glmLinearTexture: Generates texture coordinates according to a
* linear projection of the texture map. It generates these by
* linearly mapping the vertices onto a square.
*
* model - pointer to initialized GLMmodel structure
*/
void
glmLinearTexture(GLMmodel* model);
/* glmSpheremapTexture: Generates texture coordinates according to a
* spherical projection of the texture map. Sometimes referred to as
* spheremap, or reflection map texture coordinates. It generates
* these by using the normal to calculate where that vertex would map
* onto a sphere. Since it is impossible to map something flat
* perfectly onto something spherical, there is distortion at the
* poles. This particular implementation causes the poles along the X
* axis to be distorted.
*
* model - pointer to initialized GLMmodel structure
*/
void
glmSpheremapTexture(GLMmodel* model);
/* glmDelete: Deletes a GLMmodel structure.
*
* model - initialized GLMmodel structure
*/
void
glmDelete(GLMmodel* model);
/* glmReadOBJ: Reads a model description from a Wavefront .OBJ file.
* Returns a pointer to the created object which should be free'd with
* glmDelete().
*
* filename - name of the file containing the Wavefront .OBJ format data.
*/
GLMmodel*
glmReadOBJ(char* filename);
/* glmWriteOBJ: Writes a model description in Wavefront .OBJ format to
* a file.
*
* model - initialized GLMmodel structure
* filename - name of the file to write the Wavefront .OBJ format data to
* mode - a bitwise or of values describing what is written to the file
* GLM_NONE - write only vertices
* GLM_FLAT - write facet normals
* GLM_SMOOTH - write vertex normals
* GLM_TEXTURE - write texture coords
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
void
glmWriteOBJ(GLMmodel* model, char* filename, uint mode);
/* glmDraw: Renders the model to the current OpenGL context using the
* mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
void
glmDraw(GLMmodel* model, uint mode);
/* glmList: Generates and returns a display list for the model using
* the mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
uint
glmList(GLMmodel* model, uint mode);
/* glmWeld: eliminate (weld) vectors that are within an epsilon of
* each other.
*
* model - initialized GLMmodel structure
* epsilon - maximum difference between vertices
* ( 0.00001 is a good start for a unitized model)
*
*/
void
glmWeld(GLMmodel* model, float epsilon);
void
glmReIndex(GLMmodel *model);
void
glmMakeVBOs(GLMmodel *model);
void
glmDrawVBO(GLMmodel *model);
void
glmPrint(const GLMmodel *model);
void
glmShaderMaterial(GLMmaterial *mat);
void
glmLoadTextures(GLMmodel *model);
void
glmSpecularTexture(GLMmodel *model, uint cubeTex);
#endif /* GLM_H */

455
progs/objviewer/glmdraw.c Normal file
View File

@@ -0,0 +1,455 @@
/* */
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "glm.h"
#include "readtex.h"
#include "shaderutil.h"
/* defines */
#define T(x) model->triangles[(x)]
/* glmDraw: Renders the model to the current OpenGL context using the
* mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_COLOR - render with colors (color material)
* GLM_MATERIAL - render with materials
* GLM_COLOR and GLM_MATERIAL should not both be specified.
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
GLvoid
glmDraw(GLMmodel* model, GLuint mode)
{
GLuint i;
GLMgroup* group;
assert(model);
assert(model->vertices);
/* do a bit of warning */
if (mode & GLM_FLAT && !model->facetnorms) {
printf("glmDraw() warning: flat render mode requested "
"with no facet normals defined.\n");
mode &= ~GLM_FLAT;
}
if (mode & GLM_SMOOTH && !model->normals) {
printf("glmDraw() warning: smooth render mode requested "
"with no normals defined.\n");
mode &= ~GLM_SMOOTH;
}
if (mode & GLM_TEXTURE && !model->texcoords) {
printf("glmDraw() warning: texture render mode requested "
"with no texture coordinates defined.\n");
mode &= ~GLM_TEXTURE;
}
if (mode & GLM_FLAT && mode & GLM_SMOOTH) {
printf("glmDraw() warning: flat render mode requested "
"and smooth render mode requested (using smooth).\n");
mode &= ~GLM_FLAT;
}
if (mode & GLM_COLOR && !model->materials) {
printf("glmDraw() warning: color render mode requested "
"with no materials defined.\n");
mode &= ~GLM_COLOR;
}
if (mode & GLM_MATERIAL && !model->materials) {
printf("glmDraw() warning: material render mode requested "
"with no materials defined.\n");
mode &= ~GLM_MATERIAL;
}
if (mode & GLM_COLOR && mode & GLM_MATERIAL) {
printf("glmDraw() warning: color and material render mode requested "
"using only material mode\n");
mode &= ~GLM_COLOR;
}
if (mode & GLM_COLOR)
glEnable(GL_COLOR_MATERIAL);
if (mode & GLM_MATERIAL)
glDisable(GL_COLOR_MATERIAL);
glPushMatrix();
glTranslatef(model->position[0], model->position[1], model->position[2]);
glBegin(GL_TRIANGLES);
group = model->groups;
while (group) {
if (mode & GLM_MATERIAL) {
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,
model->materials[group->material].ambient);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,
model->materials[group->material].diffuse);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,
model->materials[group->material].specular);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS,
model->materials[group->material].shininess);
}
if (mode & GLM_COLOR) {
glColor3fv(model->materials[group->material].diffuse);
}
for (i = 0; i < group->numtriangles; i++) {
if (mode & GLM_FLAT)
glNormal3fv(&model->facetnorms[3 * T(group->triangles[i]).findex]);
if (mode & GLM_SMOOTH)
glNormal3fv(&model->normals[3 * T(group->triangles[i]).nindices[0]]);
if (mode & GLM_TEXTURE)
glTexCoord2fv(&model->texcoords[2*T(group->triangles[i]).tindices[0]]);
glVertex3fv(&model->vertices[3 * T(group->triangles[i]).vindices[0]]);
#if 0
printf("%f %f %f\n",
model->vertices[3 * T(group->triangles[i]).vindices[0] + X],
model->vertices[3 * T(group->triangles[i]).vindices[0] + Y],
model->vertices[3 * T(group->triangles[i]).vindices[0] + Z]);
#endif
if (mode & GLM_SMOOTH)
glNormal3fv(&model->normals[3 * T(group->triangles[i]).nindices[1]]);
if (mode & GLM_TEXTURE)
glTexCoord2fv(&model->texcoords[2*T(group->triangles[i]).tindices[1]]);
glVertex3fv(&model->vertices[3 * T(group->triangles[i]).vindices[1]]);
#if 0
printf("%f %f %f\n",
model->vertices[3 * T(group->triangles[i]).vindices[1] + X],
model->vertices[3 * T(group->triangles[i]).vindices[1] + Y],
model->vertices[3 * T(group->triangles[i]).vindices[1] + Z]);
#endif
if (mode & GLM_SMOOTH)
glNormal3fv(&model->normals[3 * T(group->triangles[i]).nindices[2]]);
if (mode & GLM_TEXTURE)
glTexCoord2fv(&model->texcoords[2*T(group->triangles[i]).tindices[2]]);
glVertex3fv(&model->vertices[3 * T(group->triangles[i]).vindices[2]]);
#if 0
printf("%f %f %f\n",
model->vertices[3 * T(group->triangles[i]).vindices[2] + X],
model->vertices[3 * T(group->triangles[i]).vindices[2] + Y],
model->vertices[3 * T(group->triangles[i]).vindices[2] + Z]);
#endif
}
group = group->next;
}
glEnd();
glPopMatrix();
}
void
glmMakeVBOs(GLMmodel *model)
{
uint bytes, vertexFloats, i;
float *buffer;
vertexFloats = 3;
model->posOffset = 0;
if (model->numnormals > 0) {
assert(model->numnormals == model->numvertices);
model->normOffset = vertexFloats * sizeof(GLfloat);
vertexFloats += 3;
}
if (model->numtexcoords > 0) {
assert(model->numtexcoords == model->numvertices);
model->texOffset = vertexFloats * sizeof(GLfloat);
vertexFloats += 2;
}
model->vertexSize = vertexFloats;
bytes = (model->numvertices + 1) * vertexFloats * sizeof(float);
buffer = (float *) malloc(bytes);
for (i = 0; i < model->numvertices; i++) {
/* copy vertex pos */
uint j = 0;
buffer[i * vertexFloats + j++] = model->vertices[i * 3 + 0];
buffer[i * vertexFloats + j++] = model->vertices[i * 3 + 1];
buffer[i * vertexFloats + j++] = model->vertices[i * 3 + 2];
if (model->numnormals > 0) {
buffer[i * vertexFloats + j++] = model->normals[i * 3 + 0];
buffer[i * vertexFloats + j++] = model->normals[i * 3 + 1];
buffer[i * vertexFloats + j++] = model->normals[i * 3 + 2];
}
if (model->numtexcoords > 0) {
buffer[i * vertexFloats + j++] = model->texcoords[i * 2 + 0];
buffer[i * vertexFloats + j++] = model->texcoords[i * 2 + 1];
}
}
glGenBuffersARB(1, &model->vbo);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, model->vbo);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, bytes, buffer, GL_STATIC_DRAW_ARB);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
free(buffer);
}
static void
_glmLoadTexture(GLMmaterial *mat)
{
if (mat->map_kd) {
GLint imgWidth, imgHeight;
GLenum imgFormat;
GLubyte *image = NULL;
glGenTextures(1, &mat->texture_kd);
image = LoadRGBImage( mat->map_kd, &imgWidth, &imgHeight, &imgFormat );
if (!image) {
/*fprintf(stderr, "Couldn't open texture %s\n", mat->map_kd);*/
free(mat->map_kd);
mat->map_kd = NULL;
mat->texture_kd = 0;
return;
}
if (0)
printf("load texture %s %d x %d\n", mat->map_kd, imgWidth, imgHeight);
glBindTexture(GL_TEXTURE_2D, mat->texture_kd);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, imgWidth, imgHeight,
imgFormat, GL_UNSIGNED_BYTE, image);
free(image);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
}
}
void
glmLoadTextures(GLMmodel *model)
{
uint i;
for (i = 0; i < model->nummaterials; i++) {
GLMmaterial *mat = &model->materials[i];
_glmLoadTexture(mat);
}
}
void
glmDrawVBO(GLMmodel *model)
{
GLMgroup* group;
assert(model->vbo);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, model->vbo);
glVertexPointer(3, GL_FLOAT, model->vertexSize * sizeof(float),
(void *) model->posOffset);
glEnableClientState(GL_VERTEX_ARRAY);
if (model->numnormals > 0) {
glNormalPointer(GL_FLOAT, model->vertexSize * sizeof(float),
(void *) model->normOffset);
glEnableClientState(GL_NORMAL_ARRAY);
}
if (model->numtexcoords > 0) {
glTexCoordPointer(2, GL_FLOAT, model->vertexSize * sizeof(float),
(void *) model->texOffset);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
glPushMatrix();
glTranslatef(model->position[0], model->position[1], model->position[2]);
glScalef(model->scale, model->scale, model->scale);
for (group = model->groups; group; group = group->next) {
if (group->numtriangles > 0) {
glmShaderMaterial(&model->materials[group->material]);
glDrawRangeElements(GL_TRIANGLES,
group->minIndex, group->maxIndex,
3 * group->numtriangles,
GL_UNSIGNED_INT, group->triIndexes);
}
}
glPopMatrix();
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
/* glmList: Generates and returns a display list for the model using
* the mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_COLOR - render with colors (color material)
* GLM_MATERIAL - render with materials
* GLM_COLOR and GLM_MATERIAL should not both be specified.
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
GLuint
glmList(GLMmodel* model, GLuint mode)
{
GLuint list;
list = glGenLists(1);
glNewList(list, GL_COMPILE);
glmDraw(model, mode);
glEndList();
return list;
}
static const char *VertexShader =
"varying vec3 normal; \n"
"void main() { \n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; \n"
" normal = gl_NormalMatrix * gl_Normal; \n"
" gl_TexCoord[0] = gl_MultiTexCoord0; \n"
"} \n";
/**
* Two %s substitutions:
* diffuse texture? true/false
* specular texture? true/false
*/
static const char *TexFragmentShader =
"uniform vec4 ambient, diffuse, specular; \n"
"uniform vec4 ambientLight, diffuseLight, specularLight; \n"
"uniform float shininess; \n"
"uniform sampler2D diffTex; \n"
"uniform samplerCube specTex; \n"
"varying vec3 normal; \n"
"\n"
"void main() \n"
"{ \n"
" vec4 diffTerm, specTerm; \n"
" float dotProd = max(dot(gl_LightSource[0].position.xyz, \n"
" normalize(normal)), 0.0);\n"
" float dotProd2 = max(dot(-gl_LightSource[0].position.xyz, \n"
" normalize(normal)), 0.0);\n"
" dotProd += dotProd2; \n"
" \n"
" diffTerm = diffuse * diffuseLight * dotProd; \n"
" if (%s) \n"
" diffTerm *= texture2D(diffTex, gl_TexCoord[0].st); \n"
" \n"
" specTerm = specular * specularLight * pow(dotProd, shininess); \n"
" if (%s) \n"
" specTerm *= textureCube(specTex, normal); \n"
" \n"
" gl_FragColor = ambient * ambientLight + diffTerm + specTerm; \n"
"} \n";
void
glmShaderMaterial(GLMmaterial *mat)
{
static const float ambientLight[4] = { 0.1, 0.1, 0.1, 0.0 };
static const float diffuseLight[4] = { 0.75, 0.75, 0.75, 1.0 };
static const float specularLight[4] = { 1.0, 1.0, 1.0, 0.0 };
if (!mat->prog) {
/* make shader now */
char newShader[10000];
GLuint vs, fs;
const char *diffuseTex = mat->texture_kd ? "true" : "false";
const char *specularTex = mat->texture_ks ? "true" : "false";
GLint uAmbientLight, uDiffuseLight, uSpecularLight;
/* replace %d with 0 or 1 */
sprintf(newShader, TexFragmentShader, diffuseTex, specularTex);
if (0)
printf("===== new shader =====\n%s\n============\n", newShader);
vs = CompileShaderText(GL_VERTEX_SHADER, VertexShader);
fs = CompileShaderText(GL_FRAGMENT_SHADER, newShader);
mat->prog = LinkShaders(vs, fs);
assert(mat->prog);
glUseProgram(mat->prog);
mat->uAmbient = glGetUniformLocation(mat->prog, "ambient");
mat->uDiffuse = glGetUniformLocation(mat->prog, "diffuse");
mat->uSpecular = glGetUniformLocation(mat->prog, "specular");
mat->uShininess = glGetUniformLocation(mat->prog, "shininess");
mat->uDiffTex = glGetUniformLocation(mat->prog, "diffTex");
mat->uSpecTex = glGetUniformLocation(mat->prog, "specTex");
uAmbientLight = glGetUniformLocation(mat->prog, "ambientLight");
uDiffuseLight = glGetUniformLocation(mat->prog, "diffuseLight");
uSpecularLight = glGetUniformLocation(mat->prog, "specularLight");
glUniform4fv(mat->uAmbient, 1, mat->ambient);
glUniform4fv(mat->uDiffuse, 1, mat->diffuse);
glUniform4fv(mat->uSpecular, 1, mat->specular);
glUniform1f(mat->uShininess, mat->shininess);
glUniform1i(mat->uDiffTex, 0);
glUniform1i(mat->uSpecTex, 1);
glUniform4fv(uAmbientLight, 1, ambientLight);
glUniform4fv(uDiffuseLight, 1, diffuseLight);
glUniform4fv(uSpecularLight, 1, specularLight);
}
glActiveTexture(GL_TEXTURE1);
if (mat->texture_ks)
glBindTexture(GL_TEXTURE_CUBE_MAP, mat->texture_ks);
else
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
glActiveTexture(GL_TEXTURE0);
if (mat->texture_kd)
glBindTexture(GL_TEXTURE_2D, mat->texture_kd);
else
glBindTexture(GL_TEXTURE_2D, 0);
if (mat->diffuse[3] < 1.0) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
else {
glDisable(GL_BLEND);
}
glUseProgram(mat->prog);
}
void
glmSpecularTexture(GLMmodel *model, uint cubeTex)
{
uint i;
for (i = 0; i < model->nummaterials; i++) {
model->materials[i].texture_ks = cubeTex;
}
}

515
progs/objviewer/objview.c Normal file
View File

@@ -0,0 +1,515 @@
/*
* .obj file viewer based on "smooth" by Nate Robins, 1997
*
* Brian Paul
* 1 Oct 2009
*/
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <stdarg.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "glm.h"
#include "readtex.h"
#include "skybox.h"
#include "trackball.h"
static char *Model_file = NULL; /* name of the obect file */
static GLMmodel *Model;
static GLfloat Scale = 4.0; /* scaling factor */
static GLboolean Performance = GL_FALSE;
static GLboolean Stats = GL_FALSE;
static GLboolean Animate = GL_TRUE;
static GLuint SkyboxTex;
static GLboolean Skybox = GL_TRUE;
static GLboolean Cull = GL_TRUE;
static GLboolean WireFrame = GL_FALSE;
static GLenum FrontFace = GL_CCW;
static GLfloat Yrot = 0.0;
static GLint WinWidth = 1024, WinHeight = 768;
static GLuint NumInstances = 1;
typedef struct
{
float CurQuat[4];
float Distance;
/* When mouse is moving: */
GLboolean Rotating, Translating;
GLint StartX, StartY;
float StartDistance;
} ViewInfo;
static ViewInfo View;
static void
InitViewInfo(ViewInfo *view)
{
view->Rotating = GL_FALSE;
view->Translating = GL_FALSE;
view->StartX = view->StartY = 0;
view->Distance = 12.0;
view->StartDistance = 0.0;
view->CurQuat[0] = 0.0;
view->CurQuat[1] = 1.0;
view->CurQuat[2] = 0.0;
view->CurQuat[3] = 0.0;
}
/* text: general purpose text routine. draws a string according to
* format in a stroke font at x, y after scaling it by the scale
* specified (scale is in window-space (lower-left origin) pixels).
*
* x - position in x (in window-space)
* y - position in y (in window-space)
* scale - scale in pixels
* format - as in printf()
*/
static void
text(GLuint x, GLuint y, GLfloat scale, char* format, ...)
{
va_list args;
char buffer[255], *p;
GLfloat font_scale = 119.05 + 33.33;
va_start(args, format);
vsprintf(buffer, format, args);
va_end(args);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, glutGet(GLUT_WINDOW_WIDTH), 0, glutGet(GLUT_WINDOW_HEIGHT));
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glTranslatef(x, y, 0.0);
glScalef(scale/font_scale, scale/font_scale, scale/font_scale);
for(p = buffer; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
static float
ComputeFPS(void)
{
static double t0 = -1.0;
static int frames = 0;
double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
static float fps = 0;
frames++;
if (t0 < 0.0) {
t0 = t;
fps = 0.0;
}
else if (t - t0 >= 4.0) {
fps = (frames / (t - t0) + 0.5);
t0 = t;
frames = 0;
return fps;
}
return 0.0;
}
static void
init_model(void)
{
float objScale;
/* read in the model */
Model = glmReadOBJ(Model_file);
objScale = glmUnitize(Model);
glmFacetNormals(Model);
if (Model->numnormals == 0) {
GLfloat smoothing_angle = 90.0;
printf("Generating normals.\n");
glmVertexNormals(Model, smoothing_angle);
}
glmLoadTextures(Model);
glmReIndex(Model);
glmMakeVBOs(Model);
if (0)
glmPrint(Model);
}
static void
init_skybox(void)
{
SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
"alpine_west.rgb",
"alpine_up.rgb",
"alpine_down.rgb",
"alpine_south.rgb",
"alpine_north.rgb");
glmSpecularTexture(Model, SkyboxTex);
}
static void
init_gfx(void)
{
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glEnable(GL_NORMALIZE);
glClearColor(0.3, 0.3, 0.9, 0.0);
}
static void
reshape(int width, int height)
{
float ar = 0.5 * (float) width / (float) height;
WinWidth = width;
WinHeight = height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -0.5, 0.5, 1.0, 300.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -3.0);
}
static void
Idle(void)
{
float q[4];
trackball(q, 100, 0, 99.99, 0);
add_quats(q, View.CurQuat, View.CurQuat);
glutPostRedisplay();
}
static void
display(void)
{
GLfloat rot[4][4];
float fps;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0.0, 0.0, -View.Distance);
glRotatef(Yrot, 0, 1, 0);
build_rotmatrix(rot, View.CurQuat);
glMultMatrixf(&rot[0][0]);
glScalef(Scale, Scale, Scale );
glUseProgram(0);
if (Skybox)
DrawSkyBoxCubeTexture(SkyboxTex);
if (WireFrame)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
if (Cull)
glEnable(GL_CULL_FACE);
else
glDisable(GL_CULL_FACE);
if (NumInstances == 1) {
glmDrawVBO(Model);
}
else {
/* draw > 1 instance */
float dr = 360.0 / NumInstances;
float r;
for (r = 0.0; r < 360.0; r += dr) {
glPushMatrix();
glRotatef(r, 0, 1, 0);
glTranslatef(1.4, 0.0, 0.0);
glmDrawVBO(Model);
glPopMatrix();
}
}
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDisable(GL_CULL_FACE);
glPopMatrix();
if (Stats) {
glColor3f(1.0, 1.0, 1.0);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*1), 20, "%s",
Model->pathname);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*2), 20, "%d vertices",
Model->numvertices);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*3), 20, "%d triangles",
Model->numtriangles);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*4), 20, "%d normals",
Model->numnormals);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*5), 20, "%d texcoords",
Model->numtexcoords);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*6), 20, "%d groups",
Model->numgroups);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*7), 20, "%d materials",
Model->nummaterials);
}
glutSwapBuffers();
fps = ComputeFPS();
if (fps)
printf("%f FPS\n", fps);
}
static void
keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'h':
printf("help\n\n");
printf("a - Toggle animation\n");
printf("d/D - Decrease/Incrase number of models\n");
printf("w - Toggle wireframe/filled\n");
printf("c - Toggle culling\n");
printf("n - Toggle facet/smooth normal\n");
printf("r - Reverse polygon winding\n");
printf("p - Toggle performance indicator\n");
printf("s - Toggle skybox\n");
printf("z/Z - Scale model smaller/larger\n");
printf("i - Show model info/stats\n");
printf("q/escape - Quit\n\n");
break;
case 'a':
Animate = !Animate;
if (Animate)
glutIdleFunc(Idle);
else
glutIdleFunc(NULL);
break;
case 'd':
if (NumInstances > 1)
NumInstances--;
break;
case 'D':
NumInstances++;
break;
case 'i':
Stats = !Stats;
break;
case 'p':
Performance = !Performance;
break;
case 'w':
WireFrame = !WireFrame;
break;
case 'c':
Cull = !Cull;
printf("Polygon culling: %d\n", Cull);
break;
case 'r':
if (FrontFace == GL_CCW)
FrontFace = GL_CW;
else
FrontFace = GL_CCW;
glFrontFace(FrontFace);
printf("Front face:: %s\n", FrontFace == GL_CCW ? "CCW" : "CW");
break;
case 's':
Skybox = !Skybox;
if (Skybox)
glmSpecularTexture(Model, SkyboxTex);
else
glmSpecularTexture(Model, 0);
break;
case 'z':
Scale *= 0.9;
break;
case 'Z':
Scale *= 1.1;
break;
case 'q':
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void
menu(int item)
{
keyboard((unsigned char)item, 0, 0);
}
/**
* Handle mouse button.
*/
static void
Mouse(int button, int state, int x, int y)
{
if (button == GLUT_LEFT_BUTTON) {
if (state == GLUT_DOWN) {
View.StartX = x;
View.StartY = y;
View.Rotating = GL_TRUE;
}
else if (state == GLUT_UP) {
View.Rotating = GL_FALSE;
}
}
else if (button == GLUT_MIDDLE_BUTTON) {
if (state == GLUT_DOWN) {
View.StartX = x;
View.StartY = y;
View.StartDistance = View.Distance;
View.Translating = GL_TRUE;
}
else if (state == GLUT_UP) {
View.Translating = GL_FALSE;
}
}
}
/**
* Handle mouse motion
*/
static void
Motion(int x, int y)
{
int i;
if (View.Rotating) {
float x0 = (2.0 * View.StartX - WinWidth) / WinWidth;
float y0 = (WinHeight - 2.0 * View.StartY) / WinHeight;
float x1 = (2.0 * x - WinWidth) / WinWidth;
float y1 = (WinHeight - 2.0 * y) / WinHeight;
float q[4];
trackball(q, x0, y0, x1, y1);
View.StartX = x;
View.StartY = y;
for (i = 0; i < 1; i++)
add_quats(q, View.CurQuat, View.CurQuat);
glutPostRedisplay();
}
else if (View.Translating) {
float dz = 0.02 * (y - View.StartY);
View.Distance = View.StartDistance + dz;
glutPostRedisplay();
}
}
static void
DoFeatureChecks(void)
{
char *version = (char *) glGetString(GL_VERSION);
if (version[0] == '1') {
/* check for individual extensions */
if (!glutExtensionSupported("GL_ARB_texture_cube_map")) {
printf("Sorry, GL_ARB_texture_cube_map is required.\n");
exit(1);
}
if (!glutExtensionSupported("GL_ARB_vertex_shader")) {
printf("Sorry, GL_ARB_vertex_shader is required.\n");
exit(1);
}
if (!glutExtensionSupported("GL_ARB_fragment_shader")) {
printf("Sorry, GL_ARB_fragment_shader is required.\n");
exit(1);
}
if (!glutExtensionSupported("GL_ARB_vertex_buffer_object")) {
printf("Sorry, GL_ARB_vertex_buffer_object is required.\n");
exit(1);
}
}
}
int
main(int argc, char** argv)
{
glutInitWindowSize(WinWidth, WinHeight);
glutInit(&argc, argv);
if (argc > 1) {
Model_file = argv[1];
}
if (!Model_file) {
fprintf(stderr, "usage: objview file.obj\n");
fprintf(stderr, "(using default bunny.obj)\n");
Model_file = "bunny.obj";
}
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow("objview");
glewInit();
DoFeatureChecks();
glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutMouseFunc(Mouse);
glutMotionFunc(Motion);
if (Animate)
glutIdleFunc(Idle);
glutCreateMenu(menu);
glutAddMenuEntry("[a] Toggle animate", 'a');
glutAddMenuEntry("[d] Fewer models", 'd');
glutAddMenuEntry("[D] More models", 'D');
glutAddMenuEntry("[w] Toggle wireframe/filled", 'w');
glutAddMenuEntry("[c] Toggle culling on/off", 'c');
glutAddMenuEntry("[r] Reverse polygon winding", 'r');
glutAddMenuEntry("[z] Scale model smaller", 'z');
glutAddMenuEntry("[Z] Scale model larger", 'Z');
glutAddMenuEntry("[p] Toggle performance indicator", 'p');
glutAddMenuEntry("[i] Show model stats", 'i');
glutAddMenuEntry("", 0);
glutAddMenuEntry("[q] Quit", 27);
glutAttachMenu(GLUT_RIGHT_BUTTON);
InitViewInfo(&View);
init_model();
init_skybox();
init_gfx();
glutMainLoop();
return 0;
}

187
progs/objviewer/skybox.c Normal file
View File

@@ -0,0 +1,187 @@
#include <assert.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glu.h>
#include "readtex.h"
#include "skybox.h"
static int
load(GLenum target, const char *filename,
GLboolean flipTB, GLboolean flipLR)
{
GLint w, h;
GLenum format;
GLubyte *img = LoadRGBImage( filename, &w, &h, &format );
if (!img) {
printf("Error: couldn't load texture image %s\n", filename);
return 0;
}
assert(format == GL_RGB);
printf("Load cube face 0x%x: %s %d x %d\n", target, filename, w, h);
/* <sigh> the way the texture cube mapping works, we have to flip
* images to make things look right.
*/
if (flipTB) {
const int stride = 3 * w;
GLubyte temp[3*1024];
int i;
for (i = 0; i < h / 2; i++) {
memcpy(temp, img + i * stride, stride);
memcpy(img + i * stride, img + (h - i - 1) * stride, stride);
memcpy(img + (h - i - 1) * stride, temp, stride);
}
}
if (flipLR) {
const int stride = 3 * w;
GLubyte temp[3];
GLubyte *row;
int i, j;
for (i = 0; i < h; i++) {
row = img + i * stride;
for (j = 0; j < w / 2; j++) {
int k = w - j - 1;
temp[0] = row[j*3+0];
temp[1] = row[j*3+1];
temp[2] = row[j*3+2];
row[j*3+0] = row[k*3+0];
row[j*3+1] = row[k*3+1];
row[j*3+2] = row[k*3+2];
row[k*3+0] = temp[0];
row[k*3+1] = temp[1];
row[k*3+2] = temp[2];
}
}
}
gluBuild2DMipmaps(target, GL_RGB, w, h, format, GL_UNSIGNED_BYTE, img);
free(img);
return 1;
}
GLuint
LoadSkyBoxCubeTexture(const char *filePosX,
const char *fileNegX,
const char *filePosY,
const char *fileNegY,
const char *filePosZ,
const char *fileNegZ)
{
GLuint tex;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_CUBE_MAP, tex);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST);
if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_X, filePosX, GL_TRUE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, fileNegX, GL_TRUE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, filePosY, 1+GL_FALSE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, fileNegY, 1+GL_FALSE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, filePosZ, GL_TRUE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, fileNegZ, GL_TRUE, GL_TRUE))
return 0;
return tex;
}
#define eps1 0.99
#define br 20.0 /* box radius */
void
DrawSkyBoxCubeTexture(GLuint tex)
{
struct vertex {
float x, y, z, s, t, r;
};
static const struct vertex verts[24] = {
/* +X side */
{ br, -br, -br, 1.0, -eps1, -eps1 },
{ br, -br, br, 1.0, -eps1, eps1 },
{ br, br, br, 1.0, eps1, eps1 },
{ br, br, -br, 1.0, eps1, -eps1 },
/* -X side */
{ -br, br, -br, -1.0, eps1, -eps1 },
{ -br, br, br, -1.0, eps1, eps1 },
{ -br, -br, br, -1.0, -eps1, eps1 },
{ -br, -br, -br, -1.0, -eps1, -eps1 },
/* +Y side */
{ br, br, -br, eps1, 1.0, -eps1 },
{ br, br, br, eps1, 1.0, eps1 },
{ -br, br, br, -eps1, 1.0, eps1 },
{ -br, br, -br, -eps1, 1.0, -eps1 },
/* -Y side */
{ -br, -br, -br, -eps1, -1.0, -eps1 },
{ -br, -br, br, -eps1, -1.0, eps1 },
{ br, -br, br, eps1, -1.0, eps1 },
{ br, -br, -br, eps1, -1.0, -eps1 },
/* +Z side */
{ br, -br, br, eps1, -eps1, 1.0 },
{ -br, -br, br, -eps1, -eps1, 1.0 },
{ -br, br, br, -eps1, eps1, 1.0 },
{ br, br, br, eps1, eps1, 1.0 },
/* -Z side */
{ br, br, -br, eps1, eps1, -1.0 },
{ -br, br, -br, -eps1, eps1, -1.0 },
{ -br, -br, -br, -eps1, -eps1, -1.0 },
{ br, -br, -br, eps1, -eps1, -1.0 },
};
static GLuint vbo = 0;
if (!vbo ) {
glGenBuffersARB(1, &vbo);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), verts,
GL_STATIC_DRAW_ARB);
}
else {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glVertexPointer(3, GL_FLOAT, sizeof(struct vertex),
(void *) offsetof(struct vertex, x));
glTexCoordPointer(3, GL_FLOAT, sizeof(struct vertex),
(void *) offsetof(struct vertex, s));
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glBindTexture(GL_TEXTURE_CUBE_MAP, tex);
glEnable(GL_TEXTURE_CUBE_MAP);
glDisable(GL_BLEND);
glDrawArrays(GL_QUADS, 0, 24);
glDisable(GL_TEXTURE_CUBE_MAP);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
}

18
progs/objviewer/skybox.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef SKYBOX_H
#define SKYBOX_H
extern GLuint
LoadSkyBoxCubeTexture(const char *filePosX,
const char *fileNegX,
const char *filePosY,
const char *fileNegY,
const char *filePosZ,
const char *fileNegZ);
extern void
DrawSkyBoxCubeTexture(GLuint tex);
#endif /* SKYBOX_H */

10
progs/perf/.gitignore vendored Normal file
View File

@@ -0,0 +1,10 @@
copytex
drawoverhead
fbobind
fill
genmipmap
readpixels
swapbuffers
teximage
vbo
vertexrate

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