Luca, This is an impressive body of work. I want to give Jose a chance to review the EGL/GLX extensions before pushing, but in the meantime I hope it's ok if I make a couple of quick suggestions/requests:
Firstly, we're going to be evolving the TGSI instruction set a fair bit over the coming months to catch up with newer GLSL versions, CL, etc. >From that point of view, it would be preferable if the code you've added in uureg.h could be automatically regenerated after TGSI changes. I see you've got some python in the comments showing how you built the file in the first place -- would it be possible to extract that to an actual script that the build system can use to regenerate uureg.h on TGSI changes? I'm mainly thinking about automatically tracking new instructions, I guess. In terms of the gears demo, one of the nice things about gears is that it's as close as possible to the same demo everywhere. How different is this one to the original? Is there a chance of adding a mode that exactly replicates the tessellation of the original gears? As a bonus, it would be nice to see a couple of simpler demos, perhaps something like a port of trivial/tri.c and trivial/clear.c. These are some of the most useful apps for bringing up new drivers and having stripped down pure-gallium versions of them is likely to be a real help for people starting driver projects in the future. It's a bit of a pity you've used a new coding style in these directories. I don't want to be a pain about this and we already have eg. nouveau and other drivers that have gone their own way, but for the most part in Mesa we've tried to stick to the same 3-space layout. Would you be deeply offended if I asked you to reformat to vaguely match the rest of Mesa? I'm not going to make a big deal out of it, but it is a pain to deal with multiple different coding conventions within mesa and I'd prefer it not to get worse... Keith On Thu, 2009-12-31 at 01:37 -0800, Luca Barbieri wrote: > This is a series of 4 patches that add the required infrastructure for > writing Gallium demos and programs and include two such demos, > galliumgears and galliumglobe. > > The first two patches have already been posted, but I am including them > again in git format-patch format as part of the series (they were > manually generated). > > The patches are all attached, and the commit message of the third and > fourth is replicated in the message body for easier reading. > > > >From 04597af67fb6fa556e04ee5b293ad2b774178cbf Mon Sep 17 00:00:00 2001 > From: Luca Barbieri <l...@luca-barbieri.com> > Date: Thu, 31 Dec 2009 09:41:38 +0100 > Subject: [PATCH 3/4] Add utility framework for Gallium programs > > This is an utility library called "galliumut", designed to make writing > Gallium applications (as opposed to state trackers) easier. > It is put in gallium/programs since it doesn't follow the same coding > standards and doesn't share the same goal of gallium/auxiliary. > > It requires my EGL_MESA_gallium extension patch to allow creation of a > Gallium context capable of displaying surfaces to the user. > For X11 usage, it also requires my MESA_screen_surface patch to make > egl_glx automatically create a maximized window for EGL programs. > > * galliumut.h contains miscellaneous utility functions, easy framebuffer > setup functions, mesh (vertex+index buffer) utilities and creation of > common state objects > > * egl_gallium.c uses the MESA_screen_surface and EGL_MESA_gallium to set > up a pipe_context and pipe_framebuffer_state suitable for drawing to the > screen and implements a render loop > > * image.c/image.h uses the gdk-pixbuf library to create a pipe_texture > from an image in the filesystem > > * ureg_lib.h adds utility functions, asin/acos, normalize and vector > transform functions to ureg > > * uureg.h is a wrapper around ureg which allows to write much terser > shaders. > It features, for instance, a short macro for each possible swizzle and > writemask, macros that don't include the "ureg" word, and automatic > conversion of ureg_dst and scalars to ureg_src. > > * math_lib.h is a 3/4-sized vector/matrix library with SSE/SSE2 > optimization > math_lib_fp.h and math_lib_fp_transform.h are internally used headers > > * test_math tests math_lib.h > > * normal_gen.c/normal_gen.h include vertex and fragment shaders for > normal map generation > > > >From 5a855511dfc524e298696f4356cf56595fc584e1 Mon Sep 17 00:00:00 2001 > From: Luca Barbieri <l...@luca-barbieri.com> > Date: Thu, 31 Dec 2009 10:24:09 +0100 > Subject: [PATCH 4/4] Add galliumgears and galliumglobe Gallium API demos > > This patch includes two demos which don't use OpenGL, but directly draw > using the Gallium3D API, with context setup done using EGL through the > galliumut framework. > They require my MESA_screen_surface, EGL_MESA_gallium and galliumut > patches > > This provides a direct demonstration of the Gallium API. > In addition to having fun writing Gallium demos, test suites for Gallium > drivers can be written in this fashion. > > galliumgears is a Gallium remake of the gears demo. > In addition to the classic demo it features: > - Smart frustum which never puts the gears offscreen > - Per-pixel diffuse and specular lighting (can be disabled to get the > classic gears look) > - Better meshes for gears with configurable amount of triangles for > better rounded interiors > - Configurable gear speed > > galliumglobe is a new demo which renders a pixel-perfect spinning Earth > globe. > It works this way: > 1. Downloads NASA Blue Marble imagery for Earth color, altitude and > nighttime lighting. > 2. Uses the GPU to generate mipmaps and a spherical normal map from the > heightmaps > 3. Optionally builds a triangle fan which rasterizes to a perfect circle > (1000-8000 triangles will be used for normal display sizes), and > otherwise uses KIL in the fragment shader > 4. For each window resize, uses the GPU to generate a texture containing > 16-bit (split into 2 8-bit values) map projection u, v coordinates for > points on the screen > 5. Uses a fragment shader that for each point in a circle on the screen, > gets the u,v coordinates from the texture, applies latitude translation > and does diffuse/specular calculation using pre-rotated light and half > vectors > Anisotropic filtering is used for quality rendering at the poles and > equator extremes. > > The demo is configurable in many ways: see the usage message for more > information. > > The demos have been tested with softpipe and nv40, and may need > adjustments to work on other drivers. > > > ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev