Merge branch 'gallium-dynamicstencilref'
authorRoland Scheidegger <sroland@vmware.com>
Fri, 12 Feb 2010 20:39:29 +0000 (21:39 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 12 Feb 2010 20:39:29 +0000 (21:39 +0100)
131 files changed:
Makefile
SConstruct
configs/darwin-x86ppc [deleted file]
configure.ac
docs/repository.html
include/GL/internal/dri_interface.h
include/GL/internal/glcore.h
progs/egl/eglinfo.c
progs/egl/xeglgears.c
progs/tests/vpeval.c
progs/tests/vptest1.c
progs/tests/vptest2.c
progs/tests/vptest3.c
scons/crossmingw.py
scons/custom.py
src/egl/drivers/dri2/egl_dri2.c
src/gallium/auxiliary/Makefile
src/gallium/auxiliary/gallivm/lp_bld_interp.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
src/gallium/auxiliary/os/os_thread.h
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
src/gallium/auxiliary/util/u_timed_winsys.c
src/gallium/drivers/i965/brw_swtnl.c
src/gallium/drivers/i965/brw_vs_emit.c
src/gallium/drivers/llvmpipe/Makefile
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_jit.c
src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_rast.h
src/gallium/drivers/llvmpipe/lp_rast_priv.h
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/nv10/nv10_state.c [deleted file]
src/gallium/drivers/nv20/nv20_state.c [deleted file]
src/gallium/drivers/nv30/nv30_context.c
src/gallium/drivers/nv30/nv30_screen.c
src/gallium/drivers/nv30/nv30_surface.c
src/gallium/drivers/nv30/nv30_vbo.c
src/gallium/drivers/nv40/nv40_context.c
src/gallium/drivers/nv40/nv40_draw.c
src/gallium/drivers/nv40/nv40_vbo.c
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/nv50/nv50_surface.c
src/gallium/drivers/nv50/nv50_transfer.c
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_fs.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/r300/r300_tgsi_to_rc.c
src/gallium/drivers/r300/r300_tgsi_to_rc.h
src/gallium/drivers/r300/r300_vs.c
src/gallium/drivers/svga/svga_draw.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/svga/svgadump/svga_shader.h
src/gallium/drivers/svga/svgadump/svga_shader_dump.c
src/gallium/drivers/svga/svgadump/svga_shader_op.c
src/gallium/drivers/svga/svgadump/svga_shader_op.h
src/gallium/drivers/trace/tr_rbug.c
src/gallium/state_trackers/dri/dri_drawable.c
src/gallium/state_trackers/dri/dri_screen.c
src/gallium/state_trackers/wgl/stw_context.c
src/gallium/state_trackers/wgl/stw_device.c
src/gallium/state_trackers/wgl/stw_framebuffer.c
src/gallium/state_trackers/wgl/stw_getprocaddress.c
src/gallium/state_trackers/wgl/stw_pixelformat.c
src/gallium/state_trackers/xorg/xorg_xv.c
src/gallium/winsys/drm/intel/dri/SConscript
src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
src/gallium/winsys/gdi/gdi_softpipe_winsys.c
src/glsl/apps/compile.c
src/glsl/apps/process.c
src/glsl/pp/sl_pp_context.h
src/glsl/pp/sl_pp_extension.c
src/glsl/pp/sl_pp_if.c
src/glsl/pp/sl_pp_public.h
src/glu/sgi/libnurbs/internals/arc.h
src/glu/sgi/libnurbs/internals/bin.cc
src/glu/sgi/libnurbs/internals/uarray.cc
src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/common/utils.h
src/mesa/drivers/dri/ffb/ffb_xmesa.c
src/mesa/drivers/dri/i810/i810screen.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_regions.c
src/mesa/drivers/dri/intel/intel_regions.h
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_screen.h
src/mesa/drivers/dri/intel/intel_tex_image.c
src/mesa/drivers/dri/mach64/mach64_screen.c
src/mesa/drivers/dri/mga/mga_xmesa.c
src/mesa/drivers/dri/nouveau/nouveau_screen.c
src/mesa/drivers/dri/r128/r128_screen.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_state_init.c
src/mesa/drivers/dri/r200/r200_texstate.c
src/mesa/drivers/dri/r300/compiler/r500_fragprog.c
src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_texstate.c
src/mesa/drivers/dri/r600/r600_context.c
src/mesa/drivers/dri/r600/r600_texstate.c
src/mesa/drivers/dri/r600/r700_chip.c
src/mesa/drivers/dri/radeon/radeon_common.h
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_fbo.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/radeon/radeon_span.c
src/mesa/drivers/dri/radeon/radeon_texstate.c
src/mesa/drivers/dri/radeon/radeon_texture.c
src/mesa/drivers/dri/savage/savage_xmesa.c
src/mesa/drivers/dri/sis/sis_screen.c
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/dri/tdfx/tdfx_screen.c
src/mesa/drivers/dri/unichrome/via_screen.c
src/mesa/drivers/windows/gdi/mesa.def
src/mesa/glapi/glapi.h
src/mesa/main/context.c
src/mesa/main/texstore.c
src/mesa/shader/slang/library/SConscript
src/mesa/shader/slang/slang_compile.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/swrast_setup/ss_tritmp.h
windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcproj [new file with mode: 0644]
windows/VC8/mesa/mesa.sln
windows/VC8/mesa/mesa/mesa.vcproj

index 09a8ca29771a3813c7e55a470bbe99176b9a30b3..3a9c92bdfebb4ba991dab68916589274290a3040 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -80,8 +80,6 @@ catamount-osmesa-pgi \
 darwin \
 darwin-fat-32bit \
 darwin-fat-all \
-darwin-static \
-darwin-static-x86ppc \
 freebsd \
 freebsd-dri \
 freebsd-dri-amd64 \
index fa67d14b79562180bf810ab109891165e17823a3..964af7e59188b3c854c55ba1c570029102e636fe 100644 (file)
@@ -83,6 +83,11 @@ machine = env['machine']
 platform = env['platform']
 drawllvm = 'llvmpipe' in env['drivers']
 
+# LLVM support in the Draw module
+if drawllvm:
+        env.Tool('llvm')
+        if not env.has_key('LLVM_VERSION'):
+           drawllvm = False
 
 # derived options
 x86 = machine == 'x86'
@@ -168,13 +173,7 @@ if dri:
 
 # LLVM support in the Draw module
 if drawllvm:
-       # See also http://www.scons.org/wiki/UsingPkgConfig
-        # currently  --ldflags --libsdisabled since the driver will force the correct linkage
-        env.Tool('llvm')
-        if not env.has_key('LLVM_VERSION'):
-           drawllvm = False
-       else:
-           env.Append(CPPDEFINES = ['DRAW_LLVM'])
+    env.Append(CPPDEFINES = ['DRAW_LLVM'])
 
 # libGL
 if platform in ('linux', 'freebsd', 'darwin'):
@@ -226,8 +225,9 @@ SConscript(
        duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
 )
 
-SConscript(
-       'progs/SConscript',
-       variant_dir = os.path.join('progs', env['build']),
-       duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
-)
+if 'progs' in COMMAND_LINE_TARGETS:
+    SConscript(
+        'progs/SConscript',
+        variant_dir = os.path.join('progs', env['build']),
+        duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+    )
diff --git a/configs/darwin-x86ppc b/configs/darwin-x86ppc
deleted file mode 100644 (file)
index 3d82e30..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Configuration for Darwin / MacOS X, making dynamic libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = darwin
-
-# Compiler and flags
-CC = cc
-CXX = cc
-CFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-         -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
-CXXFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-         -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
-
-MKLIB_OPTIONS = -archopt "-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.dylib
-GLU_LIB_NAME = libGLU.dylib
-GLUT_LIB_NAME = libglut.dylib
-GLW_LIB_NAME = libGLw.dylib
-OSMESA_LIB_NAME = libOSMesa.dylib
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
-GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
-GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
-APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-
-# omit glw lib for now:
-SRC_DIRS = gallium mesa glu glut/glx glew
-
index a273a16c891870af86813f21f8f0ed2854850c9f..27405bbc24c7e4632a93cdb09f5f06ec1f7f249b 100644 (file)
@@ -924,6 +924,10 @@ if test "x$enable_egl" = xyes; then
             EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2"
         fi
     fi
+
+    if test "$with_demos" = yes; then
+        PROGRAM_DIRS="$PROGRAM_DIRS egl"
+    fi
 fi
 AC_SUBST([EGL_LIB_DEPS])
 AC_SUBST([EGL_DRIVERS_DIRS])
index 15621b7ebff4adf1e64c3fb596c79b0c4d81db5b..95d274a7a2c70bf3b635b4cda07bc6c495af01ad 100644 (file)
@@ -9,11 +9,8 @@
 <h1>Code Repository</h1>
 
 <p>
-As of December 5, 2006, Mesa is using
-<a href="http://git.or.cz/"target="_parent">git</a>
+Mesa uses <a href="http://git.or.cz/"target="_parent">git</a>
 as its source code management system.
-CVS was used previously.
-The old CVS repository should no longer be used.
 </p>
 
 The master git repository is hosted on
@@ -125,6 +122,83 @@ Questions about branch status/activity should be posted to the
 mesa3d-dev mailing list.
 </p>
 
+<H2>Developer Git Tips</H2>
+
+<ol>
+<li>Setting up to edit the master branch
+<p>
+If you try to do a pull by just saying<code> git pull </code>
+and git complains that you have not specified a
+branch, try:
+<pre>
+    git config branch.master.remote origin
+    git config branch.master.merge master
+</pre>
+Otherwise, you have to say<code> git pull origin master </code>
+each time you do a pull.
+</p>
+<li>Small changes to master
+<p>
+If you are an experienced git user working on substancial modifications,
+you are probably
+working on a separate branch and would rebase your branch prior to
+merging with master.
+But for small changes to the master branch itself,
+you also need to use the rebase feature in order to avoid an
+unnecessary and distracting branch in master.
+</p>
+<p>
+If it has been awhile since you've done the initial clone, try
+<pre>
+    git pull
+</pre>
+to get the latest files before you start working.
+</p>
+<p>
+Make your changes and use
+<pre>
+    git add &lt;files to commit&gt;
+    git commit
+</pre>
+to get your changes ready to push back into the fd.o repository.
+</p>
+<p>
+It is possible (and likely) that someone has changed master since
+you did your last pull.  Even if your changes do not conflict with
+their changes, git will make a fast-forward 
+merge branch, branching from the point in time
+where you did your last pull and merging it to a point after the other changes.
+</p>
+<p>
+To avoid this, 
+<pre>
+    git pull --rebase
+    git push
+</pre>
+If you are familiar with CVS or similar system, this is similar to doing a
+<code> cvs update </code> in order to update your source tree to
+the current repository state, instead of the time you did the last update.
+(CVS doesn't work like git in this respect, but this is easiest way
+to explain it.)
+</br>
+In any case, your repository now looks like you made your changes after
+all the other changes.
+</p>
+<p>
+If the rebase resulted in conflicts or changes that could affect
+the proper operation of your changes, you'll need to investigate
+those before doing the push.
+</p>
+<p>
+If you want the rebase action to be the default action, then
+<pre>
+    git config branch.master.rebase true
+    git config --global branch.autosetuprebase=always
+</pre>
+<p>
+See <a href="http://www.eecs.harvard.edu/~cduan/technical/git/" target="_parent">Understanding Git Conceptually</a> for a fairly clear explanation about all of this.
+</p>
+</ol>
 
 </body>
 </html>
index ec6238f873420401741a3544c70215ceaca55768..58540d60057f06f4177515b90057a4adfede6fe8 100644 (file)
@@ -230,6 +230,13 @@ struct __DRItexOffsetExtensionRec {
 };
 
 
+/* Valid values for format in the setTexBuffer2 function below.  These
+ * values match the GLX tokens for compatibility reasons, but we
+ * define them here since the DRI interface can't depend on GLX. */
+#define __DRI_TEXTURE_FORMAT_NONE        0x20D8
+#define __DRI_TEXTURE_FORMAT_RGB         0x20D9
+#define __DRI_TEXTURE_FORMAT_RGBA        0x20DA
+
 #define __DRI_TEX_BUFFER "DRI_TexBuffer"
 #define __DRI_TEX_BUFFER_VERSION 2
 struct __DRItexBufferExtensionRec {
index 18f657662af973b836e905d833727b62c65e5fd4..547b1113707e231e771b82d87b42bed39fc56ccb 100644 (file)
@@ -178,8 +178,4 @@ typedef struct __GLcontextModesRec {
 #define GLX_TEXTURE_2D_BIT_EXT             0x00000002
 #define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
 
-#define GLX_TEXTURE_FORMAT_NONE_EXT        0x20D8
-#define GLX_TEXTURE_FORMAT_RGB_EXT         0x20D9
-#define GLX_TEXTURE_FORMAT_RGBA_EXT        0x20DA
-
 #endif /* __gl_core_h_ */
index 9664667a68a4bf2ff902c7cfb5476d7bc1ea5865..37bc22e9fd05bcff5d73d11dfc7bf51175334349 100644 (file)
 #define MAX_MODES 1000
 #define MAX_SCREENS 10
 
+/* These are X visual types, so if you're running eglinfo under
+ * something not X, they probably don't make sense. */
+static const char *vnames[] = { "SG", "GS", "SC", "PC", "TC", "DC" };
+
 /**
  * Print table of all available configurations.
  */
@@ -49,15 +53,15 @@ PrintConfigs(EGLDisplay d)
    eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
 
    printf("Configurations:\n");
-   printf("     bf lv colorbuffer dp st  ms    vis cav bi  renderable  supported\n");
-   printf("  id sz  l  r  g  b  a th cl ns b    id eat nd gl es es2 vg surfaces \n");
+   printf("     bf lv colorbuffer dp st  ms    vis   cav bi  renderable  supported\n");
+   printf("  id sz  l  r  g  b  a th cl ns b    id   eat nd gl es es2 vg surfaces \n");
    printf("---------------------------------------------------------------------\n");
    for (i = 0; i < numConfigs; i++) {
       EGLint id, size, level;
       EGLint red, green, blue, alpha;
       EGLint depth, stencil;
       EGLint renderable, surfaces;
-      EGLint vid, caveat, bindRgb, bindRgba;
+      EGLint vid, vtype, caveat, bindRgb, bindRgba;
       EGLint samples, sampleBuffers;
       char surfString[100] = "";
 
@@ -72,6 +76,7 @@ PrintConfigs(EGLDisplay d)
       eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
       eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil);
       eglGetConfigAttrib(d, configs[i], EGL_NATIVE_VISUAL_ID, &vid);
+      eglGetConfigAttrib(d, configs[i], EGL_NATIVE_VISUAL_TYPE, &vtype);
 
       eglGetConfigAttrib(d, configs[i], EGL_CONFIG_CAVEAT, &caveat);
       eglGetConfigAttrib(d, configs[i], EGL_BIND_TO_TEXTURE_RGB, &bindRgb);
@@ -95,11 +100,11 @@ PrintConfigs(EGLDisplay d)
       if (strlen(surfString) > 0)
          surfString[strlen(surfString) - 1] = 0;
 
-      printf("0x%02x %2d %2d %2d %2d %2d %2d %2d %2d %2d%2d 0x%03x ",
+      printf("0x%02x %2d %2d %2d %2d %2d %2d %2d %2d %2d%2d 0x%02x%s ",
              id, size, level,
              red, green, blue, alpha,
              depth, stencil,
-             samples, sampleBuffers, vid);
+             samples, sampleBuffers, vid, vtype < 6 ? vnames[vtype] : "--");
       printf("  %c  %c  %c  %c  %c   %c %s\n",
              (caveat != EGL_NONE) ? 'y' : ' ',
              (bindRgba) ? 'a' : (bindRgb) ? 'y' : ' ',
index 9fdf47424416090c0367d24cd408bb3f4f2caf1b..efb63ef3c91f31f1c8007f9e03e6e6c83c91a66d 100644 (file)
@@ -237,6 +237,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
 static void
 draw(void)
 {
+   glClearColor(0.2, 0.2, 0.2, 0.2);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
    glPushMatrix();
@@ -319,8 +320,6 @@ init(void)
    glEndList();
 
    glEnable(GL_NORMALIZE);
-
-   glClearColor(0.2, 0.2, 0.2, 0.0);
 }
 
 
@@ -529,6 +528,43 @@ egl_manager_destroy(struct egl_manager *eman)
    free(eman);
 }
 
+enum { GEARS_WINDOW, GEARS_PIXMAP, GEARS_PBUFFER_COPY, GEARS_PBUFFER_TEXTURE };
+
+static void
+texture_gears(struct egl_manager *eman)
+{
+   static const GLint verts[12] =
+      { -5, -6, -10,  5, -6, -10,  -5, 4, 10,  5, 4, 10 };
+   static const GLint tex_coords[8] = { 0, 0,  1, 0,  0, 1,  1, 1 };
+   static const GLuint indices[4] = { 0, 1, 2, 3 };
+
+   eglMakeCurrent(eman->dpy, eman->pix, eman->pix, eman->ctx);
+
+   glClearColor(0, 0, 0, 0);
+   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+   glEnable(GL_TEXTURE_2D);
+   glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
+   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   
+   glEnableClientState(GL_VERTEX_ARRAY);
+   glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+   glVertexPointer(3, GL_INT, 0, verts);
+   glTexCoordPointer(2, GL_INT, 0, tex_coords);
+
+   eglBindTexImage(eman->dpy, eman->pbuf, EGL_BACK_BUFFER);
+
+   glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_INT, indices);
+
+   glDisableClientState(GL_VERTEX_ARRAY);
+   glDisableClientState(GL_COLOR_ARRAY);
+   glDisable(GL_TEXTURE_2D);
+
+   eglReleaseTexImage(eman->dpy, eman->pbuf, EGL_BACK_BUFFER);
+}
+
 static void
 event_loop(struct egl_manager *eman, EGLint surface_type, EGLint w, EGLint h)
 {
@@ -597,17 +633,25 @@ event_loop(struct egl_manager *eman, EGLint surface_type, EGLint w, EGLint h)
          if (angle > 3600.0)
              angle -= 3600.0;
 
+        if (surface_type == GEARS_PBUFFER_TEXTURE)
+            eglMakeCurrent(eman->dpy, eman->pbuf, eman->pbuf, eman->ctx);
+
          draw();
          switch (surface_type) {
-         case EGL_WINDOW_BIT:
+         case GEARS_WINDOW:
             eglSwapBuffers(eman->dpy, eman->win);
             break;
-         case EGL_PBUFFER_BIT:
-            eglWaitClient();
-            if (!eglCopyBuffers(eman->dpy, eman->pbuf, eman->xpix))
-               break;
+         case GEARS_PBUFFER_TEXTURE:
+         case GEARS_PBUFFER_COPY:
+           if (surface_type == GEARS_PBUFFER_TEXTURE) {
+              texture_gears(eman);
+           } else {
+              if (!eglCopyBuffers(eman->dpy, eman->pbuf, eman->xpix))
+                 break;
+           }
+           eglWaitClient();
             /* fall through */
-         case EGL_PIXMAP_BIT:
+         case GEARS_PIXMAP:
             eglWaitClient();
             for (x = 0; x < w; x += orig_w) {
                for (y = 0; y < h; y += orig_h) {
@@ -645,7 +689,8 @@ usage(void)
    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");
+   printf("  -pbuffer-copy           use pbuffer surface and eglCopyBuffers\n");
+   printf("  -pbuffer-texture        use pbuffer surface and eglBindTexImage\n");
 }
  
 
@@ -657,7 +702,7 @@ main(int argc, char *argv[])
    char *dpyName = NULL;
    struct egl_manager *eman;
    EGLint attribs[] = {
-      EGL_SURFACE_TYPE, 0, /* filled later */
+      EGL_SURFACE_TYPE, EGL_WINDOW_BIT, /* may be changed later */
       EGL_RED_SIZE, 1,
       EGL_GREEN_SIZE, 1,
       EGL_BLUE_SIZE, 1,
@@ -666,7 +711,7 @@ main(int argc, char *argv[])
       EGL_NONE
    };
    char win_title[] = "xeglgears (window/pixmap/pbuffer)";
-   EGLint surface_type = EGL_WINDOW_BIT;
+   EGLint surface_type = GEARS_WINDOW;
    GLboolean printInfo = GL_FALSE;
    GLboolean fullscreen = GL_FALSE;
    EGLBoolean ret;
@@ -684,10 +729,16 @@ main(int argc, char *argv[])
          fullscreen = GL_TRUE;
       }
       else if (strcmp(argv[i], "-pixmap") == 0) {
-         surface_type = EGL_PIXMAP_BIT;
+         surface_type = GEARS_PIXMAP;
+        attribs[1] = EGL_PIXMAP_BIT;
       }
-      else if (strcmp(argv[i], "-pbuffer") == 0) {
-         surface_type = EGL_PBUFFER_BIT;
+      else if (strcmp(argv[i], "-pbuffer-copy") == 0) {
+         surface_type = GEARS_PBUFFER_COPY;
+        attribs[1] = EGL_PBUFFER_BIT;
+      }
+      else if (strcmp(argv[i], "-pbuffer-texture") == 0) {
+         surface_type = GEARS_PBUFFER_TEXTURE;
+        attribs[1] = EGL_PBUFFER_BIT;
       }
       else {
          usage();
@@ -695,9 +746,6 @@ main(int argc, char *argv[])
       }
    }
 
-   /* set surface type */
-   attribs[1] = surface_type;
-
    x_dpy = XOpenDisplay(dpyName);
    if (!x_dpy) {
       printf("Error: couldn't open display %s\n",
@@ -714,18 +762,18 @@ main(int argc, char *argv[])
    }
 
    snprintf(win_title, sizeof(win_title), "xeglgears (%s)",
-            (surface_type == EGL_WINDOW_BIT) ? "window" :
-            (surface_type == EGL_PIXMAP_BIT) ? "pixmap" : "pbuffer");
+            (surface_type == GEARS_WINDOW) ? "window" :
+            (surface_type == GEARS_PIXMAP) ? "pixmap" : "pbuffer");
 
    /* create surface(s) */
    switch (surface_type) {
-   case EGL_WINDOW_BIT:
+   case GEARS_WINDOW:
       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:
+   case GEARS_PIXMAP:
       ret = (egl_manager_create_window(eman, win_title, winWidth, winHeight,
                                        EGL_FALSE, fullscreen, NULL) &&
              egl_manager_create_pixmap(eman, eman->xwin,
@@ -733,17 +781,20 @@ main(int argc, char *argv[])
       if (ret)
          ret = eglMakeCurrent(eman->dpy, eman->pix, eman->pix, eman->ctx);
       break;
-   case EGL_PBUFFER_BIT:
+   case GEARS_PBUFFER_TEXTURE:
+   case GEARS_PBUFFER_COPY:
       {
          EGLint pbuf_attribs[] = {
             EGL_WIDTH, winWidth,
             EGL_HEIGHT, winHeight,
+           EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB,
+           EGL_TEXTURE_TARGET, EGL_TEXTURE_2D,
             EGL_NONE
          };
          ret = (egl_manager_create_window(eman, win_title, winWidth, winHeight,
-                                          EGL_FALSE, fullscreen, NULL) &&
+                                         EGL_FALSE, fullscreen, NULL) &&
                 egl_manager_create_pixmap(eman, eman->xwin,
-                                          EGL_FALSE, NULL) &&
+                                         EGL_TRUE, NULL) &&
                 egl_manager_create_pbuffer(eman, pbuf_attribs));
          if (ret)
             ret = eglMakeCurrent(eman->dpy, eman->pbuf, eman->pbuf, eman->ctx);
index 3e8a732df59be2196d86201b28a39e153fc07ec7..a4024b5336b2e86db20ed3c376645aafab113148 100644 (file)
@@ -145,6 +145,11 @@ myinit(int argc, char *argv[])
 
     printf("Using vertex program attribs? %s\n", program ? "yes" : "no");
 
+    if (program && !glutExtensionSupported("GL_NV_vertex_program")) {
+       printf("Sorry, this requires GL_NV_vertex_program\n");
+       exit(1);
+    }
+
     if (!program) {
         glMap2f(GL_MAP2_VERTEX_4,
                 0.0, 1.0, 4, 4,
index 6e32b033468ef97f3058f23a73089df2e4d63423..d83f9cae37b989780001e2ae9488c7820aba07a2 100644 (file)
@@ -113,6 +113,11 @@ static void Init( void )
 
    GLuint progs[5];
 
+   if (!glutExtensionSupported("GL_NV_vertex_program")) {
+      printf("Sorry, this program requires GL_NV_vertex_program\n");
+      exit(1);
+   }
+
    glGenProgramsNV(2, progs);
    assert(progs[0]);
    assert(progs[1]);
index 4161b03a673583467f5799f9c590036627233a7f..89cd6b1458c173669a78dc2965fb1aa4be53cdbb 100644 (file)
@@ -144,6 +144,12 @@ int main( int argc, char *argv[] )
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );
+
+   if (!glutExtensionSupported("GL_NV_vertex_program")) {
+      printf("Sorry, this program requires GL_NV_vertex_program\n");
+      exit(1);
+   }
+
    Test1();
    Test2();
    Test3();
index 4e4bfee31dc95a9453bb22cdac4cd35b7e9c9f0f..58ce227e6e07d8cd2f778f9821b148e3c6d254c7 100644 (file)
@@ -93,6 +93,11 @@ static void Init( void )
 #endif
       "END\n";
 
+   if (!glutExtensionSupported("GL_NV_vertex_program")) {
+      printf("Sorry, this program requires GL_NV_vertex_program\n");
+      exit(1);
+   }
+
    glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
                    strlen(prog1),
                    (const GLubyte *) prog1);
index a4ae74e8d5454e3fc729ffea864791fd6c04821a..03bfbd7eb3c7af573e183e35ccc3718f47f2229f 100644 (file)
@@ -53,6 +53,7 @@ prefixes = SCons.Util.Split("""
     i486-mingw32msvc-
     i586-mingw32msvc-
     i686-mingw32msvc-
+    i686-pc-mingw32-
 """)
 
 def find(env):
index 572b963388a8819fd4ed3c8adcbf5c9640ee3104..364da292dd3299117ddf84018eb5bddb754fee5a 100644 (file)
@@ -56,6 +56,7 @@ def quietCommandLines(env):
     env['SHLINKCOMSTR'] = "  Linking $TARGET ..."
     env['LDMODULECOMSTR'] = "  Linking $TARGET ..."
     env['SWIGCOMSTR'] = "  Generating $TARGET ..."
+    env['CODEGENCOMSTR'] = "  Generating $TARGET ..."
 
 
 def createConvenienceLibBuilder(env):
@@ -125,7 +126,8 @@ def code_generate(env, script, target, source, command):
 
     # This command creates generated code *in the build directory*.
     command = command.replace('$SCRIPT', script_src.path)
-    code = env.Command(target, source, command)
+    action = SCons.Action.Action(command, "$CODEGENCOMSTR")
+    code = env.Command(target, source, action)
 
     # Explicitly mark that the generated code depends on the generator,
     # and on implicitly imported python modules
index 92378892e5bd414ca9303a12dd2fbffdaf4e6fc9..5d36c49b2c9ff2c910716f42e3aa79890d3624a9 100644 (file)
@@ -58,15 +58,16 @@ struct dri2_egl_driver
 
 struct dri2_egl_display
 {
-   xcb_connection_t     *conn;
-   int                   dri2_major;
-   int                   dri2_minor;
-   __DRIscreen          *dri_screen;
-   void                 *driver;
-   __DRIcoreExtension   *core;
-   __DRIdri2Extension   *dri2;
-   __DRI2flushExtension *flush;
-   int                   fd;
+   xcb_connection_t         *conn;
+   int                       dri2_major;
+   int                       dri2_minor;
+   __DRIscreen              *dri_screen;
+   void                     *driver;
+   __DRIcoreExtension       *core;
+   __DRIdri2Extension       *dri2;
+   __DRI2flushExtension     *flush;
+   __DRItexBufferExtension  *tex_buffer;
+   int                       fd;
 
    __DRIdri2LoaderExtension  loader_extension;
    const __DRIextension     *extensions[2];
@@ -86,7 +87,6 @@ struct dri2_egl_surface
    __DRIbuffer          buffers[5];
    int                  buffer_count;
    xcb_xfixes_region_t  region;
-   int                  have_back;
    int                  have_fake_front;
    int                  swap_interval;
 };
@@ -107,7 +107,7 @@ EGLint dri2_to_egl_attribute_map[] = {
    EGL_RED_SIZE,               /* __DRI_ATTRIB_RED_SIZE */
    EGL_GREEN_SIZE,             /* __DRI_ATTRIB_GREEN_SIZE */
    EGL_BLUE_SIZE,              /* __DRI_ATTRIB_BLUE_SIZE */
-   0,                          /* __DRI_ATTRIB_LUMINANCE_SIZE */
+   EGL_LUMINANCE_SIZE,         /* __DRI_ATTRIB_LUMINANCE_SIZE */
    EGL_ALPHA_SIZE,             /* __DRI_ATTRIB_ALPHA_SIZE */
    0,                          /* __DRI_ATTRIB_ALPHA_MASK_SIZE */
    EGL_DEPTH_SIZE,             /* __DRI_ATTRIB_DEPTH_SIZE */
@@ -152,28 +152,22 @@ EGLint dri2_to_egl_attribute_map[] = {
 };
 
 static void
-dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id)
+dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
+               int depth, xcb_visualtype_t *visual)
 {
    struct dri2_egl_config *conf;
    struct dri2_egl_display *dri2_dpy;
+   _EGLConfig base;
    unsigned int attrib, value, double_buffer;
    EGLint key, bind_to_texture_rgb, bind_to_texture_rgba;
    int i;
 
    dri2_dpy = disp->DriverData;
-   conf = malloc(sizeof *conf);
-   if (conf == NULL)
-      return;
-
-   conf->dri_config = dri_config;
-   _eglInitConfig(&conf->base, disp, id);
+   _eglInitConfig(&base, disp, id);
    
    i = 0;
    while (dri2_dpy->core->indexConfigAttrib(dri_config, i++, &attrib, &value)) {
       switch (attrib) {
-      case 0:
-        break;
-        
       case __DRI_ATTRIB_RENDER_TYPE:
         if (value & __DRI_ATTRIB_RGBA_BIT)
            value = EGL_RGB_BUFFER;
@@ -181,7 +175,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id)
            value = EGL_LUMINANCE_BUFFER;
         else
            /* not valid */;
-        _eglSetConfigKey(&conf->base, EGL_COLOR_BUFFER_TYPE, value);
+        _eglSetConfigKey(&base, EGL_COLOR_BUFFER_TYPE, value);
         break;  
 
       case __DRI_ATTRIB_CONFIG_CAVEAT:
@@ -191,7 +185,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id)
             value = EGL_SLOW_CONFIG;
         else
            value = EGL_NONE;
-        _eglSetConfigKey(&conf->base, EGL_CONFIG_CAVEAT, value);
+        _eglSetConfigKey(&base, EGL_CONFIG_CAVEAT, value);
          break;
 
       case __DRI_ATTRIB_BIND_TO_TEXTURE_RGB:
@@ -209,39 +203,57 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id)
       default:
         key = dri2_to_egl_attribute_map[attrib];
         if (key != 0)
-           _eglSetConfigKey(&conf->base, key, value);
+           _eglSetConfigKey(&base, key, value);
         break;
       }
    }
 
-   /* EGL_SWAP_BEHAVIOR_PRESERVED_BIT */
+   /* In EGL, double buffer or not isn't a config attribute.  Pixmaps
+    * surfaces are always single buffered, pbuffer surfaces are always
+    * back buffers and windows can be either, selected by passing an
+    * attribute at window surface construction time.  To support this
+    * we ignore all double buffer configs and manipulate the buffer we
+    * return in the getBuffer callback to get the behaviour we want. */
 
-   if (double_buffer) {
-      /* FIXME: Figure out how to get the visual ID and types */
-      _eglSetConfigKey(&conf->base, EGL_SURFACE_TYPE, EGL_WINDOW_BIT);
-      _eglSetConfigKey(&conf->base, EGL_NATIVE_VISUAL_ID, 0x21);
-      _eglSetConfigKey(&conf->base, EGL_NATIVE_VISUAL_TYPE,
-                      XCB_VISUAL_CLASS_TRUE_COLOR);
+   if (double_buffer)
+      return;
+
+   if (visual != NULL) {
+      if (depth != _eglGetConfigKey(&base, EGL_BUFFER_SIZE))
+        return;
+
+      _eglSetConfigKey(&base, EGL_SURFACE_TYPE,
+                      EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT |
+                      EGL_SWAP_BEHAVIOR_PRESERVED_BIT);
+
+      _eglSetConfigKey(&base, EGL_NATIVE_VISUAL_ID, visual->visual_id);
+      _eglSetConfigKey(&base, EGL_NATIVE_VISUAL_TYPE, visual->_class);
    } else {
-      _eglSetConfigKey(&conf->base,
-                      EGL_SURFACE_TYPE, EGL_PIXMAP_BIT | EGL_PBUFFER_BIT);
-      _eglSetConfigKey(&conf->base,
-                      EGL_BIND_TO_TEXTURE_RGB, bind_to_texture_rgb);
-      _eglSetConfigKey(&conf->base,
-                      EGL_BIND_TO_TEXTURE_RGBA, bind_to_texture_rgba);
+      _eglSetConfigKey(&base, EGL_SURFACE_TYPE,
+                      EGL_PIXMAP_BIT | EGL_PBUFFER_BIT);
    }
 
+   _eglSetConfigKey(&base, EGL_NATIVE_RENDERABLE, EGL_TRUE);
+   _eglSetConfigKey(&base, EGL_BIND_TO_TEXTURE_RGB, bind_to_texture_rgb);
+   if (_eglGetConfigKey(&base, EGL_ALPHA_SIZE) > 0)
+      _eglSetConfigKey(&base,
+                      EGL_BIND_TO_TEXTURE_RGBA, bind_to_texture_rgba);
+
    /* EGL_OPENGL_ES_BIT, EGL_OPENVG_BIT, EGL_OPENGL_ES2_BIT */
-   _eglSetConfigKey(&conf->base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
-   _eglSetConfigKey(&conf->base, EGL_CONFORMANT, EGL_OPENGL_BIT);
+   _eglSetConfigKey(&base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
+   _eglSetConfigKey(&base, EGL_CONFORMANT, EGL_OPENGL_BIT);
 
-   if (!_eglValidateConfig(&conf->base, EGL_FALSE)) {
+   if (!_eglValidateConfig(&base, EGL_FALSE)) {
       _eglLog(_EGL_DEBUG, "DRI2: failed to validate config %d", id);
-      free(conf);
       return;
    }
 
-   _eglAddConfig(disp, &conf->base);
+   conf = malloc(sizeof *conf);
+   if (conf != NULL) {
+      memcpy(&conf->base, &base, sizeof base);
+      conf->dri_config = dri_config;
+      _eglAddConfig(disp, &conf->base);
+   }
 }
 
 /**
@@ -261,7 +273,6 @@ dri2_process_buffers(struct dri2_egl_surface *dri2_surf,
 
    dri2_surf->buffer_count = count;
    dri2_surf->have_fake_front = 0;
-   dri2_surf->have_back = 0;
 
    /* This assumes the DRI2 buffer attachment tokens matches the
     * __DRIbuffer tokens. */
@@ -271,10 +282,14 @@ dri2_process_buffers(struct dri2_egl_surface *dri2_surf,
       dri2_surf->buffers[i].pitch = buffers[i].pitch;
       dri2_surf->buffers[i].cpp = buffers[i].cpp;
       dri2_surf->buffers[i].flags = buffers[i].flags;
+
+      /* We only use the DRI drivers single buffer configs.  This
+       * means that if we try to render to a window, DRI2 will give us
+       * the fake front buffer, which we'll use as a back buffer.
+       * Note that EGL doesn't require that several clients rendering
+       * to the same window must see the same aux buffers. */
       if (dri2_surf->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)
          dri2_surf->have_fake_front = 1;
-      if (dri2_surf->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT)
-         dri2_surf->have_back = 1;
    }
 
    if (dri2_surf->region != XCB_NONE)
@@ -375,6 +390,57 @@ static const char dri_driver_format[] = "%.*s/%.*s_dri.so";
 
 static const char dri_driver_path[] = DEFAULT_DRIVER_DIR;
 
+struct dri2_extension_match {
+   const char *name;
+   int version;
+   int offset;
+};
+
+static struct dri2_extension_match dri2_driver_extensions[] = {
+   { __DRI_CORE, 1, offsetof(struct dri2_egl_display, core) },
+   { __DRI_DRI2, 1, offsetof(struct dri2_egl_display, dri2) },
+   { NULL }
+};
+
+static struct dri2_extension_match dri2_core_extensions[] = {
+   { __DRI2_FLUSH, 1, offsetof(struct dri2_egl_display, flush) },
+   { __DRI_TEX_BUFFER, 2, offsetof(struct dri2_egl_display, tex_buffer) },
+   { NULL }
+};
+
+static EGLBoolean
+dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
+                    struct dri2_extension_match *matches,
+                    const __DRIextension **extensions)
+{
+   int i, j, ret = EGL_TRUE;
+   void *field;
+
+   for (i = 0; extensions[i]; i++) {
+      _eglLog(_EGL_DEBUG, "DRI2: found extension `%s'", extensions[i]->name);
+      for (j = 0; matches[j].name; j++) {
+        if (strcmp(extensions[i]->name, matches[j].name) == 0 &&
+            extensions[i]->version >= matches[j].version) {
+           field = ((char *) dri2_dpy + matches[j].offset);
+           *(const __DRIextension **) field = extensions[i];
+           _eglLog(_EGL_INFO, "DRI2: found extension %s version %d",
+                   extensions[i]->name, extensions[i]->version);
+        }
+      }
+   }
+   
+   for (j = 0; matches[j].name; j++) {
+      field = ((char *) dri2_dpy + matches[j].offset);
+      if (*(const __DRIextension **) field == NULL) {
+        _eglLog(_EGL_FATAL, "DRI2: did not find extension %s version %d",
+                matches[j].name, matches[j].version);
+        ret = EGL_FALSE;
+      }
+   }
+
+   return ret;
+}
+
 /**
  * Called via eglInitialize(), GLX_drv->API.Initialize().
  */
@@ -397,7 +463,9 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp,
    xcb_generic_error_t *error;
    drm_magic_t magic;
    xcb_screen_iterator_t s;
-   int i;
+   xcb_depth_iterator_t d;
+   xcb_visualtype_t *visuals;
+   int i, j, id;
 
    dri2_dpy = malloc(sizeof *dri2_dpy);
    if (!dri2_dpy)
@@ -497,24 +565,8 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp,
       goto cleanup_driver;
    }
 
-   for (i = 0; extensions[i]; i++) {
-      _eglLog(_EGL_DEBUG, "DRI2: found driver extension `%s'",
-             extensions[i]->name);
-      if (strcmp(extensions[i]->name, __DRI_CORE) == 0)
-        dri2_dpy->core = (__DRIcoreExtension *) extensions[i];
-      if (strcmp(extensions[i]->name, __DRI_DRI2) == 0)
-        dri2_dpy->dri2 = (__DRIdri2Extension *) extensions[i];
-   }
-
-   if (dri2_dpy->core == NULL) {
-      _eglLog(_EGL_FATAL, "DRI2: driver has no core extension");
+   if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions))
       goto cleanup_driver;
-   }
-
-   if (dri2_dpy->dri2 == NULL) {
-      _eglLog(_EGL_FATAL, "DRI2: driver has no dri2 extension");
-      goto cleanup_driver;
-   }
 
    snprintf(path, sizeof path, "%.*s",
            xcb_dri2_connect_device_name_length (connect),
@@ -570,20 +622,30 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp,
    }
 
    extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
-   for (i = 0; extensions[i]; i++) {
-      _eglLog(_EGL_DEBUG, "DRI2: found core extension `%s'",
-             extensions[i]->name);
-      if ((strcmp(extensions[i]->name, __DRI2_FLUSH) == 0))
-        dri2_dpy->flush = (__DRI2flushExtension *) extensions[i];
-   }
-
-   if (dri2_dpy->flush == NULL) {
-      _eglLog(_EGL_FATAL, "DRI2: driver doesn't support the flush extension");
+   if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
       goto cleanup_dri_screen;
+
+   s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
+   d = xcb_screen_allowed_depths_iterator(s.data);
+   id = 1;
+   while (d.rem > 0) {
+      EGLBoolean class_added[6] = { 0, };
+
+      visuals = xcb_depth_visuals(d.data);
+      for (i = 0; i < xcb_depth_visuals_length(d.data); i++) {
+        if (class_added[visuals[i]._class])
+           continue;
+
+        class_added[visuals[i]._class] = EGL_TRUE;
+        for (j = 0; driver_configs[j]; j++)
+           dri2_add_config(disp, driver_configs[j],
+                           id++, d.data->depth, &visuals[i]);
+
+      }
+
+      xcb_depth_next(&d);      
    }
 
-   for (i = 0; driver_configs[i]; i++)
-      dri2_add_config(disp, driver_configs[i], i + 1);
    if (!disp->NumConfigs) {
       _eglLog(_EGL_WARNING, "DRI2: failed to create any config");
       goto cleanup_configs;
@@ -852,21 +914,22 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
 #if 0
    /* FIXME: Add support for dri swapbuffers, that'll give us swap
     * interval and page flipping (at least for fullscreen windows) as
-    * well as the page flip event. */
+    * well as the page flip event.  Unless surface->SwapBehavior is
+    * EGL_BUFFER_PRESERVED. */
 #if __DRI2_FLUSH_VERSION >= 2
    if (pdraw->psc->f)
       (*pdraw->psc->f->flushInvalidate)(pdraw->driDrawable);
 #endif
 #endif
 
-   if (!dri2_surf->have_back)
+   if (!dri2_surf->have_fake_front)
       return EGL_TRUE;
 
    cookie = xcb_dri2_copy_region_unchecked(dri2_dpy->conn,
                                           dri2_surf->drawable,
                                           dri2_surf->region,
                                           XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT,
-                                          XCB_DRI2_ATTACHMENT_BUFFER_BACK_LEFT);
+                                          XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_LEFT);
    free(xcb_dri2_copy_region_reply(dri2_dpy->conn, cookie, NULL));
 
    return EGL_TRUE;
@@ -939,6 +1002,69 @@ dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
    return EGL_TRUE;
 }
 
+static EGLBoolean
+dri2_bind_tex_image(_EGLDriver *drv,
+                   _EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
+{
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
+   struct dri2_egl_context *dri2_ctx;
+   _EGLContext *ctx;
+   GLint format, target;
+
+   ctx = _eglGetCurrentContext();
+   dri2_ctx = dri2_egl_context(ctx);
+
+   if (buffer != EGL_BACK_BUFFER) {
+      _eglError(EGL_BAD_PARAMETER, "eglBindTexImage");
+      return EGL_FALSE;
+   }
+
+   /* We allow binding pixmaps too... Not conformat, but we can do it
+    * for free and it's useful for X compositors.  Supposedly there's
+    * a EGL_NOKIA_texture_from_pixmap extension that allows that, but
+    * I couldn't find it at this time. */
+   if ((dri2_surf->base.Type & (EGL_PBUFFER_BIT | EGL_PIXMAP_BIT)) == 0) {
+      _eglError(EGL_BAD_SURFACE, "eglBindTexImage");
+      return EGL_FALSE;
+   }
+
+   switch (dri2_surf->base.TextureFormat) {
+   case EGL_TEXTURE_RGB:
+      format = __DRI_TEXTURE_FORMAT_RGB;
+      break;
+   case EGL_TEXTURE_RGBA:
+      format = __DRI_TEXTURE_FORMAT_RGBA;
+      break;
+   default:
+      _eglError(EGL_BAD_MATCH, "eglBindTexImage");
+      return EGL_FALSE;
+   }
+
+   switch (dri2_surf->base.TextureTarget) {
+   case EGL_TEXTURE_2D:
+      target = GL_TEXTURE_2D;
+      break;
+   default:
+      _eglError(EGL_BAD_PARAMETER, "eglBindTexImage");
+      return EGL_FALSE;
+   }
+
+   (*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
+                                         target, format,
+                                         dri2_surf->dri_drawable);
+
+   return dri2_surf->base.BoundToTexture = EGL_TRUE;
+}
+
+static EGLBoolean
+dri2_release_tex_image(_EGLDriver *drv,
+                      _EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
+{
+   return EGL_TRUE;
+}
+
+
 /**
  * This is the main entrypoint into the driver, called by libEGL.
  * Create a new _EGLDriver object and init its dispatch table.
@@ -966,6 +1092,8 @@ _eglMain(const char *args)
    dri2_drv->base.API.WaitClient = dri2_wait_client;
    dri2_drv->base.API.WaitNative = dri2_wait_native;
    dri2_drv->base.API.CopyBuffers = dri2_copy_buffers;
+   dri2_drv->base.API.BindTexImage = dri2_bind_tex_image;
+   dri2_drv->base.API.ReleaseTexImage = dri2_release_tex_image;
 
    dri2_drv->base.Name = "DRI2";
    dri2_drv->base.Unload = dri2_unload;
index 02c65a9b2d9cbb43d7401dd55565cebd02cfc26d..507ca6e6aaab6a0659c31ee5b1c3f15987466f1b 100644 (file)
@@ -166,6 +166,9 @@ CPP_SOURCES += \
 endif
 
 
+LIBRARY_DEFINES += -D__STDC_CONSTANT_MACROS
+
+
 include ../Makefile.template
 
 
index a6acaead88766019f984346a061bd07dd35e3841..2fc894017d8f450a73f6f637da90dc293575ed07 100644 (file)
@@ -376,6 +376,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld,
 
       case TGSI_TOKEN_TYPE_INSTRUCTION:
       case TGSI_TOKEN_TYPE_IMMEDIATE:
+      case TGSI_TOKEN_TYPE_PROPERTY:
          break;
 
       default:
index a52c6c5028849292084091cce4d2ad87f9f54bc2..4cf28a9f934b8d91c398cfdd4ed7419d3e572c6e 100644 (file)
@@ -1403,8 +1403,7 @@ emit_instruction(
       break;
 
    case TGSI_OPCODE_CONT:
-      /* deprecated? */
-      assert(0);
+      /* FIXME */
       return 0;
       break;
 
@@ -1499,6 +1498,9 @@ lp_build_tgsi_soa(LLVMBuilderRef builder,
          }
          break;
 
+      case TGSI_TOKEN_TYPE_PROPERTY:
+         break;
+
       default:
          assert( 0 );
       }
index 8ae90308c53db9b72c95abcb75b1a79a0a8fc417..a04df4106f2b2278a4864904ba836a039efc7c55 100644 (file)
@@ -116,25 +116,6 @@ typedef pthread_cond_t pipe_condvar;
   pthread_cond_broadcast(&(cond))
 
 
-/* pipe_barrier
- */
-typedef pthread_barrier_t pipe_barrier;
-
-static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
-{
-   pthread_barrier_init(barrier, NULL, count);
-}
-
-static INLINE void pipe_barrier_destroy(pipe_barrier *barrier)
-{
-   pthread_barrier_destroy(barrier);
-}
-
-static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
-{
-   pthread_barrier_wait(barrier);
-}
-
 
 #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
 
@@ -208,26 +189,6 @@ typedef unsigned pipe_condvar;
    (void) cond
 
 
-/* pipe_barrier (XXX FIX THIS)
- */
-typedef unsigned pipe_barrier;
-
-static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
-{
-   /* XXX we could implement barriers with a mutex and condition var */
-}
-
-static INLINE void pipe_barrier_destroy(pipe_barrier *barrier)
-{
-}
-
-static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
-{
-   assert(0);
-}
-
-
-
 #else
 
 /** Dummy definitions */
@@ -254,7 +215,6 @@ static INLINE int pipe_thread_destroy( pipe_thread thread )
 
 typedef unsigned pipe_mutex;
 typedef unsigned pipe_condvar;
-typedef unsigned pipe_barrier;
 
 #define pipe_static_mutex(mutex) \
    static pipe_mutex mutex = 0
@@ -290,6 +250,57 @@ typedef unsigned pipe_barrier;
    (void) condvar
 
 
+#endif  /* PIPE_OS_? */
+
+
+/*
+ * pipe_barrier
+ */
+
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
+
+typedef pthread_barrier_t pipe_barrier;
+
+static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
+{
+   pthread_barrier_init(barrier, NULL, count);
+}
+
+static INLINE void pipe_barrier_destroy(pipe_barrier *barrier)
+{
+   pthread_barrier_destroy(barrier);
+}
+
+static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
+{
+   pthread_barrier_wait(barrier);
+}
+
+
+#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+
+/* XXX FIX THIS */
+typedef unsigned pipe_barrier;
+
+static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
+{
+   /* XXX we could implement barriers with a mutex and condition var */
+}
+
+static INLINE void pipe_barrier_destroy(pipe_barrier *barrier)
+{
+}
+
+static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
+{
+   assert(0);
+}
+
+
+#else
+
+typedef unsigned pipe_barrier;
+
 static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
 {
    /* XXX we could implement barriers with a mutex and condition var */
@@ -307,8 +318,7 @@ static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
 }
 
 
-
-#endif  /* PIPE_OS_? */
+#endif
 
 
 /*
index c1498318dfb1b85b623fb796e90cb7686b62ef45..53bc019a204eebbb955b91260cf38cdafb0e3f30 100644 (file)
@@ -65,7 +65,7 @@ struct pb_cache_buffer
    struct pb_cache_manager *mgr;
 
    /** Caching time interval */
-   struct util_time start, end;
+   int64_t start, end;
 
    struct list_head head;
 };
@@ -126,16 +126,16 @@ _pb_cache_buffer_list_check_free(struct pb_cache_manager *mgr)
 {
    struct list_head *curr, *next;
    struct pb_cache_buffer *buf;
-   struct util_time now;
+   int64_t now;
    
-   util_time_get(&now);
+   now = os_time_get();
    
    curr = mgr->delayed.next;
    next = curr->next;
    while(curr != &mgr->delayed) {
       buf = LIST_ENTRY(struct pb_cache_buffer, curr, head);
 
-      if(!util_time_timeout(&buf->start, &buf->end, &now))
+      if(!os_time_timeout(buf->start, buf->end, now))
         break;
         
       _pb_cache_buffer_destroy(buf);
@@ -157,8 +157,8 @@ pb_cache_buffer_destroy(struct pb_buffer *_buf)
    
    _pb_cache_buffer_list_check_free(mgr);
    
-   util_time_get(&buf->start);
-   util_time_add(&buf->start, mgr->usecs, &buf->end);
+   buf->start = os_time_get();
+   buf->end = buf->start + mgr->usecs;
    LIST_ADDTAIL(&buf->head, &mgr->delayed);
    ++mgr->numDelayed;
    pipe_mutex_unlock(mgr->mutex);
@@ -253,7 +253,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
    struct pb_cache_buffer *buf;
    struct pb_cache_buffer *curr_buf;
    struct list_head *curr, *next;
-   struct util_time now;
+   int64_t now;
    
    pipe_mutex_lock(mgr->mutex);
 
@@ -262,12 +262,12 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
    next = curr->next;
    
    /* search in the expired buffers, freeing them in the process */
-   util_time_get(&now);
+   now = os_time_get();
    while(curr != &mgr->delayed) {
       curr_buf = LIST_ENTRY(struct pb_cache_buffer, curr, head);
       if(!buf && pb_cache_is_buffer_compat(curr_buf, size, desc))
         buf = curr_buf;
-      else if(util_time_timeout(&curr_buf->start, &curr_buf->end, &now))
+      else if(os_time_timeout(curr_buf->start, curr_buf->end, now))
         _pb_cache_buffer_destroy(curr_buf);
       else
          /* This buffer (and all hereafter) are still hot in cache */
index 93f8960641f3364d77ecded567926fa24cba5703..c2593cf16537de6a45ac4e5c92eb2f66db964be1 100644 (file)
@@ -349,7 +349,7 @@ pb_debug_manager_dump(struct pb_debug_manager *mgr)
    while(curr != &mgr->list) {
       buf = LIST_ENTRY(struct pb_debug_buffer, curr, head);
 
-      debug_printf("buffer = %p\n", buf);
+      debug_printf("buffer = %p\n", (void *) buf);
       debug_printf("    .size = 0x%x\n", buf->base.base.size);
       debug_backtrace_dump(buf->create_backtrace, PB_DEBUG_CREATE_BACKTRACE);
       
index 59bdcd2c451ef163e4f41533aeb52920bdb22ab9..d88298bc14c31b27c47e56523e0187f71b702bc9 100644 (file)
@@ -33,7 +33,7 @@
 #include "util/u_simple_screen.h"
 #include "u_timed_winsys.h"
 #include "util/u_memory.h"
-#include "util/u_time.h"
+#include "os/os_time.h"
 
 
 struct timed_winsys {
@@ -54,12 +54,6 @@ static struct timed_winsys *timed_winsys( struct pipe_winsys *winsys )
 }
 
 
-static uint64_t time_start( void )
-{
-   return util_time_micros();
-}
-
-
 static void time_display( struct pipe_winsys *winsys )
 {
    struct timed_winsys *tws = timed_winsys(winsys);
@@ -90,7 +84,7 @@ static void time_finish( struct pipe_winsys *winsys,
                          const char *name ) 
 {
    struct timed_winsys *tws = timed_winsys(winsys);
-   uint64_t endval = util_time_micros();
+   int64_t endval = os_time_get();
    double elapsed = (endval - startval)/1000.0;
 
    if (endval - startval > 1000LL) 
@@ -120,7 +114,7 @@ timed_buffer_create(struct pipe_winsys *winsys,
                     unsigned size )
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    struct pipe_buffer *buf =
       backend->buffer_create( backend, alignment, usage, size );
@@ -139,7 +133,7 @@ timed_user_buffer_create(struct pipe_winsys *winsys,
                              unsigned bytes) 
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    struct pipe_buffer *buf = backend->user_buffer_create( backend, data, bytes );
 
@@ -155,7 +149,7 @@ timed_buffer_map(struct pipe_winsys *winsys,
                      unsigned flags)
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    void *map = backend->buffer_map( backend, buf, flags );
 
@@ -170,7 +164,7 @@ timed_buffer_unmap(struct pipe_winsys *winsys,
                        struct pipe_buffer *buf)
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    backend->buffer_unmap( backend, buf );
 
@@ -183,7 +177,7 @@ timed_buffer_destroy(struct pipe_buffer *buf)
 {
    struct pipe_winsys *winsys = buf->screen->winsys;
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    backend->buffer_destroy( buf );
 
@@ -197,7 +191,7 @@ timed_flush_frontbuffer( struct pipe_winsys *winsys,
                          void *context_private)
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    backend->flush_frontbuffer( backend, surf, context_private );
 
@@ -216,7 +210,7 @@ timed_surface_buffer_create(struct pipe_winsys *winsys,
                               unsigned *stride)
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    struct pipe_buffer *ret = backend->surface_buffer_create( backend, width, height, 
                                                              format, usage, tex_usage, stride );
@@ -231,7 +225,7 @@ static const char *
 timed_get_name( struct pipe_winsys *winsys )
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    const char *ret = backend->get_name( backend );
 
@@ -246,7 +240,7 @@ timed_fence_reference(struct pipe_winsys *winsys,
                     struct pipe_fence_handle *fence)
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    backend->fence_reference( backend, ptr, fence );
 
@@ -260,7 +254,7 @@ timed_fence_signalled( struct pipe_winsys *winsys,
                        unsigned flag )
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    int ret = backend->fence_signalled( backend, fence, flag );
 
@@ -275,7 +269,7 @@ timed_fence_finish( struct pipe_winsys *winsys,
                      unsigned flag )
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
-   uint64_t start = time_start();
+   int64_t start = os_time_get();
 
    int ret = backend->fence_finish( backend, fence, flag );
 
index 464013e7c401468838c93ac90a1b6bd75f345137..f96301e99e6d04896c8207f051b513abc511401b 100644 (file)
@@ -3,6 +3,8 @@
 #include "brw_pipe_rast.h"
 
 
+#if 0
+
 static GLboolean need_swtnl( struct brw_context *brw )
 {
    const struct pipe_rasterizer_state *rast = &brw->curr.rast->templ;
@@ -90,6 +92,4 @@ static GLboolean need_swtnl( struct brw_context *brw )
    return FALSE;
 }
 
-
-
-
+#endif
index 8a16205d2f60cc9c1ae9efacbb33fdf4bae09233..5dcbd597ddcaf1860c3efada8a98d5e10ad02592 100644 (file)
@@ -908,6 +908,7 @@ get_constant(struct brw_vs_compile *c,
 }
 
 
+#if 0
 
 /* TODO: relative addressing!
  */
@@ -936,6 +937,8 @@ static struct brw_reg get_reg( struct brw_vs_compile *c,
    }
 }
 
+#endif
+
 
 /**
  * Indirect addressing:  get reg[[arg] + offset].
index e880042b71e9910fd696a8532185dcc4654f92ab..317325143790250678b98404dbe2b0a11bb752e7 100644 (file)
@@ -37,7 +37,6 @@ C_SOURCES = \
        lp_surface.c \
        lp_tex_sample_llvm.c \
        lp_texture.c \
-       lp_tile_surface.c \
        lp_tile_soa.c
 
 CPP_SOURCES = \
@@ -49,11 +48,6 @@ lp_tile_soa.c: lp_tile_soa.py ../../auxiliary/util/u_format_parse.py ../../auxil
        python lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
 
 
-# to make a .s file to inspect assembly code
-.c.s:
-       $(CC) -S $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $<
-
-
 testprogs := lp_test_format    \
             lp_test_blend      \
             lp_test_conv
index 808f49036157039bea43fe163217c7b0bfd78d7f..9120226de0c108a8dbfa9f12589bc1cb4c2d20ab 100644 (file)
@@ -42,8 +42,6 @@
 #include "lp_perf.h"
 #include "lp_state.h"
 #include "lp_surface.h"
-#include "lp_texture.h"
-#include "lp_winsys.h"
 #include "lp_query.h"
 #include "lp_setup.h"
 
index 27b54c59598812d1826f16a0fec03b2096ff4dbf..d3d7e26882d1146395e11336a5a3e6d38abeef4c 100644 (file)
@@ -40,7 +40,6 @@
 #include "lp_debug.h"
 #include "lp_screen.h"
 #include "gallivm/lp_bld_intr.h"
-#include "gallivm/lp_bld_misc.h"
 #include "lp_jit.h"
 
 
index 5ae323fd96cd2b0847aed2dae8f351b09831a6ba..6dbcb3c9b31a98652a5d2743f7febdb2c4c7c984 100644 (file)
@@ -229,13 +229,58 @@ void lp_rast_clear_zstencil( struct lp_rasterizer *rast,
                              unsigned thread_index,
                              const union lp_rast_cmd_arg arg)
 {
-   unsigned i;
-   uint32_t *depth_tile = rast->tasks[thread_index].tile.depth;
-   
+   struct lp_rasterizer_task *task = &rast->tasks[thread_index];
+   const unsigned tile_x = task->x;
+   const unsigned tile_y = task->y;
+   const unsigned height = TILE_SIZE/TILE_VECTOR_HEIGHT;
+   const unsigned width = TILE_SIZE*TILE_VECTOR_HEIGHT;
+   unsigned block_size = util_format_get_blocksize(rast->zsbuf_transfer->texture->format);
+   uint8_t *dst;
+   unsigned dst_stride = rast->zsbuf_transfer->stride*TILE_VECTOR_HEIGHT;
+   unsigned i, j;
+
    LP_DBG(DEBUG_RAST, "%s 0x%x\n", __FUNCTION__, arg.clear_zstencil);
 
-   for (i = 0; i < TILE_SIZE * TILE_SIZE; i++)
-      depth_tile[i] = arg.clear_zstencil;
+   assert(rast->zsbuf_map);
+   if (!rast->zsbuf_map)
+      return;
+
+   LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__);
+
+   /*
+    * Clear the aera of the swizzled depth/depth buffer matching this tile, in
+    * stripes of TILE_VECTOR_HEIGHT x TILE_SIZE at a time.
+    *
+    * The swizzled depth format is such that the depths for
+    * TILE_VECTOR_HEIGHT x TILE_VECTOR_WIDTH pixels have consecutive offsets.
+    */
+
+   dst = lp_rast_depth_pointer(rast, tile_x, tile_y);
+
+   switch (block_size) {
+   case 1:
+      memset(dst, (uint8_t) arg.clear_zstencil, height * width);
+      break;
+   case 2:
+      for (i = 0; i < height; i++) {
+         uint16_t *row = (uint16_t *)dst;
+         for (j = 0; j < width; j++)
+            *row++ = (uint16_t) arg.clear_zstencil;
+         dst += dst_stride;
+      }
+      break;
+   case 4:
+      for (i = 0; i < height; i++) {
+         uint32_t *row = (uint32_t *)dst;
+         for (j = 0; j < width; j++)
+            *row++ = arg.clear_zstencil;
+         dst += dst_stride;
+      }
+      break;
+   default:
+         assert(0);
+         break;
+   }
 }
 
 
@@ -282,53 +327,6 @@ void lp_rast_load_color( struct lp_rasterizer *rast,
 }
 
 
-static void
-lp_tile_read_z32(uint32_t *tile,
-                 const uint8_t *map,
-                 unsigned map_stride,
-                 unsigned x0, unsigned y0, unsigned w, unsigned h)
-{
-   unsigned x, y;
-   const uint8_t *map_row = map + y0*map_stride;
-   for (y = 0; y < h; ++y) {
-      const uint32_t *map_pixel = (uint32_t *)(map_row + x0*4);
-      for (x = 0; x < w; ++x) {
-         *tile++ = *map_pixel++;
-      }
-      map_row += map_stride;
-   }
-}
-
-/**
- * Load tile z/stencil from the framebuffer surface.
- * This is a bin command called during bin processing.
- */
-void lp_rast_load_zstencil( struct lp_rasterizer *rast,
-                            unsigned thread_index,
-                            const union lp_rast_cmd_arg arg )
-{
-   struct lp_rasterizer_task *task = &rast->tasks[thread_index];
-   const unsigned x = task->x;
-   const unsigned y = task->y;
-   unsigned w = TILE_SIZE;
-   unsigned h = TILE_SIZE;
-
-   if (x + w > rast->state.fb.width)
-      w -= x + w - rast->state.fb.width;
-
-   if (y + h > rast->state.fb.height)
-      h -= y + h - rast->state.fb.height;
-
-   LP_DBG(DEBUG_RAST, "%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
-
-   assert(rast->zsbuf_transfer->texture->format == PIPE_FORMAT_Z32_UNORM);
-   lp_tile_read_z32(task->tile.depth,
-                    rast->zsbuf_map, 
-                    rast->zsbuf_transfer->stride,
-                    x, y, w, h);
-}
-
-
 void lp_rast_set_state( struct lp_rasterizer *rast,
                         unsigned thread_index,
                         const union lp_rast_cmd_arg arg )
@@ -377,7 +375,7 @@ void lp_rast_shade_tile( struct lp_rasterizer *rast,
             color[i] = tile->color[i] + 4 * block_offset;
 
          /* depth buffer */
-         depth = tile->depth + block_offset;
+         depth = lp_rast_depth_pointer(rast, tile_x + x, tile_y + y);
 
          /* run shader */
          state->jit_function[0]( &state->jit_context,
@@ -435,12 +433,11 @@ void lp_rast_shade_quads( struct lp_rasterizer *rast,
       color[i] = tile->color[i] + 4 * block_offset;
 
    /* depth buffer */
-   depth = tile->depth + block_offset;
+   depth = lp_rast_depth_pointer(rast, x, y);
 
 
 
 #ifdef DEBUG
-   assert(lp_check_alignment(tile->depth, 16));
    assert(lp_check_alignment(tile->color[0], 16));
    assert(lp_check_alignment(state->jit_context.blend_color, 16));
 
@@ -557,49 +554,6 @@ static void lp_rast_store_color( struct lp_rasterizer *rast,
 }
 
 
-static void
-lp_tile_write_z32(const uint32_t *src, uint8_t *dst, unsigned dst_stride,
-                  unsigned x0, unsigned y0, unsigned w, unsigned h)
-{
-   unsigned x, y;
-   uint8_t *dst_row = dst + y0*dst_stride;
-   for (y = 0; y < h; ++y) {
-      uint32_t *dst_pixel = (uint32_t *)(dst_row + x0*4);
-      for (x = 0; x < w; ++x) {
-         *dst_pixel++ = *src++;
-      }
-      dst_row += dst_stride;
-   }
-}
-
-/**
- * Write the rasterizer's z/stencil tile to the framebuffer.
- */
-static void lp_rast_store_zstencil( struct lp_rasterizer *rast,
-                                    unsigned thread_index )
-{
-   struct lp_rasterizer_task *task = &rast->tasks[thread_index];
-   const unsigned x = task->x;
-   const unsigned y = task->y;
-   unsigned w = TILE_SIZE;
-   unsigned h = TILE_SIZE;
-
-   if (x + w > rast->state.fb.width)
-      w -= x + w - rast->state.fb.width;
-
-   if (y + h > rast->state.fb.height)
-      h -= y + h - rast->state.fb.height;
-
-   LP_DBG(DEBUG_RAST, "%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
-
-   assert(rast->zsbuf_transfer->texture->format == PIPE_FORMAT_Z32_UNORM);
-   lp_tile_write_z32(task->tile.depth,
-                     rast->zsbuf_map, 
-                     rast->zsbuf_transfer->stride,
-                     x, y, w, h);
-}
-
-
 /**
  * Write the rasterizer's tiles to the framebuffer.
  */
@@ -611,9 +565,6 @@ lp_rast_end_tile( struct lp_rasterizer *rast,
 
    if (rast->state.write_color)
       lp_rast_store_color(rast, thread_index);
-
-   if (rast->state.write_zstencil)
-      lp_rast_store_zstencil(rast, thread_index);
 }
 
 
@@ -694,7 +645,6 @@ static struct {
 } cmd_names[] = 
 {
    RAST(load_color),
-   RAST(load_zstencil),
    RAST(clear_color),
    RAST(clear_zstencil),
    RAST(triangle),
@@ -753,7 +703,6 @@ is_empty_bin( const struct cmd_bin *bin )
 
    for (i = 0; i < head->count; i++)
       if (head->cmd[i] != lp_rast_load_color &&
-          head->cmd[i] != lp_rast_load_zstencil &&
           head->cmd[i] != lp_rast_set_state) {
          return FALSE;
       }
@@ -993,7 +942,6 @@ lp_rast_create( struct pipe_screen *screen, struct lp_scene_queue *empty )
       for (cbuf = 0; cbuf < PIPE_MAX_COLOR_BUFS; cbuf++ )
         task->tile.color[cbuf] = align_malloc(TILE_SIZE * TILE_SIZE * 4, 16);
 
-      task->tile.depth = align_malloc(TILE_SIZE * TILE_SIZE * 4, 16);
       task->rast = rast;
       task->thread_index = i;
    }
@@ -1016,7 +964,6 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
    util_unreference_framebuffer_state(&rast->state.fb);
 
    for (i = 0; i < Elements(rast->tasks); i++) {
-      align_free(rast->tasks[i].tile.depth);
       for (cbuf = 0; cbuf < PIPE_MAX_COLOR_BUFS; cbuf++ )
         align_free(rast->tasks[i].tile.color[cbuf]);
    }
index 34da73eb50e69be2009f24c51abd86b24046d20d..875f18e0c0c2fd8c9d571babf9feeb3630d6825a 100644 (file)
@@ -213,10 +213,6 @@ void lp_rast_load_color( struct lp_rasterizer *,
                          unsigned thread_index,
                          const union lp_rast_cmd_arg );
 
-void lp_rast_load_zstencil( struct lp_rasterizer *, 
-                            unsigned thread_index,
-                            const union lp_rast_cmd_arg );
-
 void lp_rast_set_state( struct lp_rasterizer *, 
                         unsigned thread_index,
                         const union lp_rast_cmd_arg );
index 71e3a301e61014cd867de7cc3e7333b7b121bc00..5c5497e0929996a698a9b7a58519b6e43487383f 100644 (file)
@@ -29,6 +29,8 @@
 #define LP_RAST_PRIV_H
 
 #include "os/os_thread.h"
+#include "util/u_format.h"
+#include "gallivm/lp_bld_debug.h"
 #include "lp_rast.h"
 #include "lp_tile_soa.h"
 
@@ -48,8 +50,6 @@ struct lp_rasterizer;
 struct lp_rast_tile
 {
    uint8_t *color[PIPE_MAX_COLOR_BUFS];
-
-   uint32_t *depth;
 };
 
 
@@ -91,7 +91,7 @@ struct lp_rasterizer
    struct pipe_transfer *cbuf_transfer[PIPE_MAX_COLOR_BUFS];
    struct pipe_transfer *zsbuf_transfer;
    void *cbuf_map[PIPE_MAX_COLOR_BUFS];
-   void *zsbuf_map;
+   uint8_t *zsbuf_map;
 
    struct {
       struct pipe_framebuffer_state fb;
@@ -128,6 +128,31 @@ void lp_rast_shade_quads( struct lp_rasterizer *rast,
                           int32_t c1, int32_t c2, int32_t c3);
 
 
+/**
+ * Get the pointer to the depth buffer for a block.
+ * \param x, y location of 4x4 block in window coords
+ */
+static INLINE void *
+lp_rast_depth_pointer( struct lp_rasterizer *rast,
+                       unsigned x, unsigned y )
+{
+   void * depth;
+   assert((x % TILE_VECTOR_WIDTH) == 0);
+   assert((y % TILE_VECTOR_HEIGHT) == 0);
+   if(!rast->zsbuf_map)
+      return NULL;
+   assert(rast->zsbuf_transfer);
+   depth = rast->zsbuf_map +
+           y*rast->zsbuf_transfer->stride +
+           TILE_VECTOR_HEIGHT*x*util_format_get_blocksize(rast->zsbuf_transfer->texture->format);
+#ifdef DEBUG
+   assert(lp_check_alignment(depth, 16));
+#endif
+   return depth;
+}
+
+
+
 /**
  * Shade all pixels in a 4x4 block.  The fragment code omits the
  * triangle in/out tests.
@@ -153,8 +178,7 @@ lp_rast_shade_quads_all( struct lp_rasterizer *rast,
    for (i = 0; i < rast->state.fb.nr_cbufs; i++)
       color[i] = tile->color[i] + 4 * block_offset;
 
-   /* depth buffer */
-   depth = tile->depth + block_offset;
+   depth = lp_rast_depth_pointer(rast, x, y);
 
    /* run shader */
    state->jit_function[0]( &state->jit_context,
index 3186069899d3fe2961fadd65bb6b11377314b0b1..538492bebaccf3b5beafc03cb31b6d37d30801b1 100644 (file)
@@ -45,6 +45,8 @@
 #include "lp_fence.h"
 #include "lp_rast.h"
 #include "lp_setup_context.h"
+#include "lp_screen.h"
+#include "lp_winsys.h"
 
 #include "draw/draw_context.h"
 #include "draw/draw_vbuf.h"
@@ -172,10 +174,6 @@ begin_binning( struct setup_context *setup )
          lp_scene_bin_everywhere( scene, 
                                  lp_rast_clear_zstencil, 
                                  setup->clear.zstencil );
-      else
-         lp_scene_bin_everywhere( scene,
-                                 lp_rast_load_zstencil,
-                                 lp_rast_arg_null() );
    }
 
    LP_DBG(DEBUG_SETUP, "%s done\n", __FUNCTION__);
@@ -476,11 +474,20 @@ lp_setup_set_sampler_textures( struct setup_context *setup,
          jit_tex->width = tex->width0;
          jit_tex->height = tex->height0;
          jit_tex->stride = lp_tex->stride[0];
-         if(!lp_tex->dt)
+         if(!lp_tex->dt) {
             jit_tex->data = lp_tex->data;
-         else
-            /* FIXME: map the rendertarget */
-            assert(0);
+         }
+         else {
+            /*
+             * XXX: Where should this be unmapped?
+             */
+
+            struct llvmpipe_screen *screen = llvmpipe_screen(tex->screen);
+            struct llvmpipe_winsys *winsys = screen->winsys;
+            jit_tex->data = winsys->displaytarget_map(winsys, lp_tex->dt,
+                                                      PIPE_BUFFER_USAGE_CPU_READ);
+            assert(jit_tex->data);
+         }
 
          /* the scene references this texture */
          {
index 9e59a6602cc698a87e92d7f011a0c5fbaa1c0a43..a8bf540803b8f5ba07057825f8f435a764d54234 100644 (file)
@@ -442,8 +442,11 @@ do_triangle_ccw(struct setup_context *setup,
    maxx = maxx / TILE_SIZE;
    maxy = maxy / TILE_SIZE;
 
-   /* Clamp maxx, maxy to framebuffer size
+   /*
+    * Clamp to framebuffer size
     */
+   minx = MAX2(minx, 0);
+   miny = MAX2(miny, 0);
    maxx = MIN2(maxx, scene->tiles_x - 1);
    maxy = MIN2(maxy, scene->tiles_y - 1);
 
index 156cb2d229b8cacddd3748e55d0d988695e3fcad..81bc296ab441d259bb57d38904db0704d1ce48a5 100644 (file)
@@ -55,7 +55,7 @@ nouveau_screen_bo_new(struct pipe_screen *pscreen, unsigned alignment,
 {
        struct nouveau_device *dev = nouveau_screen(pscreen)->device;
        struct nouveau_bo *bo = NULL;
-       uint32_t flags = NOUVEAU_BO_MAP;
+       uint32_t flags = NOUVEAU_BO_MAP, tile_mode = 0, tile_flags = 0;
        int ret;
 
        if (usage & NOUVEAU_BUFFER_USAGE_TRANSFER)
@@ -77,13 +77,15 @@ nouveau_screen_bo_new(struct pipe_screen *pscreen, unsigned alignment,
                        flags |= NOUVEAU_BO_VRAM;
 
                if (dev->chipset == 0x50 || dev->chipset >= 0x80) {
-                       flags |= NOUVEAU_BO_TILED;
                        if (usage & NOUVEAU_BUFFER_USAGE_ZETA)
-                               flags |= NOUVEAU_BO_ZTILE;
+                               tile_flags = 0x2800;
+                       else
+                               tile_flags = 0x7000;
                }
        }
 
-       ret = nouveau_bo_new(dev, flags, alignment, size, &bo);
+       ret = nouveau_bo_new_tile(dev, flags, alignment, size,
+                                 tile_mode, tile_flags, &bo);
        if (ret)
                return NULL;
 
diff --git a/src/gallium/drivers/nv10/nv10_state.c b/src/gallium/drivers/nv10/nv10_state.c
deleted file mode 100644 (file)
index 6f674d6..0000000
+++ /dev/null
@@ -1,590 +0,0 @@
-#include "draw/draw_context.h"
-#include "pipe/p_state.h"
-#include "pipe/p_defines.h"
-#include "pipe/p_shader_tokens.h"
-#include "pipe/p_inlines.h"
-
-#include "tgsi/tgsi_parse.h"
-
-#include "nv10_context.h"
-#include "nv10_state.h"
-
-static void *
-nv10_blend_state_create(struct pipe_context *pipe,
-                       const struct pipe_blend_state *cso)
-{
-       struct nv10_blend_state *cb;
-
-       cb = MALLOC(sizeof(struct nv10_blend_state));
-
-       cb->b_enable = cso->blend_enable ? 1 : 0;
-       cb->b_srcfunc = ((nvgl_blend_func(cso->alpha_src_factor)<<16) |
-                        (nvgl_blend_func(cso->rgb_src_factor)));
-       cb->b_dstfunc = ((nvgl_blend_func(cso->alpha_dst_factor)<<16) |
-                        (nvgl_blend_func(cso->rgb_dst_factor)));
-
-       cb->c_mask = (((cso->colormask & PIPE_MASK_A) ? (0x01<<24) : 0) |
-                     ((cso->colormask & PIPE_MASK_R) ? (0x01<<16) : 0) |
-                     ((cso->colormask & PIPE_MASK_G) ? (0x01<< 8) : 0) |
-                     ((cso->colormask & PIPE_MASK_B) ? (0x01<< 0) : 0));
-
-       cb->d_enable = cso->dither ? 1 : 0;
-
-       return (void *)cb;
-}
-
-static void
-nv10_blend_state_bind(struct pipe_context *pipe, void *blend)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       nv10->blend = (struct nv10_blend_state*)blend;
-
-       nv10->dirty |= NV10_NEW_BLEND;
-}
-
-static void
-nv10_blend_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-
-static INLINE unsigned
-wrap_mode(unsigned wrap) {
-       unsigned ret;
-
-       switch (wrap) {
-       case PIPE_TEX_WRAP_REPEAT:
-               ret = NV10TCL_TX_FORMAT_WRAP_S_REPEAT;
-               break;
-       case PIPE_TEX_WRAP_MIRROR_REPEAT:
-               ret = NV10TCL_TX_FORMAT_WRAP_S_MIRRORED_REPEAT;
-               break;
-       case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
-               ret = NV10TCL_TX_FORMAT_WRAP_S_CLAMP_TO_EDGE;
-               break;
-       case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
-               ret = NV10TCL_TX_FORMAT_WRAP_S_CLAMP_TO_BORDER;
-               break;
-       case PIPE_TEX_WRAP_CLAMP:
-               ret = NV10TCL_TX_FORMAT_WRAP_S_CLAMP;
-               break;
-       case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
-       case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
-       case PIPE_TEX_WRAP_MIRROR_CLAMP:
-       default:
-               NOUVEAU_ERR("unknown wrap mode: %d\n", wrap);
-               ret = NV10TCL_TX_FORMAT_WRAP_S_REPEAT;
-               break;
-       }
-
-       return ret >> NV10TCL_TX_FORMAT_WRAP_S_SHIFT;
-}
-
-static void *
-nv10_sampler_state_create(struct pipe_context *pipe,
-                         const struct pipe_sampler_state *cso)
-{
-       struct nv10_sampler_state *ps;
-       uint32_t filter = 0;
-
-       ps = MALLOC(sizeof(struct nv10_sampler_state));
-
-       ps->wrap = ((wrap_mode(cso->wrap_s) << NV10TCL_TX_FORMAT_WRAP_S_SHIFT) |
-                   (wrap_mode(cso->wrap_t) << NV10TCL_TX_FORMAT_WRAP_T_SHIFT));
-
-       ps->en = 0;
-       if (cso->max_anisotropy > 1.0) {
-               /* no idea, binary driver sets it, works without it.. meh.. */
-               ps->wrap |= (1 << 5);
-
-/*             if (cso->max_anisotropy >= 16.0) {
-                       ps->en |= NV10TCL_TX_ENABLE_ANISO_16X;
-               } else
-               if (cso->max_anisotropy >= 12.0) {
-                       ps->en |= NV10TCL_TX_ENABLE_ANISO_12X;
-               } else
-               if (cso->max_anisotropy >= 10.0) {
-                       ps->en |= NV10TCL_TX_ENABLE_ANISO_10X;
-               } else
-               if (cso->max_anisotropy >= 8.0) {
-                       ps->en |= NV10TCL_TX_ENABLE_ANISO_8X;
-               } else
-               if (cso->max_anisotropy >= 6.0) {
-                       ps->en |= NV10TCL_TX_ENABLE_ANISO_6X;
-               } else
-               if (cso->max_anisotropy >= 4.0) {
-                       ps->en |= NV10TCL_TX_ENABLE_ANISO_4X;
-               } else {
-                       ps->en |= NV10TCL_TX_ENABLE_ANISO_2X;
-               }*/
-       }
-
-       switch (cso->mag_img_filter) {
-       case PIPE_TEX_FILTER_LINEAR:
-               filter |= NV10TCL_TX_FILTER_MAGNIFY_LINEAR;
-               break;
-       case PIPE_TEX_FILTER_NEAREST:
-       default:
-               filter |= NV10TCL_TX_FILTER_MAGNIFY_NEAREST;
-               break;
-       }
-
-       switch (cso->min_img_filter) {
-       case PIPE_TEX_FILTER_LINEAR:
-               switch (cso->min_mip_filter) {
-               case PIPE_TEX_MIPFILTER_NEAREST:
-                       filter |= NV10TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST;
-                       break;
-               case PIPE_TEX_MIPFILTER_LINEAR:
-                       filter |= NV10TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR;
-                       break;
-               case PIPE_TEX_MIPFILTER_NONE:
-               default:
-                       filter |= NV10TCL_TX_FILTER_MINIFY_LINEAR;
-                       break;
-               }
-               break;
-       case PIPE_TEX_FILTER_NEAREST:
-       default:
-               switch (cso->min_mip_filter) {
-               case PIPE_TEX_MIPFILTER_NEAREST:
-                       filter |= NV10TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST;
-               break;
-               case PIPE_TEX_MIPFILTER_LINEAR:
-                       filter |= NV10TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR;
-                       break;
-               case PIPE_TEX_MIPFILTER_NONE:
-               default:
-                       filter |= NV10TCL_TX_FILTER_MINIFY_NEAREST;
-                       break;
-               }
-               break;
-       }
-
-       ps->filt = filter;
-
-/*     if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
-               switch (cso->compare_func) {
-               case PIPE_FUNC_NEVER:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_NEVER;
-                       break;
-               case PIPE_FUNC_GREATER:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_GREATER;
-                       break;
-               case PIPE_FUNC_EQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_EQUAL;
-                       break;
-               case PIPE_FUNC_GEQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_GEQUAL;
-                       break;
-               case PIPE_FUNC_LESS:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_LESS;
-                       break;
-               case PIPE_FUNC_NOTEQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_NOTEQUAL;
-                       break;
-               case PIPE_FUNC_LEQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_LEQUAL;
-                       break;
-               case PIPE_FUNC_ALWAYS:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_ALWAYS;
-                       break;
-               default:
-                       break;
-               }
-       }*/
-
-       ps->bcol = ((float_to_ubyte(cso->border_color[3]) << 24) |
-                   (float_to_ubyte(cso->border_color[0]) << 16) |
-                   (float_to_ubyte(cso->border_color[1]) <<  8) |
-                   (float_to_ubyte(cso->border_color[2]) <<  0));
-
-       return (void *)ps;
-}
-
-static void
-nv10_sampler_state_bind(struct pipe_context *pipe, unsigned nr, void **sampler)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-       unsigned unit;
-
-       for (unit = 0; unit < nr; unit++) {
-               nv10->tex_sampler[unit] = sampler[unit];
-               nv10->dirty_samplers |= (1 << unit);
-       }
-}
-
-static void
-nv10_sampler_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-static void
-nv10_set_sampler_texture(struct pipe_context *pipe, unsigned nr,
-                        struct pipe_texture **miptree)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-       unsigned unit;
-
-       for (unit = 0; unit < nr; unit++) {
-               nv10->tex_miptree[unit] = (struct nv10_miptree *)miptree[unit];
-               nv10->dirty_samplers |= (1 << unit);
-       }
-}
-
-static void *
-nv10_rasterizer_state_create(struct pipe_context *pipe,
-                            const struct pipe_rasterizer_state *cso)
-{
-       struct nv10_rasterizer_state *rs;
-       int i;
-
-       /*XXX: ignored:
-        *      light_twoside
-        *      offset_cw/ccw -nohw
-        *      scissor
-        *      point_smooth -nohw
-        *      multisample
-        *      offset_units / offset_scale
-        */
-       rs = MALLOC(sizeof(struct nv10_rasterizer_state));
-
-       rs->templ = cso;
-       
-       rs->shade_model = cso->flatshade ? 0x1d00 : 0x1d01;
-
-       rs->line_width = (unsigned char)(cso->line_width * 8.0) & 0xff;
-       rs->line_smooth_en = cso->line_smooth ? 1 : 0;
-
-       rs->point_size = *(uint32_t*)&cso->point_size;
-
-       rs->poly_smooth_en = cso->poly_smooth ? 1 : 0;
-
-       if (cso->front_winding == PIPE_WINDING_CCW) {
-               rs->front_face = NV10TCL_FRONT_FACE_CCW;
-               rs->poly_mode_front = nvgl_polygon_mode(cso->fill_ccw);
-               rs->poly_mode_back  = nvgl_polygon_mode(cso->fill_cw);
-       } else {
-               rs->front_face = NV10TCL_FRONT_FACE_CW;
-               rs->poly_mode_front = nvgl_polygon_mode(cso->fill_cw);
-               rs->poly_mode_back  = nvgl_polygon_mode(cso->fill_ccw);
-       }
-
-       switch (cso->cull_mode) {
-       case PIPE_WINDING_CCW:
-               rs->cull_face_en = 1;
-               if (cso->front_winding == PIPE_WINDING_CCW)
-                       rs->cull_face    = NV10TCL_CULL_FACE_FRONT;
-               else
-                       rs->cull_face    = NV10TCL_CULL_FACE_BACK;
-               break;
-       case PIPE_WINDING_CW:
-               rs->cull_face_en = 1;
-               if (cso->front_winding == PIPE_WINDING_CW)
-                       rs->cull_face    = NV10TCL_CULL_FACE_FRONT;
-               else
-                       rs->cull_face    = NV10TCL_CULL_FACE_BACK;
-               break;
-       case PIPE_WINDING_BOTH:
-               rs->cull_face_en = 1;
-               rs->cull_face    = NV10TCL_CULL_FACE_FRONT_AND_BACK;
-               break;
-       case PIPE_WINDING_NONE:
-       default:
-               rs->cull_face_en = 0;
-               rs->cull_face    = 0;
-               break;
-       }
-
-       if (cso->sprite_coord_enable) {
-               rs->point_sprite = (1 << 0);
-               for (i = 0; i < 8; i++) {
-                       if ((cso->sprite_coord_enable >> i) & 1)
-                               rs->point_sprite |= (1 << (8 + i));
-               }
-       } else {
-               rs->point_sprite = 0;
-       }
-
-       return (void *)rs;
-}
-
-static void
-nv10_rasterizer_state_bind(struct pipe_context *pipe, void *rast)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       nv10->rast = (struct nv10_rasterizer_state*)rast;
-
-       draw_set_rasterizer_state(nv10->draw, (nv10->rast ? nv10->rast->templ : NULL));
-
-       nv10->dirty |= NV10_NEW_RAST;
-}
-
-static void
-nv10_rasterizer_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-static void *
-nv10_depth_stencil_alpha_state_create(struct pipe_context *pipe,
-                       const struct pipe_depth_stencil_alpha_state *cso)
-{
-       struct nv10_depth_stencil_alpha_state *hw;
-
-       hw = MALLOC(sizeof(struct nv10_depth_stencil_alpha_state));
-
-       hw->depth.func          = nvgl_comparison_op(cso->depth.func);
-       hw->depth.write_enable  = cso->depth.writemask ? 1 : 0;
-       hw->depth.test_enable   = cso->depth.enabled ? 1 : 0;
-
-       hw->stencil.enable = cso->stencil[0].enabled ? 1 : 0;
-       hw->stencil.wmask = cso->stencil[0].writemask;
-       hw->stencil.func = nvgl_comparison_op(cso->stencil[0].func);
-       hw->stencil.ref = cso->stencil[0].ref_value;
-       hw->stencil.vmask = cso->stencil[0].valuemask;
-       hw->stencil.fail = nvgl_stencil_op(cso->stencil[0].fail_op);
-       hw->stencil.zfail = nvgl_stencil_op(cso->stencil[0].zfail_op);
-       hw->stencil.zpass = nvgl_stencil_op(cso->stencil[0].zpass_op);
-
-       hw->alpha.enabled = cso->alpha.enabled ? 1 : 0;
-       hw->alpha.func = nvgl_comparison_op(cso->alpha.func);
-       hw->alpha.ref  = float_to_ubyte(cso->alpha.ref_value);
-
-       return (void *)hw;
-}
-
-static void
-nv10_depth_stencil_alpha_state_bind(struct pipe_context *pipe, void *dsa)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       nv10->dsa = (struct nv10_depth_stencil_alpha_state*)dsa;
-
-       nv10->dirty |= NV10_NEW_DSA;
-}
-
-static void
-nv10_depth_stencil_alpha_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-static void *
-nv10_vp_state_create(struct pipe_context *pipe,
-                    const struct pipe_shader_state *templ)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       return draw_create_vertex_shader(nv10->draw, templ);
-}
-
-static void
-nv10_vp_state_bind(struct pipe_context *pipe, void *shader)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       draw_bind_vertex_shader(nv10->draw, (struct draw_vertex_shader *) shader);
-
-       nv10->dirty |= NV10_NEW_VERTPROG;
-}
-
-static void
-nv10_vp_state_delete(struct pipe_context *pipe, void *shader)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       draw_delete_vertex_shader(nv10->draw, (struct draw_vertex_shader *) shader);
-}
-
-static void *
-nv10_fp_state_create(struct pipe_context *pipe,
-                    const struct pipe_shader_state *cso)
-{
-       struct nv10_fragment_program *fp;
-
-       fp = CALLOC(1, sizeof(struct nv10_fragment_program));
-       fp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
-       
-       tgsi_scan_shader(cso->tokens, &fp->info);
-
-       return (void *)fp;
-}
-
-static void
-nv10_fp_state_bind(struct pipe_context *pipe, void *hwcso)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-       struct nv10_fragment_program *fp = hwcso;
-
-       nv10->fragprog.current = fp;
-       nv10->dirty |= NV10_NEW_FRAGPROG;
-}
-
-static void
-nv10_fp_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-       struct nv10_fragment_program *fp = hwcso;
-
-       nv10_fragprog_destroy(nv10, fp);
-       FREE((void*)fp->pipe.tokens);
-       FREE(fp);
-}
-
-static void
-nv10_set_blend_color(struct pipe_context *pipe,
-                    const struct pipe_blend_color *bcol)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       nv10->blend_color = (struct pipe_blend_color*)bcol;
-
-       nv10->dirty |= NV10_NEW_BLENDCOL;
-}
-
-static void
-nv10_set_clip_state(struct pipe_context *pipe,
-                   const struct pipe_clip_state *clip)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       draw_set_clip_state(nv10->draw, clip);
-}
-
-static void
-nv10_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
-                        const struct pipe_constant_buffer *buf )
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-       struct pipe_screen *pscreen = pipe->screen;
-
-       assert(shader < PIPE_SHADER_TYPES);
-       assert(index == 0);
-
-       if (buf) {
-               void *mapped;
-               if (buf->buffer && buf->buffer->size &&
-                    (mapped = pipe_buffer_map(pscreen, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
-               {
-                       memcpy(nv10->constbuf[shader], mapped, buf->buffer->size);
-                       nv10->constbuf_nr[shader] =
-                               buf->buffer->size / (4 * sizeof(float));
-                       pipe_buffer_unmap(pscreen, buf->buffer);
-               }
-       }
-}
-
-static void
-nv10_set_framebuffer_state(struct pipe_context *pipe,
-                          const struct pipe_framebuffer_state *fb)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       nv10->framebuffer = (struct pipe_framebuffer_state*)fb;
-
-       nv10->dirty |= NV10_NEW_FRAMEBUFFER;
-}
-
-static void
-nv10_set_polygon_stipple(struct pipe_context *pipe,
-                        const struct pipe_poly_stipple *stipple)
-{
-       NOUVEAU_ERR("line stipple hahaha\n");
-}
-
-static void
-nv10_set_scissor_state(struct pipe_context *pipe,
-                      const struct pipe_scissor_state *s)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       nv10->scissor = (struct pipe_scissor_state*)s;
-
-       nv10->dirty |= NV10_NEW_SCISSOR;
-}
-
-static void
-nv10_set_viewport_state(struct pipe_context *pipe,
-                       const struct pipe_viewport_state *vpt)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       nv10->viewport = (struct pipe_viewport_state*)vpt;
-
-       draw_set_viewport_state(nv10->draw, nv10->viewport);
-
-       nv10->dirty |= NV10_NEW_VIEWPORT;
-}
-
-static void
-nv10_set_vertex_buffers(struct pipe_context *pipe, unsigned count,
-                       const struct pipe_vertex_buffer *vb)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       memcpy(nv10->vtxbuf, vb, sizeof(*vb) * count);
-       nv10->dirty |= NV10_NEW_VTXARRAYS;
-
-       draw_set_vertex_buffers(nv10->draw, count, vb);
-}
-
-static void
-nv10_set_vertex_elements(struct pipe_context *pipe, unsigned count,
-                        const struct pipe_vertex_element *ve)
-{
-       struct nv10_context *nv10 = nv10_context(pipe);
-
-       memcpy(nv10->vtxelt, ve, sizeof(*ve) * count);
-       nv10->dirty |= NV10_NEW_VTXARRAYS;
-
-       draw_set_vertex_elements(nv10->draw, count, ve);
-}
-
-void
-nv10_init_state_functions(struct nv10_context *nv10)
-{
-       nv10->pipe.create_blend_state = nv10_blend_state_create;
-       nv10->pipe.bind_blend_state = nv10_blend_state_bind;
-       nv10->pipe.delete_blend_state = nv10_blend_state_delete;
-
-       nv10->pipe.create_sampler_state = nv10_sampler_state_create;
-       nv10->pipe.bind_fragment_sampler_states = nv10_sampler_state_bind;
-       nv10->pipe.delete_sampler_state = nv10_sampler_state_delete;
-       nv10->pipe.set_fragment_sampler_textures = nv10_set_sampler_texture;
-
-       nv10->pipe.create_rasterizer_state = nv10_rasterizer_state_create;
-       nv10->pipe.bind_rasterizer_state = nv10_rasterizer_state_bind;
-       nv10->pipe.delete_rasterizer_state = nv10_rasterizer_state_delete;
-
-       nv10->pipe.create_depth_stencil_alpha_state =
-               nv10_depth_stencil_alpha_state_create;
-       nv10->pipe.bind_depth_stencil_alpha_state =
-               nv10_depth_stencil_alpha_state_bind;
-       nv10->pipe.delete_depth_stencil_alpha_state =
-               nv10_depth_stencil_alpha_state_delete;
-
-       nv10->pipe.create_vs_state = nv10_vp_state_create;
-       nv10->pipe.bind_vs_state = nv10_vp_state_bind;
-       nv10->pipe.delete_vs_state = nv10_vp_state_delete;
-
-       nv10->pipe.create_fs_state = nv10_fp_state_create;
-       nv10->pipe.bind_fs_state = nv10_fp_state_bind;
-       nv10->pipe.delete_fs_state = nv10_fp_state_delete;
-
-       nv10->pipe.set_blend_color = nv10_set_blend_color;
-       nv10->pipe.set_clip_state = nv10_set_clip_state;
-       nv10->pipe.set_constant_buffer = nv10_set_constant_buffer;
-       nv10->pipe.set_framebuffer_state = nv10_set_framebuffer_state;
-       nv10->pipe.set_polygon_stipple = nv10_set_polygon_stipple;
-       nv10->pipe.set_scissor_state = nv10_set_scissor_state;
-       nv10->pipe.set_viewport_state = nv10_set_viewport_state;
-
-       nv10->pipe.set_vertex_buffers = nv10_set_vertex_buffers;
-       nv10->pipe.set_vertex_elements = nv10_set_vertex_elements;
-}
-
diff --git a/src/gallium/drivers/nv20/nv20_state.c b/src/gallium/drivers/nv20/nv20_state.c
deleted file mode 100644 (file)
index 3d9a276..0000000
+++ /dev/null
@@ -1,583 +0,0 @@
-#include "draw/draw_context.h"
-#include "pipe/p_state.h"
-#include "pipe/p_defines.h"
-#include "pipe/p_shader_tokens.h"
-#include "pipe/p_inlines.h"
-
-#include "tgsi/tgsi_parse.h"
-
-#include "nv20_context.h"
-#include "nv20_state.h"
-
-static void *
-nv20_blend_state_create(struct pipe_context *pipe,
-                       const struct pipe_blend_state *cso)
-{
-       struct nv20_blend_state *cb;
-
-       cb = MALLOC(sizeof(struct nv20_blend_state));
-
-       cb->b_enable = cso->blend_enable ? 1 : 0;
-       cb->b_srcfunc = ((nvgl_blend_func(cso->alpha_src_factor)<<16) |
-                        (nvgl_blend_func(cso->rgb_src_factor)));
-       cb->b_dstfunc = ((nvgl_blend_func(cso->alpha_dst_factor)<<16) |
-                        (nvgl_blend_func(cso->rgb_dst_factor)));
-
-       cb->c_mask = (((cso->colormask & PIPE_MASK_A) ? (0x01<<24) : 0) |
-                     ((cso->colormask & PIPE_MASK_R) ? (0x01<<16) : 0) |
-                     ((cso->colormask & PIPE_MASK_G) ? (0x01<< 8) : 0) |
-                     ((cso->colormask & PIPE_MASK_B) ? (0x01<< 0) : 0));
-
-       cb->d_enable = cso->dither ? 1 : 0;
-
-       return (void *)cb;
-}
-
-static void
-nv20_blend_state_bind(struct pipe_context *pipe, void *blend)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       nv20->blend = (struct nv20_blend_state*)blend;
-
-       nv20->dirty |= NV20_NEW_BLEND;
-}
-
-static void
-nv20_blend_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-
-static INLINE unsigned
-wrap_mode(unsigned wrap) {
-       unsigned ret;
-
-       switch (wrap) {
-       case PIPE_TEX_WRAP_REPEAT:
-               ret = NV20TCL_TX_WRAP_S_REPEAT;
-               break;
-       case PIPE_TEX_WRAP_MIRROR_REPEAT:
-               ret = NV20TCL_TX_WRAP_S_MIRRORED_REPEAT;
-               break;
-       case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
-               ret = NV20TCL_TX_WRAP_S_CLAMP_TO_EDGE;
-               break;
-       case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
-               ret = NV20TCL_TX_WRAP_S_CLAMP_TO_BORDER;
-               break;
-       case PIPE_TEX_WRAP_CLAMP:
-               ret = NV20TCL_TX_WRAP_S_CLAMP;
-               break;
-       case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
-       case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
-       case PIPE_TEX_WRAP_MIRROR_CLAMP:
-       default:
-               NOUVEAU_ERR("unknown wrap mode: %d\n", wrap);
-               ret = NV20TCL_TX_WRAP_S_REPEAT;
-               break;
-       }
-
-       return (ret >> NV20TCL_TX_WRAP_S_SHIFT);
-}
-
-static void *
-nv20_sampler_state_create(struct pipe_context *pipe,
-                         const struct pipe_sampler_state *cso)
-{
-       struct nv20_sampler_state *ps;
-       uint32_t filter = 0;
-
-       ps = MALLOC(sizeof(struct nv20_sampler_state));
-
-       ps->wrap = ((wrap_mode(cso->wrap_s) << NV20TCL_TX_WRAP_S_SHIFT) |
-                   (wrap_mode(cso->wrap_t) << NV20TCL_TX_WRAP_T_SHIFT));
-
-       ps->en = 0;
-       if (cso->max_anisotropy > 1.0) {
-               /* no idea, binary driver sets it, works without it.. meh.. */
-               ps->wrap |= (1 << 5);
-
-/*             if (cso->max_anisotropy >= 8.0) {
-                       ps->en |= NV20TCL_TX_ENABLE_ANISO_8X;
-               } else
-               if (cso->max_anisotropy >= 4.0) {
-                       ps->en |= NV20TCL_TX_ENABLE_ANISO_4X;
-               } else {
-                       ps->en |= NV20TCL_TX_ENABLE_ANISO_2X;
-               }*/
-       }
-
-       switch (cso->mag_img_filter) {
-       case PIPE_TEX_FILTER_LINEAR:
-               filter |= NV20TCL_TX_FILTER_MAGNIFY_LINEAR;
-               break;
-       case PIPE_TEX_FILTER_NEAREST:
-       default:
-               filter |= NV20TCL_TX_FILTER_MAGNIFY_NEAREST;
-               break;
-       }
-
-       switch (cso->min_img_filter) {
-       case PIPE_TEX_FILTER_LINEAR:
-               switch (cso->min_mip_filter) {
-               case PIPE_TEX_MIPFILTER_NEAREST:
-                       filter |=
-                               NV20TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST;
-                       break;
-               case PIPE_TEX_MIPFILTER_LINEAR:
-                       filter |= NV20TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR;
-                       break;
-               case PIPE_TEX_MIPFILTER_NONE:
-               default:
-                       filter |= NV20TCL_TX_FILTER_MINIFY_LINEAR;
-                       break;
-               }
-               break;
-       case PIPE_TEX_FILTER_NEAREST:
-       default:
-               switch (cso->min_mip_filter) {
-               case PIPE_TEX_MIPFILTER_NEAREST:
-                       filter |=
-                               NV20TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST;
-               break;
-               case PIPE_TEX_MIPFILTER_LINEAR:
-                       filter |=
-                               NV20TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR;
-                       break;
-               case PIPE_TEX_MIPFILTER_NONE:
-               default:
-                       filter |= NV20TCL_TX_FILTER_MINIFY_NEAREST;
-                       break;
-               }
-               break;
-       }
-
-       ps->filt = filter;
-
-/*     if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
-               switch (cso->compare_func) {
-               case PIPE_FUNC_NEVER:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_NEVER;
-                       break;
-               case PIPE_FUNC_GREATER:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_GREATER;
-                       break;
-               case PIPE_FUNC_EQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_EQUAL;
-                       break;
-               case PIPE_FUNC_GEQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_GEQUAL;
-                       break;
-               case PIPE_FUNC_LESS:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_LESS;
-                       break;
-               case PIPE_FUNC_NOTEQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_NOTEQUAL;
-                       break;
-               case PIPE_FUNC_LEQUAL:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_LEQUAL;
-                       break;
-               case PIPE_FUNC_ALWAYS:
-                       ps->wrap |= NV10TCL_TX_WRAP_RCOMP_ALWAYS;
-                       break;
-               default:
-                       break;
-               }
-       }*/
-
-       ps->bcol = ((float_to_ubyte(cso->border_color[3]) << 24) |
-                   (float_to_ubyte(cso->border_color[0]) << 16) |
-                   (float_to_ubyte(cso->border_color[1]) <<  8) |
-                   (float_to_ubyte(cso->border_color[2]) <<  0));
-
-       return (void *)ps;
-}
-
-static void
-nv20_sampler_state_bind(struct pipe_context *pipe, unsigned nr, void **sampler)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-       unsigned unit;
-
-       for (unit = 0; unit < nr; unit++) {
-               nv20->tex_sampler[unit] = sampler[unit];
-               nv20->dirty_samplers |= (1 << unit);
-       }
-}
-
-static void
-nv20_sampler_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-static void
-nv20_set_sampler_texture(struct pipe_context *pipe, unsigned nr,
-                        struct pipe_texture **miptree)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-       unsigned unit;
-
-       for (unit = 0; unit < nr; unit++) {
-               nv20->tex_miptree[unit] = (struct nv20_miptree *)miptree[unit];
-               nv20->dirty_samplers |= (1 << unit);
-       }
-}
-
-static void *
-nv20_rasterizer_state_create(struct pipe_context *pipe,
-                            const struct pipe_rasterizer_state *cso)
-{
-       struct nv20_rasterizer_state *rs;
-       int i;
-
-       /*XXX: ignored:
-        *      light_twoside
-        *      offset_cw/ccw -nohw
-        *      scissor
-        *      point_smooth -nohw
-        *      multisample
-        *      offset_units / offset_scale
-        */
-       rs = MALLOC(sizeof(struct nv20_rasterizer_state));
-
-       rs->templ = cso;
-       
-       rs->shade_model = cso->flatshade ? NV20TCL_SHADE_MODEL_FLAT :
-                                               NV20TCL_SHADE_MODEL_SMOOTH;
-
-       rs->line_width = (unsigned char)(cso->line_width * 8.0) & 0xff;
-       rs->line_smooth_en = cso->line_smooth ? 1 : 0;
-
-       /* XXX: nv20 and nv25 different! */
-       rs->point_size = *(uint32_t*)&cso->point_size;
-
-       rs->poly_smooth_en = cso->poly_smooth ? 1 : 0;
-
-       if (cso->front_winding == PIPE_WINDING_CCW) {
-               rs->front_face = NV20TCL_FRONT_FACE_CCW;
-               rs->poly_mode_front = nvgl_polygon_mode(cso->fill_ccw);
-               rs->poly_mode_back  = nvgl_polygon_mode(cso->fill_cw);
-       } else {
-               rs->front_face = NV20TCL_FRONT_FACE_CW;
-               rs->poly_mode_front = nvgl_polygon_mode(cso->fill_cw);
-               rs->poly_mode_back  = nvgl_polygon_mode(cso->fill_ccw);
-       }
-
-       switch (cso->cull_mode) {
-       case PIPE_WINDING_CCW:
-               rs->cull_face_en = 1;
-               if (cso->front_winding == PIPE_WINDING_CCW)
-                       rs->cull_face    = NV20TCL_CULL_FACE_FRONT;
-               else
-                       rs->cull_face    = NV20TCL_CULL_FACE_BACK;
-               break;
-       case PIPE_WINDING_CW:
-               rs->cull_face_en = 1;
-               if (cso->front_winding == PIPE_WINDING_CW)
-                       rs->cull_face    = NV20TCL_CULL_FACE_FRONT;
-               else
-                       rs->cull_face    = NV20TCL_CULL_FACE_BACK;
-               break;
-       case PIPE_WINDING_BOTH:
-               rs->cull_face_en = 1;
-               rs->cull_face    = NV20TCL_CULL_FACE_FRONT_AND_BACK;
-               break;
-       case PIPE_WINDING_NONE:
-       default:
-               rs->cull_face_en = 0;
-               rs->cull_face    = 0;
-               break;
-       }
-
-       if (cso->sprite_coord_enable) {
-               rs->point_sprite = (1 << 0);
-               for (i = 0; i < 8; i++) {
-                       if ((cso->sprite_coord_enable >> i) & 1)
-                               rs->point_sprite |= (1 << (8 + i));
-               }
-       } else {
-               rs->point_sprite = 0;
-       }
-
-       return (void *)rs;
-}
-
-static void
-nv20_rasterizer_state_bind(struct pipe_context *pipe, void *rast)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       nv20->rast = (struct nv20_rasterizer_state*)rast;
-
-       draw_set_rasterizer_state(nv20->draw, (nv20->rast ? nv20->rast->templ : NULL));
-
-       nv20->dirty |= NV20_NEW_RAST;
-}
-
-static void
-nv20_rasterizer_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-static void *
-nv20_depth_stencil_alpha_state_create(struct pipe_context *pipe,
-                       const struct pipe_depth_stencil_alpha_state *cso)
-{
-       struct nv20_depth_stencil_alpha_state *hw;
-
-       hw = MALLOC(sizeof(struct nv20_depth_stencil_alpha_state));
-
-       hw->depth.func          = nvgl_comparison_op(cso->depth.func);
-       hw->depth.write_enable  = cso->depth.writemask ? 1 : 0;
-       hw->depth.test_enable   = cso->depth.enabled ? 1 : 0;
-
-       hw->stencil.enable = cso->stencil[0].enabled ? 1 : 0;
-       hw->stencil.wmask = cso->stencil[0].writemask;
-       hw->stencil.func = nvgl_comparison_op(cso->stencil[0].func);
-       hw->stencil.ref = cso->stencil[0].ref_value;
-       hw->stencil.vmask = cso->stencil[0].valuemask;
-       hw->stencil.fail = nvgl_stencil_op(cso->stencil[0].fail_op);
-       hw->stencil.zfail = nvgl_stencil_op(cso->stencil[0].zfail_op);
-       hw->stencil.zpass = nvgl_stencil_op(cso->stencil[0].zpass_op);
-
-       hw->alpha.enabled = cso->alpha.enabled ? 1 : 0;
-       hw->alpha.func = nvgl_comparison_op(cso->alpha.func);
-       hw->alpha.ref  = float_to_ubyte(cso->alpha.ref_value);
-
-       return (void *)hw;
-}
-
-static void
-nv20_depth_stencil_alpha_state_bind(struct pipe_context *pipe, void *dsa)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       nv20->dsa = (struct nv20_depth_stencil_alpha_state*)dsa;
-
-       nv20->dirty |= NV20_NEW_DSA;
-}
-
-static void
-nv20_depth_stencil_alpha_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       FREE(hwcso);
-}
-
-static void *
-nv20_vp_state_create(struct pipe_context *pipe,
-                    const struct pipe_shader_state *templ)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       return draw_create_vertex_shader(nv20->draw, templ);
-}
-
-static void
-nv20_vp_state_bind(struct pipe_context *pipe, void *shader)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       draw_bind_vertex_shader(nv20->draw, (struct draw_vertex_shader *) shader);
-
-       nv20->dirty |= NV20_NEW_VERTPROG;
-}
-
-static void
-nv20_vp_state_delete(struct pipe_context *pipe, void *shader)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       draw_delete_vertex_shader(nv20->draw, (struct draw_vertex_shader *) shader);
-}
-
-static void *
-nv20_fp_state_create(struct pipe_context *pipe,
-                    const struct pipe_shader_state *cso)
-{
-       struct nv20_fragment_program *fp;
-
-       fp = CALLOC(1, sizeof(struct nv20_fragment_program));
-       fp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
-       
-       tgsi_scan_shader(cso->tokens, &fp->info);
-
-       return (void *)fp;
-}
-
-static void
-nv20_fp_state_bind(struct pipe_context *pipe, void *hwcso)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-       struct nv20_fragment_program *fp = hwcso;
-
-       nv20->fragprog.current = fp;
-       nv20->dirty |= NV20_NEW_FRAGPROG;
-}
-
-static void
-nv20_fp_state_delete(struct pipe_context *pipe, void *hwcso)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-       struct nv20_fragment_program *fp = hwcso;
-
-       nv20_fragprog_destroy(nv20, fp);
-       FREE((void*)fp->pipe.tokens);
-       FREE(fp);
-}
-
-static void
-nv20_set_blend_color(struct pipe_context *pipe,
-                    const struct pipe_blend_color *bcol)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       nv20->blend_color = (struct pipe_blend_color*)bcol;
-
-       nv20->dirty |= NV20_NEW_BLENDCOL;
-}
-
-static void
-nv20_set_clip_state(struct pipe_context *pipe,
-                   const struct pipe_clip_state *clip)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       draw_set_clip_state(nv20->draw, clip);
-}
-
-static void
-nv20_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
-                        const struct pipe_constant_buffer *buf )
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-       struct pipe_screen *pscreen = pipe->screen;
-
-       assert(shader < PIPE_SHADER_TYPES);
-       assert(index == 0);
-
-       if (buf) {
-               void *mapped;
-               if (buf->buffer && buf->buffer->size &&
-                    (mapped = pipe_buffer_map(pscreen, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
-               {
-                       memcpy(nv20->constbuf[shader], mapped, buf->buffer->size);
-                       nv20->constbuf_nr[shader] =
-                               buf->buffer->size / (4 * sizeof(float));
-                       pipe_buffer_unmap(pscreen, buf->buffer);
-               }
-       }
-}
-
-static void
-nv20_set_framebuffer_state(struct pipe_context *pipe,
-                          const struct pipe_framebuffer_state *fb)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       nv20->framebuffer = (struct pipe_framebuffer_state*)fb;
-
-       nv20->dirty |= NV20_NEW_FRAMEBUFFER;
-}
-
-static void
-nv20_set_polygon_stipple(struct pipe_context *pipe,
-                        const struct pipe_poly_stipple *stipple)
-{
-       NOUVEAU_ERR("line stipple hahaha\n");
-}
-
-static void
-nv20_set_scissor_state(struct pipe_context *pipe,
-                      const struct pipe_scissor_state *s)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       nv20->scissor = (struct pipe_scissor_state*)s;
-
-       nv20->dirty |= NV20_NEW_SCISSOR;
-}
-
-static void
-nv20_set_viewport_state(struct pipe_context *pipe,
-                       const struct pipe_viewport_state *vpt)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       nv20->viewport = (struct pipe_viewport_state*)vpt;
-
-       draw_set_viewport_state(nv20->draw, nv20->viewport);
-
-       nv20->dirty |= NV20_NEW_VIEWPORT;
-}
-
-static void
-nv20_set_vertex_buffers(struct pipe_context *pipe, unsigned count,
-                       const struct pipe_vertex_buffer *vb)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       memcpy(nv20->vtxbuf, vb, sizeof(*vb) * count);
-       nv20->dirty |= NV20_NEW_VTXARRAYS;
-
-       draw_set_vertex_buffers(nv20->draw, count, vb);
-}
-
-static void
-nv20_set_vertex_elements(struct pipe_context *pipe, unsigned count,
-                        const struct pipe_vertex_element *ve)
-{
-       struct nv20_context *nv20 = nv20_context(pipe);
-
-       memcpy(nv20->vtxelt, ve, sizeof(*ve) * count);
-       nv20->dirty |= NV20_NEW_VTXARRAYS;
-
-       draw_set_vertex_elements(nv20->draw, count, ve);
-}
-
-void
-nv20_init_state_functions(struct nv20_context *nv20)
-{
-       nv20->pipe.create_blend_state = nv20_blend_state_create;
-       nv20->pipe.bind_blend_state = nv20_blend_state_bind;
-       nv20->pipe.delete_blend_state = nv20_blend_state_delete;
-
-       nv20->pipe.create_sampler_state = nv20_sampler_state_create;
-       nv20->pipe.bind_fragment_sampler_states = nv20_sampler_state_bind;
-       nv20->pipe.delete_sampler_state = nv20_sampler_state_delete;
-       nv20->pipe.set_fragment_sampler_textures = nv20_set_sampler_texture;
-
-       nv20->pipe.create_rasterizer_state = nv20_rasterizer_state_create;
-       nv20->pipe.bind_rasterizer_state = nv20_rasterizer_state_bind;
-       nv20->pipe.delete_rasterizer_state = nv20_rasterizer_state_delete;
-
-       nv20->pipe.create_depth_stencil_alpha_state =
-               nv20_depth_stencil_alpha_state_create;
-       nv20->pipe.bind_depth_stencil_alpha_state =
-               nv20_depth_stencil_alpha_state_bind;
-       nv20->pipe.delete_depth_stencil_alpha_state =
-               nv20_depth_stencil_alpha_state_delete;
-
-       nv20->pipe.create_vs_state = nv20_vp_state_create;
-       nv20->pipe.bind_vs_state = nv20_vp_state_bind;
-       nv20->pipe.delete_vs_state = nv20_vp_state_delete;
-
-       nv20->pipe.create_fs_state = nv20_fp_state_create;
-       nv20->pipe.bind_fs_state = nv20_fp_state_bind;
-       nv20->pipe.delete_fs_state = nv20_fp_state_delete;
-
-       nv20->pipe.set_blend_color = nv20_set_blend_color;
-       nv20->pipe.set_clip_state = nv20_set_clip_state;
-       nv20->pipe.set_constant_buffer = nv20_set_constant_buffer;
-       nv20->pipe.set_framebuffer_state = nv20_set_framebuffer_state;
-       nv20->pipe.set_polygon_stipple = nv20_set_polygon_stipple;
-       nv20->pipe.set_scissor_state = nv20_set_scissor_state;
-       nv20->pipe.set_viewport_state = nv20_set_viewport_state;
-
-       nv20->pipe.set_vertex_buffers = nv20_set_vertex_buffers;
-       nv20->pipe.set_vertex_elements = nv20_set_vertex_elements;
-}
-
index 8bfd7b2c9095bf9c8dfcee533c164007da9ecdb3..279b74445cab824bfa2aa4d26bc6c5bb7c0e90cc 100644 (file)
@@ -1,6 +1,5 @@
 #include "draw/draw_context.h"
 #include "pipe/p_defines.h"
-#include "util/u_simple_screen.h"
 
 #include "nv30_context.h"
 #include "nv30_screen.h"
index 8f9b26ea56fef4ebca5338a345e593a249d1efc6..aef37d303d8a44c5cc0f04e76944e0d178aa7370 100644 (file)
@@ -28,7 +28,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, int param)
 {
        switch (param) {
        case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
-               return 16;
+               return 8;
        case PIPE_CAP_NPOT_TEXTURES:
                return 0;
        case PIPE_CAP_TWO_SIDED_STENCIL:
@@ -64,6 +64,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, int param)
        case NOUVEAU_CAP_HW_VTXBUF:
        case NOUVEAU_CAP_HW_IDXBUF:
                return 1;
+       case PIPE_CAP_MAX_COMBINED_SAMPLERS:
+               return 16;
        case PIPE_CAP_INDEP_BLEND_ENABLE:
                return 0;
        case PIPE_CAP_INDEP_BLEND_FUNC:
index b48c5ab51a0a8257119e4dbdd0114370fbe0023e..bc18e577eee31c86a1c3e6cb54a21b11c76d376b 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "nv30_context.h"
 #include "pipe/p_defines.h"
-#include "util/u_simple_screen.h"
 #include "util/u_inlines.h"
 #include "util/u_tile.h"
 
index a83ddf11546dabf0554bfecb3ce50beae07116d6..f406fa0c1d616aaa81d4d60d098bbb898768456c 100644 (file)
@@ -185,7 +185,7 @@ nv30_draw_arrays(struct pipe_context *pipe,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
@@ -239,7 +239,7 @@ nv30_draw_elements_u08(struct nv30_context *nv30, void *ib,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -290,7 +290,7 @@ nv30_draw_elements_u16(struct nv30_context *nv30, void *ib,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -341,7 +341,7 @@ nv30_draw_elements_u32(struct nv30_context *nv30, void *ib,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 5, 1,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 5, 1,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -417,7 +417,7 @@ nv30_draw_elements_vbo(struct pipe_context *pipe,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
index b0b90032de1be0be3428b20b5ca7613ab5c71fef..65dc73e88b32c8fa47cb27495588cc69d172762c 100644 (file)
@@ -1,6 +1,5 @@
 #include "draw/draw_context.h"
 #include "pipe/p_defines.h"
-#include "util/u_simple_screen.h"
 
 #include "nv40_context.h"
 #include "nv40_screen.h"
index 60ab49fad1ceab569b71dbce48b3461e28dd7a1c..48bd84d16c5fbd416e7b4e4a5abe0d4ec75785b7 100644 (file)
@@ -88,12 +88,11 @@ nv40_render_prim(struct draw_stage *stage, struct prim_header *prim,
 
        struct nv40_screen *screen = nv40->screen;
        struct nouveau_channel *chan = screen->base.channel;
-       struct nouveau_pushbuf *pb = chan->pushbuf;
        struct nouveau_grobj *curie = screen->curie;
        unsigned i;
 
        /* Ensure there's room for 4xfloat32 + potentially 3 begin/end */
-       if (pb->remaining < ((count * 20) + 6)) {
+       if (AVAIL_RING(chan) < ((count * 20) + 6)) {
                if (rs->prim != NV40TCL_BEGIN_END_STOP) {
                        NOUVEAU_ERR("AIII, missed flush\n");
                        assert(0);
@@ -121,7 +120,7 @@ nv40_render_prim(struct draw_stage *stage, struct prim_header *prim,
        /* If it's likely we'll need to empty the push buffer soon, finish
         * off the primitive now.
         */
-       if (pb->remaining < ((count * 20) + 6)) {
+       if (AVAIL_RING(chan) < ((count * 20) + 6)) {
                BEGIN_RING(chan, curie, NV40TCL_BEGIN_END, 1);
                OUT_RING  (chan, NV40TCL_BEGIN_END_STOP);
                rs->prim = NV40TCL_BEGIN_END_STOP;
index 1e14edc56a7f96dcbd1a61032f7e2644b44c89c2..f2048eb8693b576f6bd1f756510395ac9f2da18d 100644 (file)
@@ -186,7 +186,7 @@ nv40_draw_arrays(struct pipe_context *pipe,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
@@ -240,7 +240,7 @@ nv40_draw_elements_u08(struct nv40_context *nv40, void *ib,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -291,7 +291,7 @@ nv40_draw_elements_u16(struct nv40_context *nv40, void *ib,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -342,7 +342,7 @@ nv40_draw_elements_u32(struct nv40_context *nv40, void *ib,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 5, 1,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 5, 1,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -418,7 +418,7 @@ nv40_draw_elements_vbo(struct pipe_context *pipe,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
index 867bd03e69d134ee24c41eb77e09dd810643e23d..7be12fcdef466a27681a66cda1141522f47299bf 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "draw/draw_context.h"
 #include "pipe/p_defines.h"
-#include "util/u_simple_screen.h"
 
 #include "nv50_context.h"
 #include "nv50_screen.h"
index ac0c1d02703f419395b9b59c4a4cc90481cac335..7405b67414a97905bf811ec4659a4e3679482118 100644 (file)
@@ -25,7 +25,6 @@
 #include "nouveau/nouveau_pushbuf.h"
 #include "nv50_context.h"
 #include "pipe/p_defines.h"
-#include "util/u_simple_screen.h"
 #include "util/u_inlines.h"
 
 #include "util/u_tile.h"
index d08b4d7354ca219cff034f86aeabea047a8debb8..7c360e9e73a15a977b72e0951148102bca2de526 100644 (file)
@@ -313,7 +313,7 @@ nv50_upload_sifc(struct nv50_context *nv50,
                while (count) {
                        unsigned nr = MIN2(count, 1792);
 
-                       if (chan->pushbuf->remaining <= nr) {
+                       if (AVAIL_RING(chan) <= nr) {
                                FIRE_RING (chan);
 
                                BEGIN_RING(chan, eng2d,
@@ -321,7 +321,7 @@ nv50_upload_sifc(struct nv50_context *nv50,
                                OUT_RELOCh(chan, bo, dst_offset, reloc);
                                OUT_RELOCl(chan, bo, dst_offset, reloc);
                        }
-                       assert(chan->pushbuf->remaining > nr);
+                       assert(AVAIL_RING(chan) > nr);
 
                        BEGIN_RING(chan, eng2d,
                                   NV50_2D_SIFC_DATA | (2 << 29), nr);
index 59709e7d648116727e658c9d27eda941956ea892..d31336ed76f79e029f4467e4e37d60ad3c217557 100644 (file)
@@ -382,6 +382,7 @@ void r500_emit_fs_constant_buffer(struct r300_context* r300,
 void r300_emit_fb_state(struct r300_context* r300, void* state)
 {
     struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)state;
+    struct r300_screen* r300screen = r300_screen(r300->context.screen);
     struct r300_texture* tex;
     struct pipe_surface* surf;
     int i;
@@ -400,10 +401,16 @@ void r300_emit_fb_state(struct r300_context* r300, void* state)
 
     /* Set the number of colorbuffers. */
     if (fb->nr_cbufs > 1) {
-        OUT_CS_REG(R300_RB3D_CCTL,
-            R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
-            R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE |
-            R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE);
+        if (r300screen->caps->is_r500) {
+            OUT_CS_REG(R300_RB3D_CCTL,
+                R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
+                R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE |
+                R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE);
+        } else {
+            OUT_CS_REG(R300_RB3D_CCTL,
+                R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
+                R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE);
+        }
     } else {
         OUT_CS_REG(R300_RB3D_CCTL, 0x0);
     }
index 75a05498eb32c22b01a8d84941aa16a7f98b8b28..ae4c62b2f1d830ad4cd1feb4c1f51387c345ce19 100644 (file)
@@ -179,6 +179,7 @@ static void r300_translate_fragment_shader(
     /* Translate TGSI to our internal representation */
     ttr.compiler = &compiler.Base;
     ttr.info = &fs->info;
+    ttr.use_half_swizzles = TRUE;
 
     r300_tgsi_to_rc(&ttr, fs->state.tokens);
 
index da4ec542ade23a9f3ea3112f8cfaf24811918099..13cd04a80ccb98c4d0ddd6a0b53cc9f68fa231c6 100644 (file)
@@ -186,8 +186,10 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param)
              * rendering limits. 2048 pixels should be enough for anybody. */
             if (r300screen->caps->is_r500) {
                 return 4096.0f;
+            } else if (r300screen->caps->is_r400) {
+                return 4021.0f;
             } else {
-                return 2048.0f;
+                return 2560.0f;
             }
         case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
             return 16.0f;
index 8d68aa230bf4474fda69ef880100a844754a9e2d..4d158cff7c78e38ceaa22d636267b46a1f768b72 100644 (file)
@@ -501,6 +501,8 @@ static void
                                const struct pipe_framebuffer_state* state)
 {
     struct r300_context* r300 = r300_context(pipe);
+    struct r300_screen* r300screen = r300_screen(pipe->screen);
+    unsigned max_width, max_height;
     uint32_t zbuffer_bpp = 0;
 
     r300->fb_state.size = (10 * state->nr_cbufs) +
@@ -513,6 +515,20 @@ static void
         return;
     }
 
+    if (r300screen->caps->is_r500) {
+        max_width = max_height = 4096;
+    } else if (r300screen->caps->is_r400) {
+        max_width = max_height = 4021;
+    } else {
+        max_width = max_height = 2560;
+    }
+
+    if (state->width > max_width || state->height > max_height) {
+        debug_printf("r300: Implementation error: Render targets are too "
+        "big in %s, refusing to bind framebuffer state!\n", __FUNCTION__);
+        return;
+    }
+
     if (r300->draw) {
         draw_flush(r300->draw);
     }
@@ -615,6 +631,7 @@ static void r300_set_polygon_stipple(struct pipe_context* pipe,
 static void* r300_create_rs_state(struct pipe_context* pipe,
                                   const struct pipe_rasterizer_state* state)
 {
+    struct r300_screen* r300screen = r300_screen(pipe->screen);
     struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state);
 
     /* Copy rasterizer state for Draw. */
@@ -629,20 +646,28 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
     /* If bypassing TCL, or if no TCL engine is present, turn off the HW TCL.
      * Else, enable HW TCL and force Draw's TCL off. */
     if (state->bypass_vs_clip_and_viewport ||
-            !r300_screen(pipe->screen)->caps->has_tcl) {
+            !r300screen->caps->has_tcl) {
         rs->vap_control_status |= R300_VAP_TCL_BYPASS;
     }
 
     rs->point_size = pack_float_16_6x(state->point_size) |
         (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT);
 
-        /* set hw limits - clamping done by state tracker in vs or point_size
-           XXX always need to emit this? */
-        rs->point_minmax =
-        ((int)(0.0 * 6.0) <<
-         R300_GA_POINT_MINMAX_MIN_SHIFT) |
-        ((int)(4096.0 * 6.0) <<
-         R300_GA_POINT_MINMAX_MAX_SHIFT);
+        /* Point minimum and maximum sizes. This register has to be emitted,
+         * and it'd be a step backwards to put it in invariant state. */
+        if (r300screen->caps->is_r500) {
+            rs->point_minmax =
+            ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) |
+            ((int)(4096.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT);
+        } else if (r300screen->caps->is_r400) {
+            rs->point_minmax =
+            ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) |
+            ((int)(4021.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT);
+        } else {
+            rs->point_minmax =
+            ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) |
+            ((int)(2560.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT);
+        }
 
     rs->line_control = pack_float_16_6x(state->line_width) |
         R300_GA_LINE_CNTL_END_TYPE_COMP;
index 67bf8ce13fd8a22842c0ec7cc9417736d3fbbbb8..417a57384c4e2e1d180b3973f49627844b57753e 100644 (file)
@@ -80,7 +80,6 @@ static void r300_setup_texture_state(struct r300_screen* screen, struct r300_tex
             state->format2 |= R500_TXHEIGHT_BIT11;
         }
     }
-    assert(is_r500 || (pt->width0 <= 2048 && pt->height0 <= 2048));
 
     SCREEN_DBG(screen, DBG_TEX, "r300: Set texture state (%dx%d, %d levels)\n",
                pt->width0, pt->height0, pt->last_level);
index 941ec17016b1e670890d309a7c786a9486264f70..aff4ddd4e23f9a8bb4a2479aa3a81bfe2746ddfe 100644 (file)
@@ -29,6 +29,7 @@
 #include "tgsi/tgsi_scan.h"
 #include "tgsi/tgsi_util.h"
 
+#include "util/u_debug.h"
 
 static unsigned translate_opcode(unsigned opcode)
 {
@@ -144,7 +145,7 @@ static unsigned translate_opcode(unsigned opcode)
         case TGSI_OPCODE_KIL: return RC_OPCODE_KIL;
     }
 
-    fprintf(stderr, "Unknown opcode: %i\n", opcode);
+    debug_printf("r300: Unknown TGSI/RC opcode: %i\n", opcode);
     return RC_OPCODE_ILLEGAL_OPCODE;
 }
 
@@ -306,7 +307,7 @@ static void handle_immediate(struct tgsi_to_rc * ttr,
     for (i = 0; i < 4; i++) {
         if (imm->u[i].Float == 0.0f) {
             swizzle |= RC_SWIZZLE_ZERO << (i * 3);
-        } else if (imm->u[i].Float == 0.5f) {
+        } else if (imm->u[i].Float == 0.5f && ttr->use_half_swizzles) {
             swizzle |= RC_SWIZZLE_HALF << (i * 3);
         } else if (imm->u[i].Float == 1.0f) {
             swizzle |= RC_SWIZZLE_ONE << (i * 3);
@@ -329,7 +330,8 @@ static void handle_immediate(struct tgsi_to_rc * ttr,
     }
 }
 
-void r300_tgsi_to_rc(struct tgsi_to_rc * ttr, const struct tgsi_token * tokens)
+void r300_tgsi_to_rc(struct tgsi_to_rc * ttr,
+                     const struct tgsi_token * tokens)
 {
     struct tgsi_parse_context parser;
     unsigned imm_index = 0;
index 39b473c7bf5cc35762c67c034fb8920bbd4fb680..97641a954b9c77497c3406d0820f760679748e0a 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef R300_TGSI_TO_RC_H
 #define R300_TGSI_TO_RC_H
 
+#include "pipe/p_compiler.h"
+
 struct radeon_compiler;
 
 struct tgsi_full_declaration;
@@ -41,6 +43,10 @@ struct tgsi_to_rc {
     int immediate_offset;
     struct swizzled_imms * imms_to_swizzle;
     unsigned imms_to_swizzle_count;
+
+    /* Vertex shaders have no half swizzles, and no way to handle them, so
+     * until rc grows proper support, indicate if they're safe to use. */
+    boolean use_half_swizzles;
 };
 
 void r300_tgsi_to_rc(struct tgsi_to_rc * ttr, const struct tgsi_token * tokens);
index fb81b2439b6fd13a925fdf9b33bdd225564008ea..a6786c321c615a3fadc4b0938e33e7e7ac07930d 100644 (file)
@@ -340,6 +340,7 @@ void r300_translate_vertex_shader(struct r300_context* r300,
     /* Translate TGSI to our internal representation */
     ttr.compiler = &compiler.Base;
     ttr.info = &vs->info;
+    ttr.use_half_swizzles = FALSE;
 
     r300_tgsi_to_rc(&ttr, vs->state.tokens);
 
index f4d2d8992c8b844f0469064c3d9b8c013b40e7f4..8b7ca2e1123c6f4421b7981a83189bd20f370272 100644 (file)
@@ -253,7 +253,9 @@ enum pipe_error svga_hwtnl_prim( struct svga_hwtnl *hwtnl,
          assert(index_bias >= 0);
          assert(min_index <= max_index);
          assert(offset + index_bias*stride < size);
-         assert(offset + (index_bias + min_index)*stride < size);
+         if (min_index != ~0) {
+            assert(offset + (index_bias + min_index) * stride < size);
+         }
 
          switch (hwtnl->cmd.vdecl[i].identity.type) {
          case SVGA3D_DECLTYPE_FLOAT1:
@@ -314,7 +316,9 @@ enum pipe_error svga_hwtnl_prim( struct svga_hwtnl *hwtnl,
          }
 
          assert(!stride || width <= stride);
-         assert(offset + (index_bias + max_index)*stride + width <= size);
+         if (max_index != ~0) {
+            assert(offset + (index_bias + max_index) * stride + width <= size);
+         }
       }
 
       assert(range->indexWidth == range->indexArray.stride);
index 8143be502441896e8909e38ee7bd09f249c7fcae..735cdfdae993d850a05f8fd1ce0d87e842f2666a 100644 (file)
@@ -111,6 +111,8 @@ svga_get_paramf(struct pipe_screen *screen, int param)
 
    case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
       return 16;
+   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
+      return 16;
    case PIPE_CAP_NPOT_TEXTURES:
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
index 9217af2dd99fc09d63bbbd63e25543d4b4647863..5db64bf135b9bb8d98cacc9d115ee15b7b85685d 100644 (file)
@@ -98,21 +98,33 @@ struct sh_defi
 #define PS_TEXTURETYPE_CUBE      SVGA3DSAMP_CUBE
 #define PS_TEXTURETYPE_VOLUME    SVGA3DSAMP_VOLUME
 
-struct ps_sampleinfo
+struct sh_sampleinfo
 {
    unsigned unused:27;
    unsigned texture_type:4;
    unsigned is_reg:1;
 };
 
-struct vs_semantic
+struct sh_semantic
 {
-   unsigned usage:5;
-   unsigned unused1:11;
+   unsigned usage:4;
+   unsigned unused1:12;
    unsigned usage_index:4;
-   unsigned unused2:12;
+   unsigned unused2:11;
+   unsigned is_reg:1;
 };
 
+#define SH_WRITEMASK_0              0x1
+#define SH_WRITEMASK_1              0x2
+#define SH_WRITEMASK_2              0x4
+#define SH_WRITEMASK_3              0x8
+#define SH_WRITEMASK_ALL            0xf
+
+#define SH_DSTMOD_NONE              0x0
+#define SH_DSTMOD_SATURATE          0x1
+#define SH_DSTMOD_PARTIALPRECISION  0x2
+#define SH_DSTMOD_MSAMPCENTROID     0x4
+
 struct sh_dstreg
 {
    unsigned number:11;
@@ -136,17 +148,12 @@ struct sh_dcl
 {
    struct sh_op op;
    union {
-      struct {
-         struct ps_sampleinfo sampleinfo;
-      } ps;
-      struct {
-         struct vs_semantic semantic;
-      } vs;
+      struct sh_sampleinfo sampleinfo;
+      struct sh_semantic semantic;
    } u;
    struct sh_dstreg reg;
 };
 
-
 struct sh_srcreg
 {
    unsigned number:11;
index 70e27d86d306df1c492d9cfe96e263ebf00b3698..d2bfb439f38e56d0b163efd2dcda634b9ea31dfd 100644 (file)
 
 struct dump_info
 {
-   SVGA3dShaderVersion version;
+   uint32 version;
    boolean is_ps;
+   int indent;
 };
 
-static void dump_op( struct sh_op op, const char *mnemonic )
+#define DUMP_MAX_OP_SRC 4
+
+struct dump_op
 {
-   assert( op.predicated == 0 );
-   assert( op.is_reg == 0 );
+   struct sh_op op;
+   struct sh_dstreg dst;
+   struct sh_srcreg dstind;
+   struct sh_srcreg src[DUMP_MAX_OP_SRC];
+   struct sh_srcreg srcind[DUMP_MAX_OP_SRC];
+   struct sh_srcreg p0;
+};
 
-   if (op.coissue)
-      _debug_printf( "+" );
-   _debug_printf( "%s", mnemonic );
-   switch (op.control) {
-   case 0:
-      break;
-   case SVGA3DOPCONT_PROJECT:
-      _debug_printf( "p" );
-      break;
-   case SVGA3DOPCONT_BIAS:
-      _debug_printf( "b" );
-      break;
-   default:
-      assert( 0 );
+static void
+dump_indent(int indent)
+{
+   int i;
+
+   for (i = 0; i < indent; ++i) {
+      _debug_printf("  ");
    }
 }
 
-
-static void dump_comp_op( struct sh_op op, const char *mnemonic )
+static void dump_op( struct sh_op op, const char *mnemonic )
 {
    assert( op.is_reg == 0 );
 
+   if (op.predicated) {
+      _debug_printf("(p0) ");
+   }
    if (op.coissue)
       _debug_printf( "+" );
    _debug_printf( "%s", mnemonic );
-   switch (op.control) {
-   case SVGA3DOPCOMP_RESERVED0:
-      break;
-   case SVGA3DOPCOMP_GT:
-      _debug_printf("_gt");
-      break;
-   case SVGA3DOPCOMP_EQ:
-      _debug_printf("_eq");
-      break;
-   case SVGA3DOPCOMP_GE:
-      _debug_printf("_ge");
-      break;
-   case SVGA3DOPCOMP_LT:
-      _debug_printf("_lt");
-      break;
-   case SVGA3DOPCOMPC_NE:
-      _debug_printf("_ne");
+
+   switch (op.opcode) {
+   case SVGA3DOP_TEX:
+      switch (op.control) {
+      case 0:
+         break;
+      case 1 /* PROJECT */:
+         _debug_printf("p");
+         break;
+      case 2 /* BIAS */:
+         _debug_printf("b");
+         break;
+      default:
+         assert(0);
+      }
       break;
-   case SVGA3DOPCOMP_LE:
-      _debug_printf("_le");
+
+   case SVGA3DOP_IFC:
+   case SVGA3DOP_BREAKC:
+   case SVGA3DOP_SETP:
+      switch (op.control) {
+      case SVGA3DOPCOMP_GT:
+         _debug_printf("_gt");
+         break;
+      case SVGA3DOPCOMP_EQ:
+         _debug_printf("_eq");
+         break;
+      case SVGA3DOPCOMP_GE:
+         _debug_printf("_ge");
+         break;
+      case SVGA3DOPCOMP_LT:
+         _debug_printf("_lt");
+         break;
+      case SVGA3DOPCOMPC_NE:
+         _debug_printf("_ne");
+         break;
+      case SVGA3DOPCOMP_LE:
+         _debug_printf("_le");
+         break;
+      default:
+         assert(0);
+      }
       break;
-   case SVGA3DOPCOMP_RESERVED1:
+
    default:
-      assert( 0 );
+      assert(op.control == 0);
    }
 }
 
+static void
+format_reg(const char *name,
+           const struct sh_reg reg,
+           const struct sh_srcreg *indreg)
+{
+   if (reg.relative) {
+      assert(indreg);
+
+      if (sh_srcreg_type(*indreg) == SVGA3DREG_LOOP) {
+         _debug_printf("%s[aL+%u]", name, reg.number);
+      } else {
+         _debug_printf("%s[a%u.x+%u]", name, indreg->number, reg.number);
+      }
+   } else {
+      _debug_printf("%s%u", name, reg.number);
+   }
+}
 
 static void dump_reg( struct sh_reg reg, struct sh_srcreg *indreg, const struct dump_info *di )
 {
-   assert( sh_reg_type( reg ) == SVGA3DREG_CONST || reg.relative == 0 );
    assert( reg.is_reg == 1 );
 
    switch (sh_reg_type( reg )) {
    case SVGA3DREG_TEMP:
-      _debug_printf( "r%u", reg.number );
+      format_reg("r", reg, NULL);
       break;
 
    case SVGA3DREG_INPUT:
-      _debug_printf( "v%u", reg.number );
+      format_reg("v", reg, indreg);
       break;
 
    case SVGA3DREG_CONST:
-      if (reg.relative) {
-         if (sh_srcreg_type( *indreg ) == SVGA3DREG_LOOP)
-            _debug_printf( "c[aL+%u]", reg.number );
-         else
-            _debug_printf( "c[a%u.x+%u]", indreg->number, reg.number );
-      }
-      else
-         _debug_printf( "c%u", reg.number );
+      format_reg("c", reg, indreg);
       break;
 
    case SVGA3DREG_ADDR:    /* VS */
    /* SVGA3DREG_TEXTURE */ /* PS */
-      if (di->is_ps)
-         _debug_printf( "t%u", reg.number );
-      else
-         _debug_printf( "a%u", reg.number );
+      assert(!reg.relative);
+      if (di->is_ps) {
+         format_reg("t", reg, NULL);
+      } else {
+         format_reg("a", reg, NULL);
+      }
       break;
 
    case SVGA3DREG_RASTOUT:
+      assert(!reg.relative);
       switch (reg.number) {
       case 0 /*POSITION*/:
          _debug_printf( "oPos" );
@@ -154,64 +191,69 @@ static void dump_reg( struct sh_reg reg, struct sh_srcreg *indreg, const struct
 
    case SVGA3DREG_ATTROUT:
       assert( reg.number < 2 );
-      _debug_printf( "oD%u", reg.number );
+      format_reg("oD", reg, NULL);
       break;
 
-   case SVGA3DREG_TEXCRDOUT:
-   /* SVGA3DREG_OUTPUT */
-      _debug_printf( "oT%u", reg.number );
+   case SVGA3DREG_TEXCRDOUT:  /* VS */
+   /* SVGA3DREG_OUTPUT */     /* VS3.0+ */
+      if (!di->is_ps && di->version >= SVGA3D_VS_30) {
+         format_reg("o", reg, indreg);
+      } else {
+         format_reg("oT", reg, NULL);
+      }
       break;
 
    case SVGA3DREG_COLOROUT:
-      _debug_printf( "oC%u", reg.number );
+      format_reg("oC", reg, NULL);
       break;
 
    case SVGA3DREG_DEPTHOUT:
-      _debug_printf( "oD%u", reg.number );
+      assert(!reg.relative);
+      assert(reg.number == 0);
+      _debug_printf("oDepth");
       break;
 
    case SVGA3DREG_SAMPLER:
-      _debug_printf( "s%u", reg.number );
+      format_reg("s", reg, NULL);
       break;
 
    case SVGA3DREG_CONSTBOOL:
-      assert( !reg.relative );
-      _debug_printf( "b%u", reg.number );
+      format_reg("b", reg, NULL);
       break;
 
    case SVGA3DREG_CONSTINT:
-      assert( !reg.relative );
-      _debug_printf( "i%u", reg.number );
+      format_reg("i", reg, NULL);
       break;
 
    case SVGA3DREG_LOOP:
+      assert(!reg.relative);
       assert( reg.number == 0 );
       _debug_printf( "aL" );
       break;
 
    case SVGA3DREG_MISCTYPE:
+      assert(!reg.relative);
       switch (reg.number) {
       case SVGA3DMISCREG_POSITION:
-         _debug_printf( "vPos" );
+         _debug_printf("vPos");
          break;
       case SVGA3DMISCREG_FACE:
-         _debug_printf( "vFace" );
+         _debug_printf("vFace");
          break;
       default:
          assert(0);
-         break;
+         _debug_printf("???");
       }
       break;
 
    case SVGA3DREG_LABEL:
-      _debug_printf( "l%u", reg.number );
+      format_reg("l", reg, NULL);
       break;
 
    case SVGA3DREG_PREDICATE:
-      _debug_printf( "p%u", reg.number );
+      format_reg("p", reg, NULL);
       break;
 
-
    default:
       assert( 0 );
       _debug_printf( "???" );
@@ -233,8 +275,11 @@ static void dump_bdata( boolean bdata )
    _debug_printf( bdata ? "TRUE" : "FALSE" );
 }
 
-static void dump_sampleinfo( struct ps_sampleinfo sampleinfo )
+static void
+dump_sampleinfo(struct sh_sampleinfo sampleinfo)
 {
+   assert( sampleinfo.is_reg == 1 );
+
    switch (sampleinfo.texture_type) {
    case SVGA3DSAMP_2D:
       _debug_printf( "_2d" );
@@ -250,63 +295,67 @@ static void dump_sampleinfo( struct ps_sampleinfo sampleinfo )
    }
 }
 
-
-static void dump_usageinfo( struct vs_semantic semantic )
+static void
+dump_semantic(uint usage,
+              uint usage_index)
 {
-   switch (semantic.usage) {
+   switch (usage) {
    case SVGA3D_DECLUSAGE_POSITION:
-      _debug_printf("_position" );
+      _debug_printf("_position");
       break;
    case SVGA3D_DECLUSAGE_BLENDWEIGHT:
-      _debug_printf("_blendweight" );
+      _debug_printf("_blendweight");
       break;
    case SVGA3D_DECLUSAGE_BLENDINDICES:
-      _debug_printf("_blendindices" );
+      _debug_printf("_blendindices");
       break;
    case SVGA3D_DECLUSAGE_NORMAL:
-      _debug_printf("_normal" );
+      _debug_printf("_normal");
       break;
    case SVGA3D_DECLUSAGE_PSIZE:
-      _debug_printf("_psize" );
+      _debug_printf("_psize");
       break;
    case SVGA3D_DECLUSAGE_TEXCOORD:
       _debug_printf("_texcoord");
       break;
    case SVGA3D_DECLUSAGE_TANGENT:
-      _debug_printf("_tangent" );
+      _debug_printf("_tangent");
       break;
    case SVGA3D_DECLUSAGE_BINORMAL:
-      _debug_printf("_binormal" );
+      _debug_printf("_binormal");
       break;
    case SVGA3D_DECLUSAGE_TESSFACTOR:
-      _debug_printf("_tessfactor" );
+      _debug_printf("_tessfactor");
       break;
    case SVGA3D_DECLUSAGE_POSITIONT:
-      _debug_printf("_positiont" );
+      _debug_printf("_positiont");
       break;
    case SVGA3D_DECLUSAGE_COLOR:
-      _debug_printf("_color" );
+      _debug_printf("_color");
       break;
    case SVGA3D_DECLUSAGE_FOG:
-      _debug_printf("_fog" );
+      _debug_printf("_fog");
       break;
    case SVGA3D_DECLUSAGE_DEPTH:
-      _debug_printf("_depth" );
+      _debug_printf("_depth");
       break;
    case SVGA3D_DECLUSAGE_SAMPLE:
       _debug_printf("_sample");
       break;
    default:
-      assert( 0 );
-      return;
+      assert(!"Unknown usage");
+      _debug_printf("_???");
    }
 
-   if (semantic.usage_index != 0) {
-      _debug_printf("%d", semantic.usage_index );
+   if (usage_index) {
+      _debug_printf("%u", usage_index);
    }
 }
 
-static void dump_dstreg( struct sh_dstreg dstreg, const struct dump_info *di )
+static void
+dump_dstreg(struct sh_dstreg dstreg,
+            struct sh_srcreg *indreg,
+            const struct dump_info *di)
 {
    union {
       struct sh_reg reg;
@@ -346,7 +395,7 @@ static void dump_dstreg( struct sh_dstreg dstreg, const struct dump_info *di )
    _debug_printf( " " );
 
    u.dstreg = dstreg;
-   dump_reg( u.reg, NULL, di );
+   dump_reg( u.reg, indreg, di);
    if (dstreg.write_mask != SVGA3DWRITEMASK_ALL) {
       _debug_printf( "." );
       if (dstreg.write_mask & SVGA3DWRITEMASK_0)
@@ -362,23 +411,13 @@ static void dump_dstreg( struct sh_dstreg dstreg, const struct dump_info *di )
 
 static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, const struct dump_info *di )
 {
-   union {
-      struct sh_reg reg;
-      struct sh_srcreg srcreg;
-   } u;
-
    switch (srcreg.modifier) {
    case SVGA3DSRCMOD_NEG:
    case SVGA3DSRCMOD_BIASNEG:
    case SVGA3DSRCMOD_SIGNNEG:
    case SVGA3DSRCMOD_X2NEG:
-      _debug_printf( "-" );
-      break;
-   case SVGA3DSRCMOD_ABS:
-      _debug_printf( "|" );
-      break;
    case SVGA3DSRCMOD_ABSNEG:
-      _debug_printf( "-|" );
+      _debug_printf( "-" );
       break;
    case SVGA3DSRCMOD_COMP:
       _debug_printf( "1-" );
@@ -386,19 +425,13 @@ static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, cons
    case SVGA3DSRCMOD_NOT:
       _debug_printf( "!" );
    }
-
-   u.srcreg = srcreg;
-   dump_reg( u.reg, indreg, di );
+   dump_reg( *(struct sh_reg *) &srcreg, indreg, di );
    switch (srcreg.modifier) {
    case SVGA3DSRCMOD_NONE:
    case SVGA3DSRCMOD_NEG:
    case SVGA3DSRCMOD_COMP:
    case SVGA3DSRCMOD_NOT:
       break;
-   case SVGA3DSRCMOD_ABS:
-   case SVGA3DSRCMOD_ABSNEG:
-      _debug_printf( "|" );
-      break;
    case SVGA3DSRCMOD_BIAS:
    case SVGA3DSRCMOD_BIASNEG:
       _debug_printf( "_bias" );
@@ -417,6 +450,10 @@ static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, cons
    case SVGA3DSRCMOD_DW:
       _debug_printf( "_dw" );
       break;
+   case SVGA3DSRCMOD_ABS:
+   case SVGA3DSRCMOD_ABSNEG:
+      _debug_printf("_abs");
+      break;
    default:
       assert( 0 );
    }
@@ -434,58 +471,132 @@ static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, cons
    }
 }
 
+static void
+parse_op(struct dump_info *di,
+         const uint **token,
+         struct dump_op *op,
+         uint num_dst,
+         uint num_src)
+{
+   uint i;
+
+   assert(num_dst <= 1);
+   assert(num_src <= DUMP_MAX_OP_SRC);
+
+   op->op = *(struct sh_op *)*token;
+   *token += sizeof(struct sh_op) / sizeof(uint);
+
+   if (num_dst >= 1) {
+      op->dst = *(struct sh_dstreg *)*token;
+      *token += sizeof(struct sh_dstreg) / sizeof(uint);
+      if (op->dst.relative &&
+          (!di->is_ps && di->version >= SVGA3D_VS_30)) {
+         op->dstind = *(struct sh_srcreg *)*token;
+         *token += sizeof(struct sh_srcreg) / sizeof(uint);
+      }
+   }
+
+   if (op->op.predicated) {
+      op->p0 = *(struct sh_srcreg *)*token;
+      *token += sizeof(struct sh_srcreg) / sizeof(uint);
+   }
+
+   for (i = 0; i < num_src; ++i) {
+      op->src[i] = *(struct sh_srcreg *)*token;
+      *token += sizeof(struct sh_srcreg) / sizeof(uint);
+      if (op->src[i].relative &&
+          ((!di->is_ps && di->version >= SVGA3D_VS_20) ||
+          (di->is_ps && di->version >= SVGA3D_PS_30))) {
+         op->srcind[i] = *(struct sh_srcreg *)*token;
+         *token += sizeof(struct sh_srcreg) / sizeof(uint);
+      }
+   }
+}
+
+static void
+dump_inst(struct dump_info *di,
+          const unsigned **assem,
+          struct sh_op op,
+          const struct sh_opcode_info *info)
+{
+   struct dump_op dop;
+   boolean not_first_arg = FALSE;
+   uint i;
+
+   assert(info->num_dst <= 1);
+
+   di->indent -= info->pre_dedent;
+   dump_indent(di->indent);
+   di->indent += info->post_indent;
+
+   dump_op(op, info->mnemonic);
+
+   parse_op(di, assem, &dop, info->num_dst, info->num_src);
+   if (info->num_dst > 0) {
+      dump_dstreg(dop.dst, &dop.dstind, di);
+      not_first_arg = TRUE;
+   }
+
+   for (i = 0; i < info->num_src; i++) {
+      if (not_first_arg) {
+         _debug_printf(", ");
+      } else {
+         _debug_printf(" ");
+      }
+      dump_srcreg(dop.src[i], &dop.srcind[i], di);
+      not_first_arg = TRUE;
+   }
+
+   _debug_printf("\n");
+}
+
 void
 svga_shader_dump(
    const unsigned *assem,
    unsigned dwords,
    unsigned do_binary )
 {
-   const unsigned *start = assem;
    boolean finished = FALSE;
    struct dump_info di;
-   unsigned i;
 
-   if (do_binary) {
-      for (i = 0; i < dwords; i++) 
-         _debug_printf("  0x%08x,\n", assem[i]);
-      
-      _debug_printf("\n\n");
-   }
-
-   di.version.value = *assem++;
-   di.is_ps = (di.version.type == SVGA3D_PS_TYPE);
+   di.version = *assem++;
+   di.is_ps = (di.version & 0xFFFF0000) == 0xFFFF0000;
+   di.indent = 0;
 
    _debug_printf(
       "%s_%u_%u\n",
       di.is_ps ? "ps" : "vs",
-      di.version.major,
-      di.version.minor );
+      (di.version >> 8) & 0xff,
+      di.version & 0xff );
 
    while (!finished) {
       struct sh_op op = *(struct sh_op *) assem;
 
-      if (assem - start >= dwords) {
-         _debug_printf("... ran off end of buffer\n");
-         assert(0);
-         return;
-      }
-
       switch (op.opcode) {
       case SVGA3DOP_DCL:
          {
             struct sh_dcl dcl = *(struct sh_dcl *) assem;
 
             _debug_printf( "dcl" );
-            if (sh_dstreg_type( dcl.reg ) == SVGA3DREG_SAMPLER)
-               dump_sampleinfo( dcl.u.ps.sampleinfo );
-            else if (di.is_ps) {
-               if (di.version.major == 3 && 
-                   sh_dstreg_type( dcl.reg ) != SVGA3DREG_MISCTYPE)
-                  dump_usageinfo( dcl.u.vs.semantic );
+            switch (sh_dstreg_type(dcl.reg)) {
+            case SVGA3DREG_INPUT:
+               if ((di.is_ps && di.version >= SVGA3D_PS_30) ||
+                   (!di.is_ps && di.version >= SVGA3D_VS_30)) {
+                  dump_semantic(dcl.u.semantic.usage,
+                                dcl.u.semantic.usage_index);
+               }
+               break;
+            case SVGA3DREG_TEXCRDOUT:
+               if (!di.is_ps && di.version >= SVGA3D_VS_30) {
+                  dump_semantic(dcl.u.semantic.usage,
+                                dcl.u.semantic.usage_index);
+               }
+               break;
+            case SVGA3DREG_SAMPLER:
+               dump_sampleinfo( dcl.u.sampleinfo );
+               break;
             }
-            else
-               dump_usageinfo( dcl.u.vs.semantic );
-            dump_dstreg( dcl.reg, &di );
+            dump_dstreg(dcl.reg, NULL, &di);
             _debug_printf( "\n" );
             assem += sizeof( struct sh_dcl ) / sizeof( unsigned );
          }
@@ -518,54 +629,38 @@ svga_shader_dump(
          break;
 
       case SVGA3DOP_TEXCOORD:
-         assert( di.is_ps );
-         dump_op( op, "texcoord" );
-         if (0) {
-            struct sh_dstop dstop = *(struct sh_dstop *) assem;
-            dump_dstreg( dstop.dst, &di );
-            assem += sizeof( struct sh_dstop ) / sizeof( unsigned );
-         }
-         else {
-            struct sh_unaryop unaryop = *(struct sh_unaryop *) assem;
-            dump_dstreg( unaryop.dst, &di );
-            _debug_printf( ", " );
-            dump_srcreg( unaryop.src, NULL, &di );
-            assem += sizeof( struct sh_unaryop ) / sizeof( unsigned );
+         {
+            struct sh_opcode_info info = *svga_opcode_info(op.opcode);
+
+            assert(di.is_ps);
+            if (di.version > SVGA3D_PS_13) {
+               assert(info.num_src == 0);
+
+               info.num_src = 1;
+            }
+
+            dump_inst(&di, &assem, op, &info);
          }
-         _debug_printf( "\n" );
          break;
 
       case SVGA3DOP_TEX:
-         assert( di.is_ps );
-         if (0) {
-            dump_op( op, "tex" );
-            if (0) {
-               struct sh_dstop dstop = *(struct sh_dstop *) assem;
-
-               dump_dstreg( dstop.dst, &di );
-               assem += sizeof( struct sh_dstop ) / sizeof( unsigned );
-            }
-            else {
-               struct sh_unaryop unaryop = *(struct sh_unaryop *) assem;
+         {
+            struct sh_opcode_info info = *svga_opcode_info(op.opcode);
 
-               dump_dstreg( unaryop.dst, &di );
-               _debug_printf( ", " );
-               dump_srcreg( unaryop.src, NULL, &di );
-               assem += sizeof( struct sh_unaryop ) / sizeof( unsigned );
+            assert(di.is_ps);
+            if (di.version > SVGA3D_PS_13) {
+               assert(info.num_src == 0);
+
+               if (di.version > SVGA3D_PS_14) {
+                  info.num_src = 2;
+                  info.mnemonic = "texld";
+               } else {
+                  info.num_src = 1;
+               }
             }
-         }
-         else {
-            struct sh_binaryop binaryop = *(struct sh_binaryop *) assem;
 
-            dump_op( op, "texld" );
-            dump_dstreg( binaryop.dst, &di );
-            _debug_printf( ", " );
-            dump_srcreg( binaryop.src0, NULL, &di );
-            _debug_printf( ", " );
-            dump_srcreg( binaryop.src1, NULL, &di );
-            assem += sizeof( struct sh_binaryop ) / sizeof( unsigned );
+            dump_inst(&di, &assem, op, &info);
          }
-         _debug_printf( "\n" );
          break;
 
       case SVGA3DOP_DEF:
@@ -581,6 +676,21 @@ svga_shader_dump(
          }
          break;
 
+      case SVGA3DOP_SINCOS:
+         {
+            struct sh_opcode_info info = *svga_opcode_info(op.opcode);
+
+            if ((di.is_ps && di.version >= SVGA3D_PS_30) ||
+                (!di.is_ps && di.version >= SVGA3D_VS_30)) {
+               assert(info.num_src == 3);
+
+               info.num_src = 1;
+            }
+
+            dump_inst(&di, &assem, op, &info);
+         }
+         break;
+
       case SVGA3DOP_PHASE:
          _debug_printf( "phase\n" );
          assem += sizeof( struct sh_op ) / sizeof( unsigned );
@@ -595,59 +705,15 @@ svga_shader_dump(
          }
          break;
 
-      case SVGA3DOP_RET:
-         _debug_printf( "ret\n" );
-         assem += sizeof( struct sh_op ) / sizeof( unsigned );
-         break;
-
       case SVGA3DOP_END:
-         _debug_printf( "end\n" );
          finished = TRUE;
          break;
 
       default:
          {
-            const struct sh_opcode_info *info = svga_opcode_info( op.opcode );
-            uint i;
-            uint num_src = info->num_src + op.predicated;
-            boolean not_first_arg = FALSE;
-
-            assert( info->num_dst <= 1 );
-
-            if (op.opcode == SVGA3DOP_SINCOS && di.version.major < 3)
-               num_src += 2;
-
-            dump_comp_op( op, info->mnemonic );
-            assem += sizeof( struct sh_op ) / sizeof( unsigned );
-
-            if (info->num_dst > 0) {
-               struct sh_dstreg dstreg = *(struct sh_dstreg *) assem;
+            const struct sh_opcode_info *info = svga_opcode_info(op.opcode);
 
-               dump_dstreg( dstreg, &di );
-               assem += sizeof( struct sh_dstreg ) / sizeof( unsigned );
-               not_first_arg = TRUE;
-            }
-
-            for (i = 0; i < num_src; i++) {
-               struct sh_srcreg srcreg;
-               struct sh_srcreg indreg;
-
-               srcreg = *(struct sh_srcreg *) assem;
-               assem += sizeof( struct sh_srcreg ) / sizeof( unsigned );
-               if (srcreg.relative && !di.is_ps && di.version.major >= 2) {
-                  indreg = *(struct sh_srcreg *) assem;
-                  assem += sizeof( struct sh_srcreg ) / sizeof( unsigned );
-               }
-
-               if (not_first_arg)
-                  _debug_printf( ", " );
-               else
-                  _debug_printf( " " );
-               dump_srcreg( srcreg, &indreg, &di );
-               not_first_arg = TRUE;
-            }
-
-            _debug_printf( "\n" );
+            dump_inst(&di, &assem, op, info);
          }
       }
    }
index 8343bfdaab40fdcd77beb00c101be2347251b1d0..95612a8006306665a5784637b475d22e40d2abfa 100644 (file)
 
 static struct sh_opcode_info opcode_info[] =
 {
-   { "nop",          0, 0, SVGA3DOP_NOP          },
-   { "mov",          1, 1, SVGA3DOP_MOV,         },
-   { "add",          1, 2, SVGA3DOP_ADD,         },
-   { "sub",          1, 2, SVGA3DOP_SUB,         },
-   { "mad",          1, 3, SVGA3DOP_MAD,         },
-   { "mul",          1, 2, SVGA3DOP_MUL,         },
-   { "rcp",          1, 1, SVGA3DOP_RCP,         },
-   { "rsq",          1, 1, SVGA3DOP_RSQ,         },
-   { "dp3",          1, 2, SVGA3DOP_DP3,         },
-   { "dp4",          1, 2, SVGA3DOP_DP4,         },
-   { "min",          1, 2, SVGA3DOP_MIN,         },
-   { "max",          1, 2, SVGA3DOP_MAX,         },
-   { "slt",          1, 2, SVGA3DOP_SLT,         },
-   { "sge",          1, 2, SVGA3DOP_SGE,         },
-   { "exp",          1, 1, SVGA3DOP_EXP,         },
-   { "log",          1, 1, SVGA3DOP_LOG,         },
-   { "lit",          1, 1, SVGA3DOP_LIT,         },
-   { "dst",          1, 2, SVGA3DOP_DST,         },
-   { "lrp",          1, 3, SVGA3DOP_LRP,         },
-   { "frc",          1, 1, SVGA3DOP_FRC,         },
-   { "m4x4",         1, 2, SVGA3DOP_M4x4,        },
-   { "m4x3",         1, 2, SVGA3DOP_M4x3,        },
-   { "m3x4",         1, 2, SVGA3DOP_M3x4,        },
-   { "m3x3",         1, 2, SVGA3DOP_M3x3,        },
-   { "m3x2",         1, 2, SVGA3DOP_M3x2,        },
-   { "call",         0, 1, SVGA3DOP_CALL,        },
-   { "callnz",       0, 2, SVGA3DOP_CALLNZ,      },
-   { "loop",         0, 2, SVGA3DOP_LOOP,        },
-   { "ret",          0, 0, SVGA3DOP_RET,         },
-   { "endloop",      0, 0, SVGA3DOP_ENDLOOP,     },
-   { "label",        0, 1, SVGA3DOP_LABEL,       },
-   { "dcl",          0, 0, SVGA3DOP_DCL,         },
-   { "pow",          1, 2, SVGA3DOP_POW,         },
-   { "crs",          1, 2, SVGA3DOP_CRS,         },
-   { "sgn",          1, 3, SVGA3DOP_SGN,         },
-   { "abs",          1, 1, SVGA3DOP_ABS,         },
-   { "nrm",          1, 1, SVGA3DOP_NRM,         }, /* 3-componenet normalization */
-   { "sincos",       1, 1, SVGA3DOP_SINCOS,      },
-   { "rep",          0, 1, SVGA3DOP_REP,         },
-   { "endrep",       0, 0, SVGA3DOP_ENDREP,      },
-   { "if",           0, 1, SVGA3DOP_IF,          },
-   { "ifc",          0, 2, SVGA3DOP_IFC,         },
-   { "else",         0, 0, SVGA3DOP_ELSE,        },
-   { "endif",        0, 0, SVGA3DOP_ENDIF,       },
-   { "break",        0, 0, SVGA3DOP_BREAK,       },
-   { "breakc",       0, 0, SVGA3DOP_BREAKC,      },
-   { "mova",         1, 1, SVGA3DOP_MOVA,        },
-   { "defb",         0, 0, SVGA3DOP_DEFB,        },
-   { "defi",         0, 0, SVGA3DOP_DEFI,        },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "???",          0, 0, SVGA3DOP_INVALID,     },
-   { "texcoord",     0, 0, SVGA3DOP_TEXCOORD,    },
-   { "texkill",      1, 0, SVGA3DOP_TEXKILL,     },
-   { "tex",          0, 0, SVGA3DOP_TEX,         },
-   { "texbem",       1, 1, SVGA3DOP_TEXBEM,      },
-   { "texbeml",      1, 1, SVGA3DOP_TEXBEML,     },
-   { "texreg2ar",    1, 1, SVGA3DOP_TEXREG2AR,   },
-   { "texreg2gb",    1, 1, SVGA3DOP_TEXREG2GB,   },
-   { "texm3x2pad",   1, 1, SVGA3DOP_TEXM3x2PAD,  },
-   { "texm3x2tex",   1, 1, SVGA3DOP_TEXM3x2TEX,  },
-   { "texm3x3pad",   1, 1, SVGA3DOP_TEXM3x3PAD,  },
-   { "texm3x3tex",   1, 1, SVGA3DOP_TEXM3x3TEX,  },
-   { "reserved0",    0, 0, SVGA3DOP_RESERVED0,   },
-   { "texm3x3spec",  1, 2, SVGA3DOP_TEXM3x3SPEC, },
-   { "texm3x3vspec", 1, 1, SVGA3DOP_TEXM3x3VSPEC,},
-   { "expp",         1, 1, SVGA3DOP_EXPP,        },
-   { "logp",         1, 1, SVGA3DOP_LOGP,        },
-   { "cnd",          1, 3, SVGA3DOP_CND,         },
-   { "def",          0, 0, SVGA3DOP_DEF,         },
-   { "texreg2rgb",   1, 1, SVGA3DOP_TEXREG2RGB,  },
-   { "texdp3tex",    1, 1, SVGA3DOP_TEXDP3TEX,   },
-   { "texm3x2depth", 1, 1, SVGA3DOP_TEXM3x2DEPTH,},
-   { "texdp3",       1, 1, SVGA3DOP_TEXDP3,      },
-   { "texm3x3",      1, 1, SVGA3DOP_TEXM3x3,     },
-   { "texdepth",     1, 0, SVGA3DOP_TEXDEPTH,    },
-   { "cmp",          1, 3, SVGA3DOP_CMP,         },
-   { "bem",          1, 2, SVGA3DOP_BEM,         },
-   { "dp2add",       1, 3, SVGA3DOP_DP2ADD,      },
-   { "dsx",          1, 1, SVGA3DOP_INVALID,     },
-   { "dsy",          1, 1, SVGA3DOP_INVALID,     },
-   { "texldd",       1, 1, SVGA3DOP_INVALID,     },
-   { "setp",         1, 2, SVGA3DOP_SETP,        },
-   { "texldl",       1, 1, SVGA3DOP_INVALID,     },
-   { "breakp",       1, 1, SVGA3DOP_INVALID,     },
+   { "nop",          0, 0, 0, 0, SVGA3DOP_NOP          },
+   { "mov",          1, 1, 0, 0, SVGA3DOP_MOV,         },
+   { "add",          1, 2, 0, 0, SVGA3DOP_ADD,         },
+   { "sub",          1, 2, 0, 0, SVGA3DOP_SUB,         },
+   { "mad",          1, 3, 0, 0, SVGA3DOP_MAD,         },
+   { "mul",          1, 2, 0, 0, SVGA3DOP_MUL,         },
+   { "rcp",          1, 1, 0, 0, SVGA3DOP_RCP,         },
+   { "rsq",          1, 1, 0, 0, SVGA3DOP_RSQ,         },
+   { "dp3",          1, 2, 0, 0, SVGA3DOP_DP3,         },
+   { "dp4",          1, 2, 0, 0, SVGA3DOP_DP4,         },
+   { "min",          1, 2, 0, 0, SVGA3DOP_MIN,         },
+   { "max",          1, 2, 0, 0, SVGA3DOP_MAX,         },
+   { "slt",          1, 2, 0, 0, SVGA3DOP_SLT,         },
+   { "sge",          1, 2, 0, 0, SVGA3DOP_SGE,         },
+   { "exp",          1, 1, 0, 0, SVGA3DOP_EXP,         },
+   { "log",          1, 1, 0, 0, SVGA3DOP_LOG,         },
+   { "lit",          1, 1, 0, 0, SVGA3DOP_LIT,         },
+   { "dst",          1, 2, 0, 0, SVGA3DOP_DST,         },
+   { "lrp",          1, 3, 0, 0, SVGA3DOP_LRP,         },
+   { "frc",          1, 1, 0, 0, SVGA3DOP_FRC,         },
+   { "m4x4",         1, 2, 0, 0, SVGA3DOP_M4x4,        },
+   { "m4x3",         1, 2, 0, 0, SVGA3DOP_M4x3,        },
+   { "m3x4",         1, 2, 0, 0, SVGA3DOP_M3x4,        },
+   { "m3x3",         1, 2, 0, 0, SVGA3DOP_M3x3,        },
+   { "m3x2",         1, 2, 0, 0, SVGA3DOP_M3x2,        },
+   { "call",         0, 1, 0, 0, SVGA3DOP_CALL,        },
+   { "callnz",       0, 2, 0, 0, SVGA3DOP_CALLNZ,      },
+   { "loop",         0, 2, 0, 1, SVGA3DOP_LOOP,        },
+   { "ret",          0, 0, 0, 0, SVGA3DOP_RET,         },
+   { "endloop",      0, 0, 1, 0, SVGA3DOP_ENDLOOP,     },
+   { "label",        0, 1, 0, 0, SVGA3DOP_LABEL,       },
+   { "dcl",          0, 0, 0, 0, SVGA3DOP_DCL,         },
+   { "pow",          1, 2, 0, 0, SVGA3DOP_POW,         },
+   { "crs",          1, 2, 0, 0, SVGA3DOP_CRS,         },
+   { "sgn",          1, 3, 0, 0, SVGA3DOP_SGN,         },
+   { "abs",          1, 1, 0, 0, SVGA3DOP_ABS,         },
+   { "nrm",          1, 1, 0, 0, SVGA3DOP_NRM,         }, /* 3-componenet normalization */
+   { "sincos",       1, 3, 0, 0, SVGA3DOP_SINCOS,      },
+   { "rep",          0, 1, 0, 1, SVGA3DOP_REP,         },
+   { "endrep",       0, 0, 1, 0, SVGA3DOP_ENDREP,      },
+   { "if",           0, 1, 0, 1, SVGA3DOP_IF,          },
+   { "ifc",          0, 2, 0, 1, SVGA3DOP_IFC,         },
+   { "else",         0, 0, 1, 1, SVGA3DOP_ELSE,        },
+   { "endif",        0, 0, 1, 0, SVGA3DOP_ENDIF,       },
+   { "break",        0, 0, 0, 0, SVGA3DOP_BREAK,       },
+   { "breakc",       0, 2, 0, 0, SVGA3DOP_BREAKC,      },
+   { "mova",         1, 1, 0, 0, SVGA3DOP_MOVA,        },
+   { "defb",         0, 0, 0, 0, SVGA3DOP_DEFB,        },
+   { "defi",         0, 0, 0, 0, SVGA3DOP_DEFI,        },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "???",          0, 0, 0, 0, SVGA3DOP_INVALID,     },
+   { "texcoord",     1, 0, 0, 0, SVGA3DOP_TEXCOORD,    },
+   { "texkill",      1, 0, 0, 0, SVGA3DOP_TEXKILL,     },
+   { "tex",          1, 0, 0, 0, SVGA3DOP_TEX,         },
+   { "texbem",       1, 1, 0, 0, SVGA3DOP_TEXBEM,      },
+   { "texbeml",      1, 1, 0, 0, SVGA3DOP_TEXBEML,     },
+   { "texreg2ar",    1, 1, 0, 0, SVGA3DOP_TEXREG2AR,   },
+   { "texreg2gb",    1, 1, 0, 0, SVGA3DOP_TEXREG2GB,   },
+   { "texm3x2pad",   1, 1, 0, 0, SVGA3DOP_TEXM3x2PAD,  },
+   { "texm3x2tex",   1, 1, 0, 0, SVGA3DOP_TEXM3x2TEX,  },
+   { "texm3x3pad",   1, 1, 0, 0, SVGA3DOP_TEXM3x3PAD,  },
+   { "texm3x3tex",   1, 1, 0, 0, SVGA3DOP_TEXM3x3TEX,  },
+   { "reserved0",    0, 0, 0, 0, SVGA3DOP_RESERVED0,   },
+   { "texm3x3spec",  1, 2, 0, 0, SVGA3DOP_TEXM3x3SPEC, },
+   { "texm3x3vspec", 1, 1, 0, 0, SVGA3DOP_TEXM3x3VSPEC,},
+   { "expp",         1, 1, 0, 0, SVGA3DOP_EXPP,        },
+   { "logp",         1, 1, 0, 0, SVGA3DOP_LOGP,        },
+   { "cnd",          1, 3, 0, 0, SVGA3DOP_CND,         },
+   { "def",          0, 0, 0, 0, SVGA3DOP_DEF,         },
+   { "texreg2rgb",   1, 1, 0, 0, SVGA3DOP_TEXREG2RGB,  },
+   { "texdp3tex",    1, 1, 0, 0, SVGA3DOP_TEXDP3TEX,   },
+   { "texm3x2depth", 1, 1, 0, 0, SVGA3DOP_TEXM3x2DEPTH,},
+   { "texdp3",       1, 1, 0, 0, SVGA3DOP_TEXDP3,      },
+   { "texm3x3",      1, 1, 0, 0, SVGA3DOP_TEXM3x3,     },
+   { "texdepth",     1, 0, 0, 0, SVGA3DOP_TEXDEPTH,    },
+   { "cmp",          1, 3, 0, 0, SVGA3DOP_CMP,         },
+   { "bem",          1, 2, 0, 0, SVGA3DOP_BEM,         },
+   { "dp2add",       1, 3, 0, 0, SVGA3DOP_DP2ADD,      },
+   { "dsx",          1, 1, 0, 0, SVGA3DOP_INVALID,     },
+   { "dsy",          1, 1, 0, 0, SVGA3DOP_INVALID,     },
+   { "texldd",       1, 4, 0, 0, SVGA3DOP_INVALID,     },
+   { "setp",         1, 2, 0, 0, SVGA3DOP_SETP,        },
+   { "texldl",       1, 2, 0, 0, SVGA3DOP_INVALID,     },
+   { "breakp",       0, 1, 0, 0, SVGA3DOP_INVALID,     },
 };
 
 const struct sh_opcode_info *svga_opcode_info( uint op )
index e558de02c53e2e4e20db56bd790022bc22e46510..a5ccae5ae58364d98c2c583e26454e8fdd8c4c8f 100644 (file)
@@ -38,6 +38,8 @@ struct sh_opcode_info
    const char *mnemonic;
    unsigned num_dst:8;
    unsigned num_src:8;
+   unsigned pre_dedent:1;
+   unsigned post_indent:1;
    unsigned svga_opcode:16;
 };
 
index 691b83c63fb4ad4e14789559565d123e859c6c72..a43adac694089f4851819798b303b8e27c554d3f 100644 (file)
@@ -32,7 +32,7 @@
 #include "util/u_memory.h"
 #include "util/u_simple_list.h"
 #include "util/u_network.h"
-#include "util/u_time.h"
+#include "os/os_time.h"
 
 #include "tgsi/tgsi_parse.h"
 
@@ -798,7 +798,7 @@ PIPE_THREAD_ROUTINE(trace_rbug_thread, void_tr_rbug)
    debug_printf("trace_rbug - remote debugging listening on port %u\n", --port);
 
    while(tr_rbug->running) {
-      util_time_sleep(1);
+      os_time_sleep(1);
 
       c = u_socket_accept(s);
       if (c < 0)
index f7ed6605bf8c2308ec58d35c43ae0f7df1e3c854..ff21f2f9580ff59bc30dd5431504a40b5d389d5f 100644 (file)
@@ -268,7 +268,7 @@ void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
 void dri2_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
                          __DRIdrawable *dPriv)
 {
-   dri2_set_tex_buffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
+   dri2_set_tex_buffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
 }
 
 void
index 2052867309c89703aac4ed5f3d7ceafabf39d1d9..4064976b2345ecf9af55d34c682cb9cab144052f 100644 (file)
@@ -157,7 +157,8 @@ dri_fill_in_modes(struct dri_screen *screen,
                                 depth_bits_array, stencil_bits_array,
                                 depth_buffer_factor, back_buffer_modes,
                                 back_buffer_factor,
-                                msaa_samples_array, msaa_samples_factor);
+                                msaa_samples_array, msaa_samples_factor,
+                                GL_TRUE);
    } else {
       __DRIconfig **configs_a8r8g8b8 = NULL;
       __DRIconfig **configs_x8r8g8b8 = NULL;
@@ -170,7 +171,8 @@ dri_fill_in_modes(struct dri_screen *screen,
                                             back_buffer_modes,
                                             back_buffer_factor,
                                             msaa_samples_array,
-                                             msaa_samples_factor);
+                                             msaa_samples_factor,
+                                            GL_TRUE);
       if (pf_x8r8g8b8)
         configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV,
                                             depth_bits_array,
@@ -179,7 +181,8 @@ dri_fill_in_modes(struct dri_screen *screen,
                                             back_buffer_modes,
                                             back_buffer_factor,
                                             msaa_samples_array,
-                                             msaa_samples_factor);
+                                             msaa_samples_factor,
+                                            GL_TRUE);
 
       if (configs_a8r8g8b8 && configs_x8r8g8b8)
         configs = driConcatConfigs(configs_x8r8g8b8, configs_a8r8g8b8);
index 0785d2c6b859f2436e52bb726ed9c8bac5d06b2b..c2f9c7550ed6434cb6ea7bf88bf44c55560bff80 100644 (file)
@@ -75,6 +75,9 @@ DrvCopyContext(
    struct stw_context *dst;
    BOOL ret = FALSE;
 
+   if (!stw_dev)
+      return FALSE;
+
    pipe_mutex_lock( stw_dev->ctx_mutex );
    
    src = stw_lookup_context_locked( dhrcSource );
@@ -102,6 +105,9 @@ DrvShareLists(
    struct stw_context *ctx2;
    BOOL ret = FALSE;
 
+   if (!stw_dev)
+      return FALSE;
+
    pipe_mutex_lock( stw_dev->ctx_mutex );
    
    ctx1 = stw_lookup_context_locked( dhglrc1 );
index 7785aba46775b9c910503dc4ac8dd64f01dd84d3..ce6fe5f4ef519e6d40dd188f1714184c802f5657 100644 (file)
@@ -152,24 +152,26 @@ stw_cleanup_thread(void)
 void
 stw_cleanup(void)
 {
-   unsigned i;
+   DHGLRC dhglrc;
 
    debug_printf("%s\n", __FUNCTION__);
 
    if (!stw_dev)
       return;
    
+   /*
+    * Abort cleanup if there are still active contexts. In some situations
+    * this DLL may be unloaded before the DLL that is using GL contexts is.
+    */
    pipe_mutex_lock( stw_dev->ctx_mutex );
-   {
-      /* Ensure all contexts are destroyed */
-      i = handle_table_get_first_handle(stw_dev->ctx_table);
-      while (i) {
-         DrvDeleteContext(i);
-         i = handle_table_get_next_handle(stw_dev->ctx_table, i);
-      }
-      handle_table_destroy(stw_dev->ctx_table);
-   }
+   dhglrc = handle_table_get_first_handle(stw_dev->ctx_table);
    pipe_mutex_unlock( stw_dev->ctx_mutex );
+   if (dhglrc) {
+      debug_printf("%s: contexts still active -- cleanup aborted\n", __FUNCTION__);
+      return;
+   }
+
+   handle_table_destroy(stw_dev->ctx_table);
 
    stw_framebuffer_cleanup();
    
index 129a6298a7771a97b4086faf09740f007731ea1a..02de21ccb2b323be513b8b3ae7118e4f5f1c3a58 100644 (file)
@@ -179,7 +179,7 @@ stw_call_window_proc(
    if(!tls_data)
       return 0;
    
-   if (nCode < 0)
+   if (nCode < 0 || !stw_dev)
        return CallNextHookEx(tls_data->hCallWndProcHook, nCode, wParam, lParam);
 
    if (pParams->message == WM_WINDOWPOSCHANGED) {
@@ -332,6 +332,9 @@ stw_framebuffer_cleanup( void )
    struct stw_framebuffer *fb;
    struct stw_framebuffer *next;
 
+   if (!stw_dev)
+      return;
+
    pipe_mutex_lock( stw_dev->fb_mutex );
 
    fb = stw_dev->fb_head;
@@ -387,6 +390,9 @@ stw_framebuffer_from_hdc(
 {
    struct stw_framebuffer *fb;
 
+   if (!stw_dev)
+      return NULL;
+
    pipe_mutex_lock( stw_dev->fb_mutex );
    fb = stw_framebuffer_from_hdc_locked(hdc);
    pipe_mutex_unlock( stw_dev->fb_mutex );
@@ -421,6 +427,9 @@ DrvSetPixelFormat(
    uint index;
    struct stw_framebuffer *fb;
 
+   if (!stw_dev)
+      return FALSE;
+
    index = (uint) iPixelFormat - 1;
    count = stw_pixelformat_get_extended_count();
    if (index >= count)
@@ -475,6 +484,9 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
    struct pipe_screen *screen;
    struct pipe_surface *surface;
 
+   if (!stw_dev)
+      return FALSE;
+
    fb = stw_framebuffer_from_hdc( hdc );
    if (fb == NULL)
       return FALSE;
@@ -576,6 +588,9 @@ DrvSwapBuffers(
    struct stw_framebuffer *fb;
    struct pipe_surface *surface = NULL;
 
+   if (!stw_dev)
+      return FALSE;
+
    fb = stw_framebuffer_from_hdc( hdc );
    if (fb == NULL)
       return FALSE;
index 8875dc22f3dc3e6f302225ceeafd5da9a66b5f63..d43a55fa9e603ed45859eab9dc5943a0bb88a05c 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "glapi/glapi.h"
 #include "stw_ext_gallium.h"
+#include "stw_device.h"
+#include "stw_icd.h"
 
 struct stw_extension_entry
 {
@@ -73,6 +75,9 @@ DrvGetProcAddress(
 {
    const struct stw_extension_entry *entry;
 
+   if (!stw_dev)
+      return NULL;
+
    if (lpszProc[0] == 'w' && lpszProc[1] == 'g' && lpszProc[2] == 'l')
       for (entry = stw_extension_entries; entry->name; entry++)
          if (strcmp( lpszProc, entry->name ) == 0)
index 7d4c2430b0cf617a64fe8c5e0bec6b7f4a67b5b4..b750b03695fc03f5dec7afa03702a6ac09807fed 100644 (file)
@@ -302,6 +302,9 @@ DrvDescribePixelFormat(
 
    (void) hdc;
 
+   if (!stw_dev)
+      return 0;
+
    count = stw_pixelformat_get_extended_count();
    index = (uint) iPixelFormat - 1;
 
index 3dcef22c132078578012593ad570b44d1392a508..e37a1c3959647ef3d6df7f8221ba15ad17ce872e 100644 (file)
@@ -388,6 +388,9 @@ draw_yuv(struct xorg_xv_port_priv *port,
 {
    struct pipe_texture **textures = port->yuv[port->current_set];
 
+   /*debug_printf("  draw_yuv([%d, %d, %d ,%d], [%d, %d, %d, %d])\n",
+                src_x, src_y, src_w, src_h,
+                dst_x, dst_y, dst_w, dst_h);*/
    renderer_draw_yuv(port->r,
                      src_x, src_y, src_w, src_h,
                      dst_x, dst_y, dst_w, dst_h,
@@ -489,6 +492,9 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
    exaMoveInPixmap(pPixmap);
    dst = exaGetPixmapDriverPrivate(pPixmap);
 
+   /*debug_printf("display_video([%d, %d, %d, %d], [%d, %d, %d, %d])\n",
+     src_x, src_y, src_w, src_h, dstX, dstY, dst_w, dst_h);*/
+
    if (dst && !dst->tex) {
        xorg_exa_set_shared_usage(pPixmap);
        pScrn->pScreen->ModifyPixmapHeader(pPixmap, 0, 0, 0, 0, 0, NULL);
@@ -539,8 +545,9 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
       offset_w = dst_w - w;
       offset_h = dst_h - h;
 
-      draw_yuv(pPriv, src_x + offset_x*diff_x, src_y + offset_y*diff_y,
-               src_w - offset_w*diff_x, src_h - offset_h*diff_x,
+      draw_yuv(pPriv,
+               src_x + offset_x*diff_x, src_y + offset_y*diff_y,
+               src_w - offset_w*diff_x, src_h - offset_h*diff_y,
                x, y, w, h);
 
       pbox++;
index 104e987083f4b290850a31652c8f494f6afbed4d..0df841d879866304144a67bcc0108f9407ce7a04 100644 (file)
@@ -4,17 +4,18 @@ env = drienv.Clone()
 
 env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
 
-drivers = [
+env.Prepend(LIBS = [
     st_dri,
     inteldrm,
-    softpipe,
     i915,
     trace,
-]
+    mesa,
+    glsl,
+    gallium
+])
 
 env.LoadableModule(
     target ='i915_dri.so',
     source = COMMON_GALLIUM_SOURCES,
-    LIBS = drivers + mesa + gallium + env['LIBS'],
     SHLIBPREFIX = '',
 )
index 03dbd76c37554093ee58be8657e95f9e600803f2..e9e5990cf53905c97e83ba1a49296cd7a1e81815 100644 (file)
@@ -251,13 +251,13 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
 {
    switch (fdwReason) {
    case DLL_PROCESS_ATTACH:
-      if (!stw_init(&stw_winsys)) {
-         return FALSE;
-      }
-      return stw_init_thread();
+      stw_init(&stw_winsys);
+      stw_init_thread();
+      break;
 
    case DLL_THREAD_ATTACH:
-      return stw_init_thread();
+      stw_init_thread();
+      break;
 
    case DLL_THREAD_DETACH:
       stw_cleanup_thread();
index 2078020f8f7d1ef3cdc19ba31a70ce536b847c6c..71360e55aac78a2dbc3315520d7bf156084fff3b 100644 (file)
@@ -297,13 +297,13 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
 {
    switch (fdwReason) {
    case DLL_PROCESS_ATTACH:
-      if (!stw_init(&stw_winsys)) {
-         return FALSE;
-      }
-      return stw_init_thread();
+      stw_init(&stw_winsys);
+      stw_init_thread();
+      break;
 
    case DLL_THREAD_ATTACH:
-      return stw_init_thread();
+      stw_init_thread();
+      break;
 
    case DLL_THREAD_DETACH:
       stw_cleanup_thread();
index c9a830b9f3ce6f2b8b0d6c7c1b527d58c5fb0b64..3b3c083c2e131e651c6fae91e570b055f591fc79 100644 (file)
@@ -134,8 +134,8 @@ main(int argc,
       return 0;
    }
 
-   if (sl_pp_context_add_extension(context, "ARB_draw_buffers", "GL_ARB_draw_buffers") ||
-       sl_pp_context_add_extension(context, "ARB_texture_rectangle", "GL_ARB_texture_rectangle")) {
+   if (sl_pp_context_add_extension(context, "GL_ARB_draw_buffers") ||
+       sl_pp_context_add_extension(context, "GL_ARB_texture_rectangle")) {
       fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context));
 
       printf("Error: %s\n", sl_pp_context_error_message(context));
index 569890210f2172271b015b1d5ae8c56f78df5d47..2d2ab911ac4da16ac1d967bdd595aa1cf298483d 100644 (file)
@@ -106,8 +106,8 @@ main(int argc,
       return -1;
    }
 
-   if (sl_pp_context_add_extension(context, "ARB_draw_buffers", "GL_ARB_draw_buffers") ||
-       sl_pp_context_add_extension(context, "ARB_texture_rectangle", "GL_ARB_texture_rectangle")) {
+   if (sl_pp_context_add_extension(context, "GL_ARB_draw_buffers") ||
+       sl_pp_context_add_extension(context, "GL_ARB_texture_rectangle")) {
       fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context));
 
       printf("Error: %s\n", sl_pp_context_error_message(context));
index 3eada380cd1f5d14fbd2107b4ff0c3cb961da4ac..983a09c02af6127dbf78cae5cff5bd45113333e7 100644 (file)
@@ -44,8 +44,8 @@
 #define SL_PP_MAX_PREDEFINED  16
 
 struct sl_pp_extension {
-   int name;         /*< VENDOR_extension_name */
-   int name_string;  /*< GL_VENDOR_extension_name */
+   int name;   /*< GL_VENDOR_extension_name */
+   int enabled;
 };
 
 struct sl_pp_predefined {
index 8af5731e84076f5fb51aec0fe0fbf2976610968f..777e42d0fc97fb6ded96ed4818c6827684831ed3 100644 (file)
 #include "sl_pp_public.h"
 
 
+/**
+ * Declare an extension to the preprocessor.  This tells the preprocessor
+ * which extensions are supported by Mesa.
+ * The shader still needs to have a "#extension name: behavior" line to enable
+ * the extension.
+ */
 int
 sl_pp_context_add_extension(struct sl_pp_context *context,
-                            const char *name,
-                            const char *name_string)
+                            const char *name)
 {
    struct sl_pp_extension ext;
 
@@ -48,15 +53,18 @@ sl_pp_context_add_extension(struct sl_pp_context *context,
       return -1;
    }
 
-   ext.name_string = sl_pp_context_add_unique_str(context, name_string);
-   if (ext.name_string == -1) {
-      return -1;
-   }
+   ext.enabled = 0;
 
    context->extensions[context->num_extensions++] = ext;
+
+   assert(context->num_extensions <= sizeof(context->extensions));
+
    return 0;
 }
 
+/**
+ * Process a "#extension name: behavior" directive.
+ */
 int
 sl_pp_process_extension(struct sl_pp_context *context,
                         const struct sl_pp_token_info *input,
@@ -67,6 +75,7 @@ sl_pp_process_extension(struct sl_pp_context *context,
    int extension_name = -1;
    int behavior = -1;
    struct sl_pp_token_info out;
+   struct sl_pp_extension *extension = NULL;
 
    /* Grab the extension name. */
    if (first < last && input[first].token == SL_PP_IDENTIFIER) {
@@ -86,8 +95,9 @@ sl_pp_process_extension(struct sl_pp_context *context,
 
       out.data.extension = -1;
       for (i = 0; i < context->num_extensions; i++) {
-         if (extension_name == context->extensions[i].name_string) {
+         if (extension_name == context->extensions[i].name) {
             out.data.extension = extension_name;
+            extension = &context->extensions[i];
             break;
          }
       }
@@ -127,6 +137,7 @@ sl_pp_process_extension(struct sl_pp_context *context,
          return -1;
       }
       out.token = SL_PP_EXTENSION_REQUIRE;
+      extension->enabled = 1;
    } else if (behavior == context->dict.enable) {
       if (out.data.extension == -1) {
          /* Warning: the extension cannot be enabled. */
@@ -137,18 +148,21 @@ sl_pp_process_extension(struct sl_pp_context *context,
          return -1;
       }
       out.token = SL_PP_EXTENSION_ENABLE;
+      extension->enabled = 1;
    } else if (behavior == context->dict.warn) {
       if (out.data.extension == -1) {
          /* Warning: the extension is not supported. */
          return 0;
       }
       out.token = SL_PP_EXTENSION_WARN;
+      extension->enabled = 0;
    } else if (behavior == context->dict.disable) {
       if (out.data.extension == -1) {
          /* Warning: the extension is not supported. */
          return 0;
       }
       out.token = SL_PP_EXTENSION_DISABLE;
+      extension->enabled = 0;
    } else {
       strcpy(context->error_msg, "unrecognised behavior name");
       return -1;
index f12f0f142c6d01a123e66c78271b225324703bae..272c3a23ccee2beb792e3c505e4e67cfa953b9e9 100644 (file)
 #include "sl_pp_process.h"
 
 
+static int
+_macro_is_defined(struct sl_pp_context *context,
+                  int macro_name)
+{
+   unsigned int i;
+   struct sl_pp_macro *macro;
+
+   for (i = 0; i < context->num_extensions; i++) {
+      if (macro_name == context->extensions[i].name) {
+         return context->extensions[i].enabled;
+      }
+   }
+
+   for (macro = context->macro; macro; macro = macro->next) {
+      if (macro_name == macro->name) {
+         return 1;
+      }
+   }
+
+   return 0;
+}
+
 static int
 _parse_defined(struct sl_pp_context *context,
                struct sl_pp_token_buffer *buffer,
@@ -38,9 +60,7 @@ _parse_defined(struct sl_pp_context *context,
 {
    struct sl_pp_token_info input;
    int parens = 0;
-   int macro_name;
-   struct sl_pp_macro *macro;
-   int defined = 0;
+   int defined;
    struct sl_pp_token_info result;
 
    if (sl_pp_token_buffer_skip_white(buffer, &input)) {
@@ -59,13 +79,7 @@ _parse_defined(struct sl_pp_context *context,
       return -1;
    }
 
-   macro_name = input.data.identifier;
-   for (macro = context->macro; macro; macro = macro->next) {
-      if (macro->name == macro_name) {
-         defined = 1;
-         break;
-      }
-   }
+   defined = _macro_is_defined(context, input.data.identifier);
 
    if (parens) {
       if (sl_pp_token_buffer_skip_white(buffer, &input)) {
@@ -218,22 +232,9 @@ sl_pp_process_ifdef(struct sl_pp_context *context,
    for (i = first; i < last; i++) {
       switch (input[i].token) {
       case SL_PP_IDENTIFIER:
-         {
-            struct sl_pp_macro *macro;
-            int macro_name = input[i].data.identifier;
-            int defined = 0;
-
-            for (macro = context->macro; macro; macro = macro->next) {
-               if (macro->name == macro_name) {
-                  defined = 1;
-                  break;
-               }
-            }
-
-            context->if_ptr--;
-            context->if_stack[context->if_ptr] = defined ? 1 : 0;
-            context->if_value = _evaluate_if_stack(context);
-         }
+         context->if_ptr--;
+         context->if_stack[context->if_ptr] = _macro_is_defined(context, input[i].data.identifier);
+         context->if_value = _evaluate_if_stack(context);
          return 0;
 
       case SL_PP_WHITESPACE:
@@ -265,22 +266,9 @@ sl_pp_process_ifndef(struct sl_pp_context *context,
    for (i = first; i < last; i++) {
       switch (input[i].token) {
       case SL_PP_IDENTIFIER:
-         {
-            struct sl_pp_macro *macro;
-            int macro_name = input[i].data.identifier;
-            int defined = 0;
-
-            for (macro = context->macro; macro; macro = macro->next) {
-               if (macro->name == macro_name) {
-                  defined = 1;
-                  break;
-               }
-            }
-
-            context->if_ptr--;
-            context->if_stack[context->if_ptr] = defined ? 0 : 1;
-            context->if_value = _evaluate_if_stack(context);
-         }
+         context->if_ptr--;
+         context->if_stack[context->if_ptr] = !_macro_is_defined(context, input[i].data.identifier);
+         context->if_value = _evaluate_if_stack(context);
          return 0;
 
       case SL_PP_WHITESPACE:
index 12528d6f8d13ada05caa885e6e87d399bd9b3983..ca6f722543dbfa1ea50b5d1a1b2806883bce4977 100644 (file)
@@ -53,8 +53,7 @@ sl_pp_context_error_position(const struct sl_pp_context *context,
 
 int
 sl_pp_context_add_extension(struct sl_pp_context *context,
-                            const char *name,
-                            const char *name_string);
+                            const char *name);
 
 int
 sl_pp_context_add_predefined(struct sl_pp_context *context,
index e986019c3a7265085107c68b9a26f748d5b26596..ca397f3b1fdea7214c366978e31ce20202f6e3cb 100644 (file)
@@ -108,6 +108,9 @@ public:
 inline
 Arc::Arc( Arc *j, PwlArc *p )
 {
+    prev = NULL;
+    next = NULL;
+    link = NULL;
     bezierArc = NULL;
     pwlArc = p;
     type = j->type;
@@ -123,6 +126,9 @@ Arc::Arc( Arc *j, PwlArc *p )
 inline
 Arc::Arc( arc_side side, long _nuid )
 {
+    prev = NULL;
+    next = NULL;
+    link = NULL;
     bezierArc = NULL;
     pwlArc = NULL;
     type = 0;
index 54b406147be43444cdb215995ae2192f96207f61..ff75b86bedcaeab70e5ee1130cd32386ec904834 100644 (file)
@@ -49,6 +49,7 @@
 Bin::Bin()
 {
     head = NULL;
+    current = NULL;
 }
 
 Bin::~Bin()
index f0e2364373701898b2da7845c820469a27ceaf09..4b3329c0f27cc799594a6a6a572af36f89bd7406 100644 (file)
@@ -47,6 +47,7 @@ Uarray::Uarray( void )
 {
     uarray = 0;
     size = 0;
+    ulines = 0;
 }
 
 Uarray::~Uarray( void )
index 26d05342f97dafa0a010765ca293b778bf544dba..dfdbd4e84480249ed9789645158ebfbf942dadf3 100644 (file)
@@ -156,6 +156,8 @@ primStream::primStream(Int sizeLengths, Int sizeVertices)
   index_vertices = 0;
   size_lengths = sizeLengths;
   size_vertices = sizeVertices; 
+
+  counter = 0; 
 }
 
 primStream::~primStream()
index 81d026a697cf5402d7e05533717be9adbd37d076..833f9ad232ad5e9ac47d8b03296cd5c31529d406 100644 (file)
@@ -424,7 +424,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
                 const uint8_t * depth_bits, const uint8_t * stencil_bits,
                 unsigned num_depth_stencil_bits,
                 const GLenum * db_modes, unsigned num_db_modes,
-                const uint8_t * msaa_samples, unsigned num_msaa_modes)
+                const uint8_t * msaa_samples, unsigned num_msaa_modes,
+                GLboolean enable_accum)
 {
    static const uint8_t bits_table[4][4] = {
      /* R  G  B  A */
@@ -486,7 +487,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
    __GLcontextModes *modes;
    unsigned i, j, k, h;
    unsigned num_modes;
-   unsigned num_accum_bits = 2;
+   unsigned num_accum_bits = (enable_accum) ? 2 : 1;
 
    switch ( fb_type ) {
       case GL_UNSIGNED_BYTE_3_3_2:
index 2aa6de66c183b317fc29e9bd359adc1688a376fc..02ca3feb739e5cd5f0ee4e086336db0998a2463f 100644 (file)
@@ -104,7 +104,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
                 const uint8_t * depth_bits, const uint8_t * stencil_bits,
                 unsigned num_depth_stencil_bits,
                 const GLenum * db_modes, unsigned num_db_modes,
-                const uint8_t * msaa_samples, unsigned num_msaa_modes);
+                const uint8_t * msaa_samples, unsigned num_msaa_modes,
+                GLboolean enable_accum);
 
 __DRIconfig **driConcatConfigs(__DRIconfig **a,
                               __DRIconfig **b);
index 6a84651479519751b96e0f019ea82a51932e98cb..bd1044a2bff8a361188811b3af08e98361a6af36 100644 (file)
@@ -658,7 +658,7 @@ ffbFillInModes( __DRIscreen *psp,
                              depth_bits_array, stencil_bits_array,
                              depth_buffer_factor, back_buffer_modes,
                              back_buffer_factor,
-                               msaa_samples_array, 1);
+                             msaa_samples_array, 1, GL_TRUE);
    if (configs == NULL) {
       fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
               __LINE__);
index 476c8013580b451e3f8969a942f8aaf64c4446ee..1c4deef319f1c487d7bee1877a3447f8ef0ea214 100644 (file)
@@ -92,7 +92,7 @@ i810FillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor,
                               back_buffer_modes, back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, GL_TRUE);
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
                 __func__, __LINE__ );
index 0adee6131ed143353c9ebc2afd60c5cccacbae37..e9315a50fe75b469a1b74737b6b2311a10b94a66 100644 (file)
@@ -581,7 +581,7 @@ intelInitContext(struct intel_context *intel,
    GLcontext *ctx = &intel->ctx;
    GLcontext *shareCtx = (GLcontext *) sharedContextPrivate;
    __DRIscreen *sPriv = driContextPriv->driScreenPriv;
-   intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+   struct intel_screen *intelScreen = sPriv->private;
    int bo_reuse_mode;
 
    if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx,
@@ -718,11 +718,6 @@ intelInitContext(struct intel_context *intel,
 
    intel->RenderIndex = ~0;
 
-   if (intel->gen >= 4 && !intel->intelScreen->irq_active) {
-      _mesa_printf("IRQs not active.  Exiting\n");
-      exit(1);
-   }
-
    intelInitExtensions(ctx);
 
    INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
index 36abef470a0c3cbda6b287a0002d315ce1012c38..0f0a194b3f5481270fb1f76b338badc11d90a57f 100644 (file)
@@ -246,7 +246,7 @@ struct intel_context
    __DRIdrawable *driDrawable;
    __DRIdrawable *driReadDrawable;
    __DRIscreen *driScreen;
-   intelScreenPrivate *intelScreen;
+   struct intel_screen *intelScreen;
 
    /**
     * Configuration cache
index 301c3df17cf10d17a776a96daaf72da0b6964840..e2859e44f95c63902eddefd15157969c4c3c974e 100644 (file)
@@ -287,11 +287,6 @@ intel_region_release(struct intel_region **region_handle)
       region->pbo = NULL;
       dri_bo_unreference(region->buffer);
 
-      if (region->classic_map != NULL) {
-        drmUnmap(region->classic_map,
-                       region->pitch * region->cpp * region->height);
-      }
-
       free(region);
    }
    *region_handle = NULL;
index 535fcd7be0b2041bd5ac4a8d21f29b659765b300..860ae11bd2321d1e7cbe02d20719ff9687be0c3a 100644 (file)
@@ -52,7 +52,7 @@ struct intel_buffer_object;
  */
 struct intel_region
 {
-   dri_bo *buffer;  /**< buffer manager's buffer */
+   drm_intel_bo *buffer;  /**< buffer manager's buffer */
    GLuint refcount; /**< Reference count for region */
    GLuint cpp;      /**< bytes per pixel */
    GLuint width;    /**< in pixels */
@@ -66,7 +66,6 @@ struct intel_region
 
    uint32_t tiling; /**< Which tiling mode the region is in */
    uint32_t bit_6_swizzle; /**< GEM flag for address swizzling requirement */
-   drmAddress classic_map; /**< drmMap of the region when not in GEM mode */
    struct intel_buffer_object *pbo;     /* zero-copy uploads */
 };
 
index c9ef1647a322822357a549727ab742b5c218d628..6dc20d0fefe6e9dd04975946af69ade44d4888f7 100644 (file)
@@ -169,7 +169,7 @@ intel_get_param(__DRIscreen *psp, int param, int *value)
 static void
 intelDestroyScreen(__DRIscreen * sPriv)
 {
-   intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+   struct intel_screen *intelScreen = sPriv->private;
 
    dri_bufmgr_destroy(intelScreen->bufmgr);
    driDestroyOptionInfo(&intelScreen->optionCache);
@@ -283,7 +283,7 @@ intelCreateContext(const __GLcontextModes * mesaVis,
                    void *sharedContextPrivate)
 {
    __DRIscreen *sPriv = driContextPriv->driScreenPriv;
-   intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+   struct intel_screen *intelScreen = sPriv->private;
 
 #ifdef I915
    if (IS_9XX(intelScreen->deviceID)) {
@@ -304,7 +304,7 @@ intelCreateContext(const __GLcontextModes * mesaVis,
 }
 
 static GLboolean
-intel_init_bufmgr(intelScreenPrivate *intelScreen)
+intel_init_bufmgr(struct intel_screen *intelScreen)
 {
    __DRIscreen *spriv = intelScreen->driScrnPriv;
    int num_fences = 0;
@@ -336,20 +336,19 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen)
 static const
 __DRIconfig **intelInitScreen2(__DRIscreen *psp)
 {
-   intelScreenPrivate *intelScreen;
+   struct intel_screen *intelScreen;
    GLenum fb_format[3];
    GLenum fb_type[3];
 
    static const GLenum back_buffer_modes[] = {
-       GLX_NONE, GLX_SWAP_UNDEFINED_OML,
-       GLX_SWAP_EXCHANGE_OML, GLX_SWAP_COPY_OML
+       GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
    };
    uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
    int color;
    __DRIconfig **configs = NULL;
 
    /* Allocate the private area */
-   intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate));
+   intelScreen = CALLOC(sizeof *intelScreen);
    if (!intelScreen) {
       fprintf(stderr, "\nERROR!  Allocating private area failed\n");
       return GL_FALSE;
@@ -361,8 +360,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
    intelScreen->driScrnPriv = psp;
    psp->private = (void *) intelScreen;
 
-   intelScreen->drmMinor = psp->drm_version.minor;
-
    /* Determine chipset ID */
    if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID,
                        &intelScreen->deviceID))
@@ -371,18 +368,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
    if (!intel_init_bufmgr(intelScreen))
        return GL_FALSE;
 
-   intelScreen->irq_active = 1;
    psp->extensions = intelScreenExtensions;
 
-   depth_bits[0] = 0;
-   stencil_bits[0] = 0;
-   depth_bits[1] = 16;
-   stencil_bits[1] = 0;
-   depth_bits[2] = 24;
-   stencil_bits[2] = 0;
-   depth_bits[3] = 24;
-   stencil_bits[3] = 8;
-
    msaa_samples_array[0] = 0;
 
    fb_format[0] = GL_RGB;
@@ -397,27 +384,27 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
    depth_bits[0] = 0;
    stencil_bits[0] = 0;
 
+   /* Generate a rich set of useful configs that do not include an
+    * accumulation buffer.
+    */
    for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
       __DRIconfig **new_configs;
       int depth_factor;
 
-      /* With DRI2 right now, GetBuffers always returns a depth/stencil buffer
-       * with the same cpp as the drawable.  So we can't support depth cpp !=
-       * color cpp currently.
+      /* Starting with DRI2 protocol version 1.1 we can request a depth/stencil
+       * buffer that has a diffferent number of bits per pixel than the color
+       * buffer.  This isn't yet supported here.
        */
       if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) {
         depth_bits[1] = 16;
         stencil_bits[1] = 0;
-
-        depth_factor = 2;
       } else {
         depth_bits[1] = 24;
-        stencil_bits[1] = 0;
-        depth_bits[2] = 24;
-        stencil_bits[2] = 8;
-
-        depth_factor = 3;
+        stencil_bits[1] = 8;
       }
+
+      depth_factor = 2;
+
       new_configs = driCreateConfigs(fb_format[color], fb_type[color],
                                     depth_bits,
                                     stencil_bits,
@@ -425,7 +412,33 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
                                     back_buffer_modes,
                                     ARRAY_SIZE(back_buffer_modes),
                                     msaa_samples_array,
-                                    ARRAY_SIZE(msaa_samples_array));
+                                    ARRAY_SIZE(msaa_samples_array),
+                                    GL_FALSE);
+      if (configs == NULL)
+        configs = new_configs;
+      else
+        configs = driConcatConfigs(configs, new_configs);
+   }
+
+   /* Generate the minimum possible set of configs that include an
+    * accumulation buffer.
+    */
+   for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
+      __DRIconfig **new_configs;
+
+      if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) {
+        depth_bits[0] = 16;
+        stencil_bits[0] = 0;
+      } else {
+        depth_bits[0] = 24;
+        stencil_bits[0] = 8;
+      }
+
+      new_configs = driCreateConfigs(fb_format[color], fb_type[color],
+                                    depth_bits, stencil_bits, 1,
+                                    back_buffer_modes + 1, 1,
+                                    msaa_samples_array, 1,
+                                    GL_TRUE);
       if (configs == NULL)
         configs = new_configs;
       else
index e87e306d86b361a9a9118e46b703562a60b30635..c31b83655251dd7e6427ed6b75f93b25a514ca0c 100644 (file)
 #include "i915_drm.h"
 #include "xmlconfig.h"
 
-/* XXX: change name or eliminate to avoid conflict with "struct
- * intel_region"!!!
- */
-typedef struct
+struct intel_screen
 {
-   drm_handle_t handle;
-   drmSize size;                /* region size in bytes */
-   char *map;                   /* memory map */
-   int offset;                  /* from start of video mem, in bytes */
-   unsigned int bo_handle;     /* buffer object id if available, or -1 */
-   /**
-    * Flags if the region is tiled.
-    *
-    * Not included is Y versus X tiling.
-    */
-   GLboolean tiled;
-} intelRegion;
-
-typedef struct
-{
-   intelRegion front;
-   intelRegion back;
-   intelRegion depth;
-   intelRegion tex;
-
    int deviceID;
-   int width;
-   int height;
-   int pitch;                   /* common row stride, in pixels */
 
    int logTextureGranularity;
 
    __DRIscreen *driScrnPriv;
 
-   volatile drm_i915_sarea_t *sarea;
-
-   int drmMinor;
-
-   int irq_active;
-
    GLboolean no_hw;
 
    GLboolean no_vbo;
@@ -84,14 +52,10 @@ typedef struct
    * Configuration cache with default values for all contexts
    */
    driOptionCache optionCache;
-} intelScreenPrivate;
-
-
+};
 
 extern GLboolean intelMapScreenRegions(__DRIscreen * sPriv);
 
-extern void intelUnmapScreenRegions(intelScreenPrivate * intelScreen);
-
 extern void intelDestroyContext(__DRIcontext * driContextPriv);
 
 extern GLboolean intelUnbindContext(__DRIcontext * driContextPriv);
@@ -101,6 +65,4 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
                  __DRIdrawable * driDrawPriv,
                  __DRIdrawable * driReadPriv);
 
-extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen);
-
 #endif
index 6402141170d5d181d73e85989a4dfef37e37f12c..d63292edd312fdf009f4cc77fd866ea130411f18 100644 (file)
@@ -728,7 +728,7 @@ intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
 
 void
 intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
-                  GLint glx_texture_format,
+                  GLint texture_format,
                   __DRIdrawable *dPriv)
 {
    struct gl_framebuffer *fb = dPriv->driverPrivate;
@@ -758,7 +758,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    if (rb->region == NULL)
       return;
 
-   if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+   if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
       internalFormat = GL_RGB;
    else
       internalFormat = GL_RGBA;
@@ -788,7 +788,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
 
    intelImage->face = target_to_face(target);
    intelImage->level = level;
-   if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+   if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
       texImage->TexFormat = MESA_FORMAT_XRGB8888;
    else
       texImage->TexFormat = MESA_FORMAT_ARGB8888;
@@ -808,7 +808,7 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
    /* The old interface didn't have the format argument, so copy our
     * implementation's behavior at the time.
     */
-   intelSetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
+   intelSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
 }
 
 
index 5cbfb85627afbd8f4d7c431113636b0e5d61da25..4bd6dee6c0e7caaa971ac7b752e57c8fd5c73982 100644 (file)
@@ -119,7 +119,7 @@ mach64FillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
                               back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, GL_TRUE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n",
               __func__, __LINE__);
index e7813b63725025620bd5c812b035b1ef303cd706..687412bca55674938683f2fee8fa29f7e8d5887e 100644 (file)
@@ -160,7 +160,7 @@ mgaFillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor,
                               back_buffer_modes, back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, GL_TRUE);
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
                 __func__, __LINE__ );
index de6328251eab5b0d754252eaedc988f651779b51..6abab8c9656bdce4d281e313883811c152bc128b 100644 (file)
@@ -83,7 +83,8 @@ nouveau_get_configs(void)
                                          back_buffer_modes,
                                          Elements(back_buffer_modes),
                                          msaa_samples,
-                                         Elements(msaa_samples));
+                                         Elements(msaa_samples),
+                                         GL_TRUE);
                assert(config);
 
                configs = configs ? driConcatConfigs(configs, config)
index ef6b5a35c4a25d661003303a53f8ba418af9486d..2d91802823650ef972af7e1ec966aed974d7f035 100644 (file)
@@ -449,7 +449,7 @@ r128FillInModes( __DRIscreen *psp,
                                depth_bits_array, stencil_bits_array,
                                depth_buffer_factor, back_buffer_modes,
                                back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, GL_TRUE);
     if (configs == NULL) {
         fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                 __LINE__);
index 8986191c3937f7c66272e9697f8c2ecc9569e243..6ecd46ecd9e4a75dbed1561cd03cb49b0b827f3e 100644 (file)
@@ -360,6 +360,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
    ctx->Const.Max3DTextureLevels = 9;
    ctx->Const.MaxCubeTextureLevels = 12;
    ctx->Const.MaxTextureRectSize = 2048;
+   ctx->Const.MaxRenderbufferSize = 2048;
 
    ctx->Const.MaxTextureMaxAnisotropy = 16.0;
 
@@ -390,6 +391,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
    ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
 
    ctx->Const.MaxDrawBuffers = 1;
+   ctx->Const.MaxColorAttachments = 1;
 
    _mesa_set_mvp_with_dp4( ctx, GL_TRUE );
 
index e06437bd502f035ccf701b6f2c0c3028aae9eaa8..16065530093991e12c348063301ed66a2f3e24a0 100644 (file)
@@ -894,7 +894,10 @@ void r200InitState( r200ContextPtr rmesa )
       }
    }
 
-   ALLOC_STATE( stp, polygon_stipple, STP_STATE_SIZE, "STP/stp", 0 );
+   if (rmesa->radeon.radeonScreen->kernel_mm)
+          ALLOC_STATE( stp, polygon_stipple, STP_STATE_SIZE, "STP/stp", 0 );
+   else
+          ALLOC_STATE( stp, never, STP_STATE_SIZE, "STP/stp", 0 );
 
    for (i = 0; i < 6; i++)
       if (rmesa->radeon.radeonScreen->kernel_mm)
index 458de085223430a583e85a8ff2bc704336e9db8b..9ccf30c3ac91462cb11f262b80f1a8f1d66d934a 100644 (file)
@@ -764,7 +764,7 @@ void r200SetTexOffset(__DRIcontext * pDRICtx, GLint texname,
        }
 }
 
-void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_format,
+void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format,
                       __DRIdrawable *dPriv)
 {
        struct gl_texture_unit *texUnit;
@@ -781,7 +781,7 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
 
        type = GL_BGRA;
        format = GL_UNSIGNED_BYTE;
-       internalFormat = (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT ? 3 : 4);
+       internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4);
 
        radeon = pDRICtx->driverPrivate;
        rmesa = pDRICtx->driverPrivate;
@@ -832,7 +832,7 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
-               if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+               if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
                        t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
                else
                        t->pp_txformat = tx_table_le[MESA_FORMAT_ARGB8888].format;
@@ -862,7 +862,7 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
 
 void r200SetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
 {
-        r200SetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
+        r200SetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
 }
 
 
index d87acecdabed5cb9fda00cdb034272cd25859175..b0fb8e970b79cb4bd6a4014e52eac69b7758c473 100644 (file)
@@ -295,7 +295,7 @@ static char *toswiz(int swiz_val) {
   case 2: return "B";
   case 3: return "A";
   case 4: return "0";
-  case 5: return "1/2";
+  case 5: return "H";
   case 6: return "1";
   case 7: return "U";
   }
index c2eb613b23f26c92d86affa3dd0ab6875221a046..829f028950c99b191d4a46156004d6e2e49b9c84 100644 (file)
@@ -121,8 +121,19 @@ static unsigned int translate_alpha_op(struct r300_fragment_program_compiler *c,
 
 static unsigned int fix_hw_swizzle(unsigned int swz)
 {
-       if (swz == 5) swz = 6;
-       if (swz == RC_SWIZZLE_UNUSED) swz = 4;
+    switch (swz) {
+        case RC_SWIZZLE_ZERO:
+        case RC_SWIZZLE_UNUSED:
+            swz = 4;
+            break;
+        case RC_SWIZZLE_HALF:
+            swz = 5;
+            break;
+        case RC_SWIZZLE_ONE:
+            swz = 6;
+            break;
+    }
+
        return swz;
 }
 
index 7c21efb1ded2e4eb7fd44d5cfb803feb375d26c0..fe2ed22dc2419e324293f6f9fc63779c7ea57b2b 100644 (file)
@@ -345,11 +345,13 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
                ctx->Const.MaxTextureLevels = 13;
                ctx->Const.MaxCubeTextureLevels = 13;
                ctx->Const.MaxTextureRectSize = 4096;
+               ctx->Const.MaxRenderbufferSize = 4096;
        }
        else {
                ctx->Const.MaxTextureLevels = 12;
                ctx->Const.MaxCubeTextureLevels = 12;
                ctx->Const.MaxTextureRectSize = 2048;
+               ctx->Const.MaxRenderbufferSize = 2048;
        }
 
        ctx->Const.MinPointSize = 1.0;
@@ -363,6 +365,7 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
        ctx->Const.MaxLineWidthAA = R300_LINESIZE_MAX;
 
        ctx->Const.MaxDrawBuffers = 1;
+       ctx->Const.MaxColorAttachments = 1;
 
        /* currently bogus data */
        if (r300->options.hw_tcl_enabled) {
index 09e046859a47e6e2d0050e2a73d4db2637225c42..4ba6740e3d921ad7078a9b52b7ddad888fe1b9fc 100644 (file)
@@ -415,7 +415,7 @@ void r300SetTexOffset(__DRIcontext * pDRICtx, GLint texname,
        t->pp_txpitch |= pitch_val;
 }
 
-void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_format, __DRIdrawable *dPriv)
+void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format, __DRIdrawable *dPriv)
 {
        struct gl_texture_unit *texUnit;
        struct gl_texture_object *texObj;
@@ -431,7 +431,7 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
 
        type = GL_BGRA;
        format = GL_UNSIGNED_BYTE;
-       internalFormat = (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT ? 3 : 4);
+       internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4);
 
        radeon = pDRICtx->driverPrivate;
        rmesa = pDRICtx->driverPrivate;
@@ -481,7 +481,7 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
-               if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+               if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
                        t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8);
                else
                        t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8);
@@ -520,5 +520,5 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
 
 void r300SetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
 {
-        r300SetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
+        r300SetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
 }
index 5b7d7c28ec173494e8af5d6befc011dd02f92868..f575e74c3edfcc240e39716af7dfe97682d21f1a 100644 (file)
@@ -270,6 +270,8 @@ static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
        ctx->Const.MaxLineWidthAA = 0xffff / 8.0;
 
        ctx->Const.MaxDrawBuffers = 1; /* hw supports 8 */
+       ctx->Const.MaxColorAttachments = 1;
+       ctx->Const.MaxRenderbufferSize = 4096;
 
        /* 256 for reg-based consts, inline consts also supported */
        ctx->Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */
index 8228cd67c8e7ef7719779b02cc3767130f827d97..dd33ef3c6a2bd880096cfb33ee6d31d29adb07e6 100644 (file)
@@ -988,7 +988,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
 
        type = GL_BGRA;
        format = GL_UNSIGNED_BYTE;
-       internalFormat = (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT ? 3 : 4);
+       internalFormat = (glx_texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4);
 
        radeon = pDRICtx->driverPrivate;
        rmesa = pDRICtx->driverPrivate;
@@ -1037,7 +1037,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
-               if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT) {
+               if (glx_texture_format == __DRI_TEXTURE_FORMAT_RGB) {
                        SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8,
                                 SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
@@ -1116,5 +1116,5 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
 
 void r600SetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
 {
-        r600SetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
+        r600SetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
 }
index e0be74935b9c5bac70de918db9003413785cf62d..a742dbcf129c51351ad36d27951aeebc8d20a9af 100644 (file)
@@ -200,7 +200,8 @@ static void r700SetupVTXConstants(GLcontext  * ctx,
     }
     else
     {
-        nVBsize = paos->count * pStreamDesc->stride;
+        nVBsize = (paos->count - 1) * pStreamDesc->stride
+                  + pStreamDesc->size * getTypeSize(pStreamDesc->type);
     }
 
     uSQ_VTX_CONSTANT_WORD0_0 = paos->offset;
@@ -218,11 +219,11 @@ static void r700SetupVTXConstants(GLcontext  * ctx,
         SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM,
                     SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);
     }
-    //else
-    //{
-    //    SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_INT,
-       //             SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);
-    //}
+    else
+    {
+        SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_SCALED,
+                    SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);
+    }
 
     if(1 == pStreamDesc->_signed)
     {
index f31f08edf368f89aab156399b84256c96b327762..cd01c9984e31f3fcdeac1890fd7a3b2b7c4a8f37 100644 (file)
@@ -48,6 +48,9 @@ void radeon_check_front_buffer_rendering(GLcontext *ctx);
 static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb)
 {
        struct radeon_renderbuffer *rrb = (struct radeon_renderbuffer *)rb;
+       radeon_print(RADEON_MEMORY, RADEON_TRACE,
+               "%s(rb %p)\n",
+               __func__, rb);
        if (rrb && rrb->base.ClassID == RADEON_RB_CLASS)
                return rrb;
        else
@@ -56,6 +59,10 @@ static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbu
 
 static inline struct radeon_renderbuffer *radeon_get_renderbuffer(struct gl_framebuffer *fb, int att_index)
 {
+       radeon_print(RADEON_MEMORY, RADEON_TRACE,
+               "%s(fb %p, index %d)\n",
+               __func__, fb, att_index);
+
        if (att_index >= 0)
                return radeon_renderbuffer(fb->Attachment[att_index].Renderbuffer);
        else
index 475e93bc05feec3cef7c7ada8ac044e2b8b8f72d..4625af14ad8352de32d61f7c2d9d16e01b99288f 100644 (file)
@@ -317,6 +317,8 @@ r100CreateContext( const __GLcontextModes *glVisual,
    rmesa->boxes = 0;
 
    ctx->Const.MaxDrawBuffers = 1;
+   ctx->Const.MaxColorAttachments = 1;
+   ctx->Const.MaxRenderbufferSize = 2048;
 
    _mesa_set_mvp_with_dp4( ctx, GL_TRUE );
 
index e780b9eef1b4fee917312c85d6e0c71e11b61cf9..56dcc50785c94e74c21c171cd0cea2f4935206a4 100644 (file)
@@ -29,6 +29,7 @@
 #include "main/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
+#include "main/enums.h"
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
@@ -56,6 +57,10 @@ radeon_delete_renderbuffer(struct gl_renderbuffer *rb)
 {
   struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
 
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(rb %p, rrb %p) \n",
+               __func__, rb, rrb);
+
   ASSERT(rrb);
 
   if (rrb && rrb->bo) {
@@ -68,6 +73,10 @@ static void *
 radeon_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb,
                   GLint x, GLint y)
 {
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, rb %p) \n",
+               __func__, ctx, rb);
+
   return NULL;
 }
 
@@ -85,6 +94,10 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
   GLboolean software_buffer = GL_FALSE;
   int cpp;
 
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, rb %p) \n",
+               __func__, ctx, rb);
+
    ASSERT(rb->Name != 0);
   switch (internalFormat) {
    case GL_R3_G3_B2:
@@ -200,6 +213,10 @@ radeon_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
    rb->Width = width;
    rb->Height = height;
    rb->InternalFormat = internalFormat;
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, rb %p) \n",
+               __func__, ctx, rb);
+
 
    return GL_TRUE;
 }
@@ -212,6 +229,10 @@ radeon_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
      struct radeon_framebuffer *radeon_fb = (struct radeon_framebuffer*)fb;
    int i;
 
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, fb %p) \n",
+               __func__, ctx, fb);
+
    _mesa_resize_framebuffer(ctx, fb, width, height);
 
    fb->Initialized = GL_TRUE; /* XXX remove someday */
@@ -252,6 +273,11 @@ radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv)
     struct radeon_renderbuffer *rrb;
 
     rrb = CALLOC_STRUCT(radeon_renderbuffer);
+
+    radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s( rrb %p ) \n",
+               __func__, rrb);
+
     if (!rrb)
        return NULL;
 
@@ -331,6 +357,11 @@ radeon_new_renderbuffer(GLcontext * ctx, GLuint name)
   struct radeon_renderbuffer *rrb;
 
   rrb = CALLOC_STRUCT(radeon_renderbuffer);
+
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, rrb %p) \n",
+               __func__, ctx, rrb);
+
   if (!rrb)
     return NULL;
 
@@ -348,6 +379,11 @@ static void
 radeon_bind_framebuffer(GLcontext * ctx, GLenum target,
                        struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
 {
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, fb %p, target %s) \n",
+               __func__, ctx, fb,
+               _mesa_lookup_enum_by_nr(target));
+
    if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
       radeon_draw_buffer(ctx, fb);
    }
@@ -365,6 +401,10 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx,
        if (ctx->Driver.Flush)
                ctx->Driver.Flush(ctx); /* +r6/r7 */
 
+       radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, fb %p, rb %p) \n",
+               __func__, ctx, fb, rb);
+
    _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
    radeon_draw_buffer(ctx, fb);
 }
@@ -383,6 +423,10 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb,
        int retry = 0;
        gl_format texFormat;
 
+       radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, rrb %p, texImage %p) \n",
+               __func__, ctx, rrb, texImage);
+
 restart:
        if (texImage->TexFormat == _dri_texformat_argb8888) {
                rrb->base.DataType = GL_UNSIGNED_BYTE;
@@ -453,6 +497,11 @@ radeon_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage)
 
    /* make an radeon_renderbuffer to wrap the texture image */
    rrb = CALLOC_STRUCT(radeon_renderbuffer);
+
+   radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, rrb %p, texImage %p) \n",
+               __func__, ctx, rrb, texImage);
+
    if (!rrb) {
       _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture");
       return NULL;
@@ -480,6 +529,10 @@ radeon_render_texture(GLcontext * ctx,
    radeon_texture_image *radeon_image;
    GLuint imageOffset;
 
+  radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, fb %p, rrb %p, att %p)\n",
+               __func__, ctx, fb, rrb, att);
+
    (void) fb;
 
    ASSERT(newImage);
index 93b6399a669f3082683c978cb9282f4e0c802414..631f729048aabc572e859b926d08d9fb5725a4a1 100644 (file)
@@ -293,18 +293,18 @@ radeonFillInModes( __DRIscreen *psp,
                                          depth_bits_array, stencil_bits_array,
                                          depth_buffer_factor, back_buffer_modes,
                                          back_buffer_factor, msaa_samples_array,
-                                         1);
+                                         1, GL_TRUE);
        configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
                                            depth_bits_array, stencil_bits_array,
                                            1, back_buffer_modes, 1,
-                                           msaa_samples_array, 1);
+                                           msaa_samples_array, 1, GL_TRUE);
        configs = driConcatConfigs(configs_r5g6b5, configs_a8r8g8b8);
    } else
        configs = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
                                   depth_bits_array, stencil_bits_array,
                                   depth_buffer_factor,
                                   back_buffer_modes, back_buffer_factor,
-                                  msaa_samples_array, 1);
+                                  msaa_samples_array, 1, GL_TRUE);
 
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
@@ -1676,7 +1676,8 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
                                     back_buffer_modes,
                                     ARRAY_SIZE(back_buffer_modes),
                                     msaa_samples_array,
-                                    ARRAY_SIZE(msaa_samples_array));
+                                    ARRAY_SIZE(msaa_samples_array),
+                                    GL_TRUE);
       if (configs == NULL)
         configs = new_configs;
       else
index 8db3d2b143b51531acb383da9c9dd4011e8cf5a3..1adb60960337e1363e6c7bcca12df32799aa777e 100644 (file)
@@ -810,6 +810,10 @@ static void map_unmap_rb(struct gl_renderbuffer *rb, int flag)
        if (rrb == NULL || !rrb->bo)
                return;
 
+       radeon_print(RADEON_MEMORY, RADEON_TRACE,
+               "%s( rb %p, flag %s )\n",
+               __func__, rb, flag ? "true":"false");
+
        if (flag) {
                radeon_bo_wait(rrb->bo);
                r = radeon_bo_map(rrb->bo, 1);
@@ -832,6 +836,10 @@ radeon_map_unmap_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb,
 {
        GLuint i, j;
 
+       radeon_print(RADEON_MEMORY, RADEON_TRACE,
+               "%s( %p , fb %p, map %s )\n",
+               __func__, ctx, fb, map ? "true":"false");
+
        /* color draw buffers */
        for (j = 0; j < ctx->DrawBuffer->_NumColorDrawBuffers; j++)
                map_unmap_rb(fb->_ColorDrawBuffers[j], map);
index 84ddcfd4fd36c9462cc84ec887ad5510ce71ea0d..f852116deeb37f7d371eee34e26eb508366467ba 100644 (file)
@@ -639,7 +639,7 @@ void radeonSetTexOffset(__DRIcontext * pDRICtx, GLint texname,
        }
 }
 
-void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_format,
+void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format,
                         __DRIdrawable *dPriv)
 {
        struct gl_texture_unit *texUnit;
@@ -656,7 +656,7 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_
 
        type = GL_BGRA;
        format = GL_UNSIGNED_BYTE;
-       internalFormat = (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT ? 3 : 4);
+       internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4);
 
        radeon = pDRICtx->driverPrivate;
        rmesa = pDRICtx->driverPrivate;
@@ -705,7 +705,7 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_
        t->override_offset = 0;
        switch (rb->cpp) {
        case 4:
-               if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+               if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
                        t->pp_txformat = tx_table[MESA_FORMAT_RGB888].format;
                else
                        t->pp_txformat = tx_table[MESA_FORMAT_ARGB8888].format;
@@ -740,7 +740,7 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_
 
 void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
 {
-        radeonSetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
+        radeonSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
 }
 
 
index 86b213c05cb9d86574b801e3688081c1098b43a6..9b9d90bdd0238d38b5d4ecbd5b38e939063707b5 100644 (file)
@@ -129,6 +129,10 @@ static void teximage_set_map_data(radeon_texture_image *image)
  */
 void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable)
 {
+       radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+                       "%s(img %p), write_enable %s.\n",
+                       __func__, image,
+                       write_enable ? "true": "false");
        if (image->mt) {
                assert(!image->base.Data);
 
@@ -140,6 +144,9 @@ void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable)
 
 void radeon_teximage_unmap(radeon_texture_image *image)
 {
+       radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+                       "%s(img %p)\n",
+                       __func__, image);
        if (image->mt) {
                assert(image->base.Data);
 
@@ -275,6 +282,11 @@ void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_objec
        radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]);
        bo = !baseimage->mt ? baseimage->bo : baseimage->mt->bo;
 
+       radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+               "%s(%p, target %s, tex %p)\n",
+               __func__, ctx, _mesa_lookup_enum_by_nr(target),
+               texObj);
+
        if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) {
                radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
                        "%s(%p, tex %p) Trying to generate mipmap for texture "
index 8e879ca41c0c263ac1c2b37d49dc4d6127bcc3f6..74a001b78987adfc3a7dcd500e7215d2ef7e1d0e 100644 (file)
@@ -939,7 +939,7 @@ savageFillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor,
                               back_buffer_modes, back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, GL_TRUE);
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
                 __func__, __LINE__ );
index cb7ed8a08bbcff2e041e2d2697868566c0bf496f..80fb455ec757b337b47598542880be475d361654 100644 (file)
@@ -103,7 +103,7 @@ sisFillInModes(__DRIscreen *psp, int bpp)
    configs = driCreateConfigs(fb_format, fb_type, depth_bits_array,
                              stencil_bits_array, depth_buffer_factor,
                              back_buffer_modes, back_buffer_factor,
-                              msaa_samples_array, 1);
+                              msaa_samples_array, 1, GL_TRUE);
    if (configs == NULL) {
       fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
       return NULL;
index 4e823669bfcf2bb901af161e701cbeba8febc292..40535b03b954cdd57826e327bdf4f870385c7c5f 100644 (file)
@@ -132,7 +132,8 @@ swrastFillInModes(__DRIscreen *psp,
     configs = driCreateConfigs(fb_format, fb_type,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
-                              back_buffer_factor, msaa_samples_array, 1);
+                              back_buffer_factor, msaa_samples_array, 1,
+                              GL_TRUE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                __LINE__);
index 9f6b35faa28f09fa9ed397a45b1a2bbc1d45f37b..d554bcdc92cea058b23eaae0f4a15fb771dec86b 100644 (file)
@@ -383,7 +383,8 @@ tdfxFillInModes(__DRIscreen *psp,
                            stencil_bits_array,
                            deep ? 2 : 4,
                            db_modes, 2,
-                           msaa_samples_array, 1);
+                           msaa_samples_array, 1,
+                           GL_TRUE);
 }
 
 /**
index 8c91c937c686dd2cc0456bae8617f4d765f5b05f..ee10b569bf1d8407b1240b06480c727f4d238ce5 100644 (file)
@@ -354,7 +354,7 @@ viaFillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
                               back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, GL_TRUE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                __LINE__);
index 700e3334295872b5fe18eb9e0aabd80018d4b5e7..a31dc55e3fa0fca05b106d5c7ad2ff717b069b9e 100644 (file)
@@ -869,6 +869,7 @@ EXPORTS
        _mesa_add_renderbuffer
        _mesa_bzero
        _mesa_calloc
+       _mesa_check_conditional_render
        _mesa_choose_tex_format
        _mesa_create_framebuffer
        _mesa_create_visual
index 47ea23e92b50cd6c9fb0b2ff7ebf0bf19d6246ff..f802a61d3bd55d01f85d8b3da21051527183c86a 100644 (file)
@@ -46,8 +46,6 @@
 
 #define GL_GLEXT_PROTOTYPES
 
-#include "GL/gl.h"
-#include "GL/glext.h"
 #include "glthread.h"
 
 
@@ -136,7 +134,7 @@ struct _glapi_table *
 _glapi_get_override_dispatch(int layer);
 
 
-extern GLuint
+extern unsigned int
 _glapi_get_dispatch_table_size(void);
 
 
@@ -148,7 +146,7 @@ extern int
 _glapi_add_dispatch( const char * const * function_names,
                     const char * parameter_signature );
 
-extern GLint
+extern int
 _glapi_get_proc_offset(const char *funcName);
 
 
@@ -157,7 +155,7 @@ _glapi_get_proc_address(const char *funcName);
 
 
 extern const char *
-_glapi_get_proc_name(GLuint offset);
+_glapi_get_proc_name(unsigned int offset);
 
 
 #endif
index 591aa1121d129dec33e98d0956738089bd748b02..c292d1fea5e846f46cf40b4fcfcd8977a02d95c7 100644 (file)
@@ -495,12 +495,6 @@ _mesa_init_constants(GLcontext *ctx)
 {
    assert(ctx);
 
-   assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
-   assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
-
-   /* Max texture size should be <= max viewport size (render to texture) */
-   assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH);
-
    /* Constants, may be overriden (usually only reduced) by device drivers */
    ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
    ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
@@ -571,26 +565,6 @@ _mesa_init_constants(GLcontext *ctx)
 
    /* GL_EXT_provoking_vertex */
    ctx->Const.QuadsFollowProvokingVertexConvention = GL_TRUE;
-
-   /* sanity checks */
-   ASSERT(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
-                                             ctx->Const.MaxTextureCoordUnits));
-   ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
-   ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
-   ASSERT(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-   ASSERT(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-   ASSERT(MAX_COMBINED_TEXTURE_IMAGE_UNITS <= 32); /* GLbitfield size limit */
-
-   ASSERT(MAX_NV_FRAGMENT_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
-   ASSERT(MAX_NV_VERTEX_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
-   ASSERT(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX);
-   ASSERT(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX);
-
-   /* check that we don't exceed the size of various bitfields */
-   ASSERT(VERT_RESULT_MAX <=
-         (8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten)));
-   ASSERT(FRAG_ATTRIB_MAX <=
-         (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead)));
 }
 
 
@@ -601,17 +575,41 @@ _mesa_init_constants(GLcontext *ctx)
 static void
 check_context_limits(GLcontext *ctx)
 {
-   /* Many context limits/constants are limited by the size of
-    * internal arrays.
-    */
+   /* check that we don't exceed the size of various bitfields */
+   assert(VERT_RESULT_MAX <=
+         (8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten)));
+   assert(FRAG_ATTRIB_MAX <=
+         (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead)));
+
+   assert(MAX_COMBINED_TEXTURE_IMAGE_UNITS <= 8 * sizeof(GLbitfield));
+
+   /* shader-related checks */
+   assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
+   assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
+
+   assert(MAX_NV_FRAGMENT_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
+   assert(MAX_NV_VERTEX_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
+   assert(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX);
+   assert(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX);
+
+   /* Texture unit checks */
+   assert(ctx->Const.MaxTextureImageUnits > 0);
    assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
+   assert(ctx->Const.MaxTextureCoordUnits > 0);
    assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS);
+   assert(ctx->Const.MaxTextureUnits > 0);
    assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS);
    assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS);
-
+   assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
+                                             ctx->Const.MaxTextureCoordUnits));
+   assert(ctx->Const.MaxCombinedTextureImageUnits > 0);
+   assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+   assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
    /* number of coord units cannot be greater than number of image units */
    assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits);
 
+
+   /* Texture size checks */
    assert(ctx->Const.MaxTextureLevels <= MAX_TEXTURE_LEVELS);
    assert(ctx->Const.Max3DTextureLevels <= MAX_3D_TEXTURE_LEVELS);
    assert(ctx->Const.MaxCubeTextureLevels <= MAX_CUBE_TEXTURE_LEVELS);
@@ -622,6 +620,13 @@ check_context_limits(GLcontext *ctx)
    assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= MAX_WIDTH);
    assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH);
 
+   /* Texture level checks */
+   assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
+   assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
+
+   /* Max texture size should be <= max viewport size (render to texture) */
+   assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH);
+
    assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
    assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
 
index fcd0a56d76aabf45a78a28ddd0034b2d27462725..78612b0856057481dedc3da69b3926f0b7cebed4 100644 (file)
@@ -2678,7 +2678,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS)
 static GLboolean
 _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
 {
-   const GLfloat depthScale = (GLfloat) 0xffffff;
+   const GLuint depthScale = 0xffffff;
    const GLint srcRowStride
       = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)
       / sizeof(GLuint);
@@ -2752,7 +2752,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
             _mesa_unpack_depth_span(ctx, srcWidth,
                                     GL_UNSIGNED_INT_24_8_EXT, /* dst type */
                                     dstRow, /* dst addr */
-                                    (GLuint) depthScale,
+                                    depthScale,
                                     srcType, src, srcPacking);
             /* get the 8-bit stencil values */
             _mesa_unpack_stencil_span(ctx, srcWidth,
index ef131146be56ba17d7896987d6448817c48b8b76..0b25467a4e888566da7dc43687832f5df63ac6bf 100644 (file)
@@ -12,13 +12,13 @@ def glsl_compile_emitter(target, source, env):
        return (target, source)
  
 bld_frag = Builder(
-       action = glsl_compile[0].abspath + ' fragment $SOURCE $TARGET',
+       action = Action(glsl_compile[0].abspath + ' fragment $SOURCE $TARGET', '$CODEGENCODESTR'),
        emitter = glsl_compile_emitter,
        suffix = '.gc',
        src_suffix = '_gc.h')
        
 bld_vert = Builder(
-       action = glsl_compile[0].abspath + ' vertex $SOURCE $TARGET',
+       action = Action(glsl_compile[0].abspath + ' vertex $SOURCE $TARGET', '$CODEGENCODESTR'),
        emitter = glsl_compile_emitter,
        suffix = '.gc',
        src_suffix = '_gc.h')
index 63d10f45978705fafceb529c905335a242cdbcc1..852274119cfcec550646c07a7f75034a8a92f04d 100644 (file)
@@ -2608,8 +2608,8 @@ compile_with_grammar(const char *source,
       return GL_FALSE;
    }
 
-   if (sl_pp_context_add_extension(context, "ARB_draw_buffers", "GL_ARB_draw_buffers") ||
-       sl_pp_context_add_extension(context, "ARB_texture_rectangle", "GL_ARB_texture_rectangle")) {
+   if (sl_pp_context_add_extension(context, "GL_ARB_draw_buffers") ||
+       sl_pp_context_add_extension(context, "GL_ARB_texture_rectangle")) {
       slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context));
       sl_pp_context_destroy(context);
       return GL_FALSE;
index 85420a950f49da4f355b4880f52f3d21bd7e5421..25430bba77d7b3fbfa08c158814a1087ca75085f 100644 (file)
@@ -637,7 +637,7 @@ accum_bitmap(struct st_context *st,
              const GLubyte *bitmap )
 {
    struct bitmap_cache *cache = st->bitmap.cache;
-   int px = -999, py;
+   int px = -999, py = -999;
    const GLfloat z = st->ctx->Current.RasterPos[2];
 
    if (width > BITMAP_CACHE_WIDTH ||
@@ -671,6 +671,7 @@ accum_bitmap(struct st_context *st,
    }
 
    assert(px != -999);
+   assert(py != -999);
 
    if (x < cache->xmin)
       cache->xmin = x;
index 9f2fe7420d4b0168fd0a8aa01425ea14ed9a5a82..4638879fc2bdfb2916b4db9fb1a34d1aaa08c53c 100644 (file)
@@ -37,6 +37,7 @@
 #include "main/context.h"
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
+#include "main/macros.h"
 #include "main/renderbuffer.h"
 
 #include "pipe/p_context.h"
@@ -340,12 +341,17 @@ st_render_texture(GLcontext *ctx,
    struct gl_renderbuffer *rb;
    struct pipe_texture *pt = st_get_texobj_texture(att->Texture);
    struct st_texture_object *stObj;
-   const struct gl_texture_image *texImage =
-      att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+   const struct gl_texture_image *texImage;
+   GLint pt_level;
 
+   /* When would this fail?  Perhaps assert? */
    if (!pt) 
       return;
 
+   /* The first gallium texture level = Mesa BaseLevel */
+   pt_level = MAX2(0, (GLint) att->TextureLevel - att->Texture->BaseLevel);
+   texImage = att->Texture->Image[att->CubeMapFace][pt_level];
+
    /* create new renderbuffer which wraps the texture image */
    rb = st_new_renderbuffer(ctx, 0);
    if (!rb) {
@@ -365,7 +371,7 @@ st_render_texture(GLcontext *ctx,
 
    /* point renderbuffer at texobject */
    strb->rtt = stObj;
-   strb->rtt_level = att->TextureLevel;
+   strb->rtt_level = pt_level;
    strb->rtt_face = att->CubeMapFace;
    strb->rtt_slice = att->Zoffset;
 
@@ -380,6 +386,8 @@ st_render_texture(GLcontext *ctx,
 
    pipe_surface_reference(&strb->surface, NULL);
 
+   assert(strb->rtt_level <= strb->texture->last_level);
+
    /* new surface for rendering into the texture */
    strb->surface = screen->get_tex_surface(screen,
                                            strb->texture,
index 8484aab5a93fd7f86f7438e54c0e685aad59fa07..d9bf54dd46ecdd2b6da7c99e39cc4366a7a876ca 100644 (file)
@@ -40,7 +40,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
    GLfloat offset, oz0, oz1, oz2;
    GLenum mode = GL_FILL;
    GLuint facing = 0;
-   GLchan saved_color[3][4];
+   GLchan saved_color[3][4] = { { 0 } };
    GLfloat saved_col0[3][4] = { { 0 } };
    GLfloat saved_spec[3][4] = { { 0 } };
    GLfloat saved_index[3] = { 0 };
diff --git a/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcproj b/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcproj
new file mode 100644 (file)
index 0000000..8995c03
--- /dev/null
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="glsl_apps_compile"\r
+       ProjectGUID="{98AB3D51-1820-4D14-9195-75FCA6997784}"\r
+       RootNamespace="glsl_apps_compile"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)\compile.exe"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine="copy $(OutDir)\compile.exe ..\..\..\..\src\glsl\apps"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)\compile.exe"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine="copy $(OutDir)\compile.exe ..\..\..\..\src\glsl\apps"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\apps\compile.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_define.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_error.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_extension.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_if.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_line.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_pragma.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_version.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_public.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index dd8c706ee12370dae767dc66e518301fcab11620..915e00026cf0e1085d5339cb626448c4348a0044 100644 (file)
@@ -1,5 +1,5 @@
 Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual C++ Express 2005\r
+# Visual Studio 2005\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdi", "gdi\gdi.vcproj", "{A1B24907-E196-4826-B6AF-26723629B633}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {2120C974-2717-4709-B44F-D6E6D0A56448} = {2120C974-2717-4709-B44F-D6E6D0A56448}\r
@@ -11,12 +11,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glu", "glu\glu.vcproj", "{2
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mesa", "mesa\mesa.vcproj", "{2120C974-2717-4709-B44F-D6E6D0A56448}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784} = {98AB3D51-1820-4D14-9195-75FCA6997784}\r
+       EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osmesa", "osmesa\osmesa.vcproj", "{8D6CD423-383B-49E7-81BC-D20C70B07DF5}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {A1B24907-E196-4826-B6AF-26723629B633} = {A1B24907-E196-4826-B6AF-26723629B633}\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_apps_compile", "glsl_apps_compile\glsl_apps_compile.vcproj", "{98AB3D51-1820-4D14-9195-75FCA6997784}"\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug Static CRT|Win32 = Debug Static CRT|Win32\r
@@ -57,6 +62,14 @@ Global
                {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release Static CRT|Win32.Build.0 = Release Static CRT|Win32\r
                {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release|Win32.ActiveCfg = Release|Win32\r
                {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release|Win32.Build.0 = Release|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug Static CRT|Win32.ActiveCfg = Debug|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug Static CRT|Win32.Build.0 = Debug|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug|Win32.Build.0 = Debug|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Release Static CRT|Win32.ActiveCfg = Release|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Release Static CRT|Win32.Build.0 = Release|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Release|Win32.ActiveCfg = Release|Win32\r
+               {98AB3D51-1820-4D14-9195-75FCA6997784}.Release|Win32.Build.0 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index 4719e342cf1befb4a13a2c3dadd33f63696d5978..15ad2293280429029a10dab106054d1022118836 100644 (file)
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
+                               CommandLine=""\r
+                               ExcludedFromBuild="false"\r
                        />\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
+                               CommandLine=""\r
+                               Outputs=""\r
                        />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
+                               CommandLine=""\r
+                               ExcludedFromBuild="false"\r
                        />\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
+                               CommandLine=""\r
+                               Outputs=""\r
                        />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
+                               CommandLine=""\r
+                               ExcludedFromBuild="false"\r
                        />\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
+                               CommandLine=""\r
+                               Outputs=""\r
                        />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
+                               CommandLine=""\r
+                               ExcludedFromBuild="false"\r
                        />\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
+                               CommandLine=""\r
+                               Outputs=""\r
                        />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                </Configuration>\r
        </Configurations>\r
        <References>\r
+               <ProjectReference\r
+                       ReferencedProjectIdentifier="{98AB3D51-1820-4D14-9195-75FCA6997784}"\r
+                       RelativePathToProject=".\glsl_apps_compile\glsl_apps_compile.vcproj"\r
+               />\r
        </References>\r
        <Files>\r
                <Filter\r
                                RelativePath="..\..\..\..\src\mesa\main\colortab.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\main\condrender.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\main\context.c"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\glapi\glapi_getproc.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\glapi\glapi_nop.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\glapi\glthread.c"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\main\shared.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_define.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_error.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_extension.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_if.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_line.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_pragma.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_version.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_builtin.c"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_mem.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\..\src\mesa\shader\slang\slang_preprocess.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_print.c"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\vbo\vbo_split_inplace.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\main\version.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\main\viewport.c"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\main\api_arrayelt.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\..\src\mesa\main\api_eval.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\main\api_exec.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\shader\arbprogram.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\..\src\mesa\shader\arbprogram_syn.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\main\arrayobj.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\main\colortab.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\main\condrender.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\main\config.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\main\macros.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\..\src\mesa\math\mathmod.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\main\matrix.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\..\src\mesa\main\mcompiler.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\main\mfeatures.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\swrast\s_points.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\..\src\mesa\swrast\s_pointtemp.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\swrast\s_span.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\main\simple_list.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_public.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_builtin.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_codegen.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_variable.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_emit.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_ir.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_mem.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\..\src\mesa\shader\slang\slang_preprocess.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_print.h"\r
                                >\r
                                RelativePath="..\..\..\..\src\mesa\shader\slang\slang_vartable.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release Static CRT|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCustomBuildTool"\r
+                                               Description="Building predefined shaders"\r
+                                               CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                               AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"\r
+                                               Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_context.h"\r
                                >\r