[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mesa: Changes to 'upstream-experimental'



Rebased ref, commits from common ancestor:
commit cfff2a6189b38f1ee8c8ca204e223574a5abf760
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Jun 5 17:16:47 2009 -0600

    mesa: bump version to 7.5-rc3

diff --git a/Makefile b/Makefile
index d134c4c..22334d6 100644
--- a/Makefile
+++ b/Makefile
@@ -182,7 +182,7 @@ ultrix-gcc:
 
 # Rules for making release tarballs
 
-VERSION=7.5-rc2
+VERSION=7.5-rc3
 DIRECTORY = Mesa-$(VERSION)
 LIB_NAME = MesaLib-$(VERSION)
 DEMO_NAME = MesaDemos-$(VERSION)
diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index e109f20..015ac71 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -31,7 +31,7 @@
 #define MESA_MAJOR 7
 #define MESA_MINOR 5
 #define MESA_PATCH 0
-#define MESA_VERSION_STRING "7.5-rc2"
+#define MESA_VERSION_STRING "7.5-rc3"
 
 /* To make version comparison easy */
 #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

commit 6453605785a3036c7e633400e4bd35bf2297b000
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Thu Jun 4 19:42:08 2009 -0700

    osmesa: Link with -ldl for dlopen code
    
    Now that the dlopen wrappers are built into libmesa.a, we need to link
    standalone libOSMesa with libdl to resolve dlopen and friends on
    platforms that need it.
    (cherry picked from commit 4795dd5950d4dcd7c8d421c8fb4851c193297ba1)

diff --git a/configure.ac b/configure.ac
index 8110e0f..48b8022 100644
--- a/configure.ac
+++ b/configure.ac
@@ -826,12 +826,12 @@ case "$mesa_driver" in
 osmesa)
     # only link libraries with osmesa if shared
     if test "$enable_static" = no; then
-        OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
+        OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
     else
         OSMESA_LIB_DEPS=""
     fi
     OSMESA_MESA_DEPS=""
-    OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS"
+    OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
     ;;
 *)
     # Link OSMesa to libGL otherwise
@@ -845,9 +845,6 @@ osmesa)
     OSMESA_PC_REQ="gl"
     ;;
 esac
-if test "$enable_static" = no; then
-    OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS"
-fi
 OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
 AC_SUBST([OSMESA_LIB_DEPS])
 AC_SUBST([OSMESA_MESA_DEPS])

commit 5df64685892aea4dabee377352888d8eb58e9446
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Thu Jun 4 06:21:10 2009 -0700

    osmesa: Allow building standalone in all three channel widths
    
    autoconf had been designating the 8 bit libOSMesa as the default
    standalone osmesa, but the Makefile expected it to be linked to libGL.
    Fix up the osmesa Makefile so that it allows any of the combinations of
    standalone and channel width to be built.
    
    Fixes bug #21980.
    (cherry picked from commit 7441dcd90b01df8351026af8bbb50e11bb86071a)

diff --git a/src/mesa/drivers/osmesa/Makefile b/src/mesa/drivers/osmesa/Makefile
index 3b39842..92d4149 100644
--- a/src/mesa/drivers/osmesa/Makefile
+++ b/src/mesa/drivers/osmesa/Makefile
@@ -19,11 +19,12 @@ INCLUDE_DIRS = \
 	-I$(TOP)/src/mesa \
 	-I$(TOP)/src/mesa/main
 
+# Standalone osmesa needs to be linked with core Mesa APIs
+ifeq ($(DRIVER_DIRS), osmesa)
 CORE_MESA = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a
-
-
-.PHONY: osmesa8
-.PHONY: osmesa16
+else
+CORE_MESA =
+endif
 
 
 .c.o:
@@ -31,31 +32,12 @@ CORE_MESA = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a
 
 
 default: $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
-	@ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
-		$(MAKE) osmesa16 ; \
-	else \
-		$(MAKE) osmesa8 ; \
-	fi
-
-
-
-
-# The normal libOSMesa is used in conjuction with libGL
-osmesa8: $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
-
-$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS)
-	$(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-		-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
-		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-		-id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \
-		$(OSMESA_LIB_DEPS) $(OBJECTS)
-
-
 
 
-# The libOSMesa16/libOSMesa32 libraries do not use libGL but rather are built
-# with all the other Mesa sources (compiled with -DCHAN_BITS=16/32
-osmesa16: $(OBJECTS) $(CORE_MESA)
+# libOSMesa can be used in conjuction with libGL or with all other Mesa
+# sources. We can also build libOSMesa16/libOSMesa32 by setting
+# -DCHAN_BITS=16/32.
+$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS) $(CORE_MESA)
 	$(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
 		-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
 		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \

commit 9424d81d18770f0c436f0876dffe07cf7c094db4
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jun 4 13:13:14 2009 -0600

    softpipe: separate case for PIPE_PRIM_POLYGON in sp_vbuf_draw()
    
    Because of flat shading, we can't use same code as PIPE_PRIM_TRIANGLE_FAN.
    This is a follow-on to commit a59575d8fbe8b0ca053cc8366ce7a42bc660158a.
    
    (cherry picked from commit 086ecea179ed572c89aa77c5f465671a5cef87a7)

diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
index 56f12b9..06725fd 100644
--- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c
+++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
@@ -236,7 +236,6 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr)
       }
       break;
 
-
    case PIPE_PRIM_TRIANGLES:
       for (i = 2; i < nr; i += 3) {
          setup_tri( setup_ctx,
@@ -256,7 +255,6 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr)
       break;
 
    case PIPE_PRIM_TRIANGLE_FAN:
-   case PIPE_PRIM_POLYGON:
       for (i = 2; i < nr; i += 1) {
          setup_tri( setup_ctx,
                     get_vert(vertex_buffer, indices[0], stride),
@@ -264,6 +262,7 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr)
                     get_vert(vertex_buffer, indices[i-0], stride));
       }
       break;
+
    case PIPE_PRIM_QUADS:
       for (i = 3; i < nr; i += 4) {
          setup_tri( setup_ctx,
@@ -277,6 +276,7 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr)
                     get_vert(vertex_buffer, indices[i-0], stride));
       }
       break;
+
    case PIPE_PRIM_QUAD_STRIP:
       for (i = 3; i < nr; i += 2) {
          setup_tri( setup_ctx,
@@ -290,6 +290,16 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr)
                     get_vert(vertex_buffer, indices[i-0], stride));
       }
       break;
+
+   case PIPE_PRIM_POLYGON:
+      for (i = 2; i < nr; i += 1) {
+         setup_tri( setup_ctx,
+                    get_vert(vertex_buffer, indices[0-1], stride),
+                    get_vert(vertex_buffer, indices[i-0], stride),
+                    get_vert(vertex_buffer, indices[0], stride));
+      }
+      break;
+
    default:
       assert(0);
    }

commit 6907650211d136ee7cb5a8914c32196d35a75bf3
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jun 4 13:12:13 2009 -0600

    softpipe: fix incorrect tri vertex order for PIPE_PRIM_POLYGON rendering
    
    This fixes incorrect front/back-face orientation.
    
    (cherry picked from commit a64bbdaa3e0b036a880d6db65ceb4a66205062f1)

diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
index 329c92b..56f12b9 100644
--- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c
+++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
@@ -420,8 +420,8 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr)
        */
       for (i = 2; i < nr; i += 1) {
          setup_tri( setup_ctx,
-                    get_vert(vertex_buffer, i-0, stride),
                     get_vert(vertex_buffer, i-1, stride),
+                    get_vert(vertex_buffer, i-0, stride),
                     get_vert(vertex_buffer, 0, stride));
       }
       break;

commit d37795c45334010c70b2e1c23fca0e49ff607a6e
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jun 4 13:10:19 2009 -0600

    st/mesa: increase ST_MAX_SHADER_TOKENS to 8k

diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 6ec633c..3492610 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -49,7 +49,7 @@
 #include "cso_cache/cso_context.h"
 
 
-#define ST_MAX_SHADER_TOKENS 4096
+#define ST_MAX_SHADER_TOKENS (8 * 1024)
 
 
 #define TGSI_DEBUG 0

commit 45e744dddc8a8f3b42610bfa512bc296bd5264bc
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jun 4 13:08:52 2009 -0600

    tgsi: increase MAX_LABELS to 4096

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index 0b4b2a6..da22baa 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -34,7 +34,7 @@
 extern "C" {
 #endif
 
-#define MAX_LABELS 1024
+#define MAX_LABELS (4 * 1024)  /**< basically, max instructions */
 
 #define NUM_CHANNELS 4  /* R,G,B,A */
 #define QUAD_SIZE    4  /* 4 pixel/quad */

commit fc7f92478286041a018ac4e72d2ccedeea7c0eca
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jun 2 18:41:12 2009 -0700

    scons: Less aggressive optimizations for MSVC 64bit compiler.
    
    MSVC 64bit compiler takes forever on some of the files.
    
    Might want to revisit this again later.

diff --git a/scons/gallium.py b/scons/gallium.py
index 5e59636..0d58436 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -362,11 +362,24 @@ def generate(env):
               '/GL-', # disable whole program optimization
             ]
         else:
+            if env['machine'] == 'x86_64':
+                cflags += [
+                    # Same as /O2, but without global optimizations or auto-inlining
+                    # http://msdn.microsoft.com/en-us/library/8f8h5cxt.aspx
+                    '/Ob1', # enable inline expansion, disable auto-inlining
+                    '/Oi', # enable intrinsic functions
+                    '/Ot', # favors fast code
+                    '/Oy', # omit frame pointer
+                    '/Gs', # enable stack probes
+                    '/GF', # eliminate duplicate strings
+                    '/Gy', # enable function-level linking
+                ]
+            else:
+                cflags += [
+                    '/O2', # optimize for speed
+                ]
             cflags += [
-              '/Ox', # maximum optimizations
-              '/Oi', # enable intrinsic functions
-              '/Ot', # favor code speed
-              #'/fp:fast', # fast floating point 
+                #'/fp:fast', # fast floating point 
             ]
         if env['profile']:
             cflags += [

commit 0f50c4fab8acfe291ddd426f331eea5eec66ba13
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jun 2 18:23:12 2009 -0700

    scons: Output nice summary messages instead of long command lines.
    
    You can still get the old behavior by passing the option quiet=no to scons.

diff --git a/common.py b/common.py
index e57429e..a687efc 100644
--- a/common.py
+++ b/common.py
@@ -55,7 +55,7 @@ def AddOptions(opts):
 		from SCons.Options.EnumOption import EnumOption
 	opts.Add(BoolOption('debug', 'debug build', 'no'))
 	opts.Add(BoolOption('profile', 'profile build', 'no'))
-	#opts.Add(BoolOption('quiet', 'quiet command lines', 'no'))
+	opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
 	opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
 											 allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
 	opts.Add(EnumOption('platform', 'target platform', default_platform,
diff --git a/scons/gallium.py b/scons/gallium.py
index c7e74d7..5e59636 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -42,11 +42,17 @@ import SCons.Scanner
 def quietCommandLines(env):
     # Quiet command lines
     # See also http://www.scons.org/wiki/HidingCommandLinesInOutput
+    env['ASCOMSTR'] = "Assembling $SOURCE ..."
     env['CCCOMSTR'] = "Compiling $SOURCE ..."
+    env['SHCCCOMSTR'] = "Compiling $SOURCE ..."
     env['CXXCOMSTR'] = "Compiling $SOURCE ..."
+    env['SHCXXCOMSTR'] = "Compiling $SOURCE ..."
     env['ARCOMSTR'] = "Archiving $TARGET ..."
-    env['RANLIBCOMSTR'] = ""
+    env['RANLIBCOMSTR'] = "Indexing $TARGET ..."
     env['LINKCOMSTR'] = "Linking $TARGET ..."
+    env['SHLINKCOMSTR'] = "Linking $TARGET ..."
+    env['LDMODULECOMSTR'] = "Linking $TARGET ..."
+    env['SWIGCOMSTR'] = "Generating $TARGET ..."
 
 
 def createConvenienceLibBuilder(env):
@@ -185,9 +191,8 @@ def num_jobs():
 def generate(env):
     """Common environment generation code"""
 
-    # FIXME: this is already too late
-    #if env.get('quiet', False):
-    #    quietCommandLines(env)
+    if env.get('quiet', True):
+        quietCommandLines(env)
 
     # Toolchain
     platform = env['platform']

commit 273117ceed47bff58a0f475dd36b37721e997f91
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jun 2 16:41:45 2009 -0700

    util: Unsaved change missing from last commit.

diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index a2fcdad..9747a55 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -1141,7 +1141,7 @@ pipe_get_tile_z(struct pipe_transfer *pt,
          for (i = 0; i < h; i++) {
             for (j = 0; j < w; j++) {
                /* convert 24-bit Z to 32-bit Z */
-               pDest[j] = (ptrc[j] & 0xffffff00) | (ptrc[j] & 0xff);
+               pDest[j] = (ptrc[j] & 0xffffff00) | ((ptrc[j] >> 24) & 0xff);
             }
             pDest += dstStride;
             ptrc += pt->stride/4;

commit 840af5fd62edc01769cc3818702ea399a0c68c40
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jun 2 11:46:53 2009 -0700

    util: Support Z24S8/Z24X8 -> unsigned conversion.

diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index 9becd9f..a2fcdad 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -1133,6 +1133,21 @@ pipe_get_tile_z(struct pipe_transfer *pt,
          }
       }
       break;
+   case PIPE_FORMAT_Z24S8_UNORM:
+   case PIPE_FORMAT_Z24X8_UNORM:
+      {
+         const uint *ptrc
+            = (const uint *)(map + y * pt->stride + x*4);
+         for (i = 0; i < h; i++) {
+            for (j = 0; j < w; j++) {
+               /* convert 24-bit Z to 32-bit Z */
+               pDest[j] = (ptrc[j] & 0xffffff00) | (ptrc[j] & 0xff);
+            }
+            pDest += dstStride;
+            ptrc += pt->stride/4;
+         }
+      }
+      break;
    case PIPE_FORMAT_Z16_UNORM:
       {
          const ushort *ptrc

commit c91df4c1534e2db2274b6d08e90470bf21a49e2a
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jun 2 11:46:06 2009 -0700

    util: Fix 24 to 32 bit expansion binary arithmetic expression.
    
    When approaching y = x * 0xffffffff / 0xffffff with bit arithmetic, the
    8 least significant bits of y should come from the
    8 most significant bits of x.

diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index f0a5a33..9becd9f 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -1126,7 +1126,7 @@ pipe_get_tile_z(struct pipe_transfer *pt,
          for (i = 0; i < h; i++) {
             for (j = 0; j < w; j++) {
                /* convert 24-bit Z to 32-bit Z */
-               pDest[j] = (ptrc[j] << 8) | (ptrc[j] & 0xff);
+               pDest[j] = (ptrc[j] << 8) | ((ptrc[j] >> 16) & 0xff);
             }
             pDest += dstStride;
             ptrc += pt->stride/4;

commit 12e94d892e3322be5c8a1594702d69e7a02d5274
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Jun 2 10:27:05 2009 -0600

    mesa: release VBO and PBO references upon context destruction

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 884b6ad..a947f69 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1007,6 +1007,16 @@ _mesa_free_context_data( GLcontext *ctx )
 
    _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj);
 
+#if FEATURE_ARB_pixel_buffer_object
+   _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL);
+   _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL);
+#endif
+
+#if FEATURE_ARB_vertex_buffer_object
+   _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL);
+   _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, NULL);
+#endif
+
 #if FEATURE_ARB_vertex_buffer_object
    _mesa_delete_buffer_object(ctx, ctx->Array.NullBufferObj);
 #endif

commit cb3a9f984de6b1a167c60c345d51d55b8c0ca80b
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Jun 2 10:26:50 2009 -0600

    mesa: add #define FEATURE_ARB_pixel_buffer_object

diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index f570647..62c3ead 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -61,6 +61,7 @@
 #define FEATURE_ARB_occlusion_query  _HAVE_FULL_GL
 #define FEATURE_ARB_fragment_program  _HAVE_FULL_GL
 #define FEATURE_ARB_framebuffer_object  _HAVE_FULL_GL
+#define FEATURE_ARB_pixel_buffer_object  _HAVE_FULL_GL
 #define FEATURE_ARB_vertex_buffer_object  _HAVE_FULL_GL
 #define FEATURE_ARB_vertex_program  _HAVE_FULL_GL
 #define FEATURE_ARB_vertex_shader _HAVE_FULL_GL

commit 16fbd391291de8eddcd01a1a10e6801da299209b
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Mon May 18 13:26:16 2009 -0700

    intel: Clip to window after calling Driver.TexImage2D
    
    This prevents the width / height from being clipped to the window size before
    the texture is allocated.  This matches intelCopyTexImage1D.
    
    This should fix bug #21227
    
    Signed-off-by: Ian Romanick <ian.romanick@intel.com>
    (cherry picked from commit 129f311673c99eb912d659023e50bc5f0ef53249)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 08437aa..90bbb8c 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -231,6 +231,14 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
    if (border)
       goto fail;
 
+   /* Setup or redefine the texture object, mipmap tree and texture
+    * image.  Don't populate yet.
+    */
+   ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
+                          width, height, border,
+                          GL_RGBA, CHAN_TYPE, NULL,
+                          &ctx->DefaultPacking, texObj, texImage);
+
    srcx = x;
    srcy = y;
    dstx = 0;
@@ -241,15 +249,6 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
 				   &width, &height))
       return;
 
-   /* Setup or redefine the texture object, mipmap tree and texture
-    * image.  Don't populate yet.  
-    */
-   ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
-                          width, height, border,
-                          GL_RGBA, CHAN_TYPE, NULL,
-                          &ctx->DefaultPacking, texObj, texImage);
-
-
    if (!do_copy_texsubimage(intel_context(ctx), target,
                             intel_texture_image(texImage),
                             internalFormat, 0, 0, x, y, width, height))

commit 1aef032d438aaa40ec28bf279ad5c089370773f0
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Jun 1 20:16:20 2009 -0700

    gallium/draw: Free specialized versions of driver shaders
    
    The pstipple, aaline and aapoint code would create specialized versions
    of shaders and upload them to the driver -- but never free them.

diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 0d322b0..9f95671 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -819,6 +819,10 @@ aaline_delete_fs_state(struct pipe_context *pipe, void *fs)
    struct aaline_fragment_shader *aafs = (struct aaline_fragment_shader *) fs;
    /* pass-through */
    aaline->driver_delete_fs_state(aaline->pipe, aafs->driver_fs);
+
+   if (aafs->aaline_fs)
+      aaline->driver_delete_fs_state(aaline->pipe, aafs->aaline_fs);
+
    FREE(aafs);
 }
 
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
index 729cf75..ae1712f 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
@@ -829,8 +829,13 @@ aapoint_delete_fs_state(struct pipe_context *pipe, void *fs)
 {
    struct aapoint_stage *aapoint = aapoint_stage_from_pipe(pipe);
    struct aapoint_fragment_shader *aafs = (struct aapoint_fragment_shader *) fs;
+
    /* pass-through */
    aapoint->driver_delete_fs_state(aapoint->pipe, aafs->driver_fs);
+
+   if (aafs->aapoint_fs)
+      aapoint->driver_delete_fs_state(aapoint->pipe, aafs->aapoint_fs);
+
    FREE(aafs);
 }
 
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index bc63b70..30a6d29 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -650,6 +650,10 @@ pstip_delete_fs_state(struct pipe_context *pipe, void *fs)
    struct pstip_fragment_shader *aafs = (struct pstip_fragment_shader *) fs;
    /* pass-through */
    pstip->driver_delete_fs_state(pstip->pipe, aafs->driver_fs);
+
+   if (aafs->pstip_fs)
+      pstip->driver_delete_fs_state(pstip->pipe, aafs->pstip_fs);
+
    FREE(aafs);
 }
 

commit 003cfd4dd2491675058c53a8f59553f2443be349
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Jun 1 20:15:28 2009 -0700

    draw: free more token arrays
    
    The AA line and point code also needs to free token arrays after
    building driver shaders.

diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 9fedeef..0d322b0 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -60,8 +60,6 @@ struct aaline_fragment_shader
    struct pipe_shader_state state;
    void *driver_fs;
    void *aaline_fs;
-   void *aapoint_fs; /* not yet */
-   void *sprite_fs; /* not yet */
    uint sampler_unit;
    int generic_attrib;  /**< texcoord/generic used for texture */
 };
@@ -373,10 +371,15 @@ generate_aaline_fs(struct aaline_stage *aaline)
    aaline->fs->aaline_fs
       = aaline->driver_create_fs_state(aaline->pipe, &aaline_fs);
    if (aaline->fs->aaline_fs == NULL)
-      return FALSE;
+      goto fail;
 
    aaline->fs->generic_attrib = transform.maxGeneric + 1;
+   FREE((void *)aaline_fs.tokens);
    return TRUE;
+
+fail:
+   FREE((void *)aaline_fs.tokens);
+   return FALSE;
 }
 
 
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
index 66839f7..729cf75 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
@@ -523,11 +523,15 @@ generate_aapoint_fs(struct aapoint_stage *aapoint)
    aapoint->fs->aapoint_fs
       = aapoint->driver_create_fs_state(aapoint->pipe, &aapoint_fs);
    if (aapoint->fs->aapoint_fs == NULL)
-      return FALSE;
+      goto fail;
 
    aapoint->fs->generic_attrib = transform.maxGeneric + 1;
-
+   FREE((void *)aapoint_fs.tokens);
    return TRUE;
+
+fail:
+   FREE((void *)aapoint_fs.tokens);
+   return FALSE;
 }
 
 

commit 69a765df1c3bf6acc549a5a6a047bbde16988721
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Jun 1 19:48:40 2009 -0700

    draw: avoid leaking tokens when building pstipple fragment shader
    
    Add missing FREE() after MALLOC().

diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index 9287fc1..bc63b70 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -358,6 +358,7 @@ generate_pstip_fs(struct pstip_stage *pstip)
 
    pstip->fs->pstip_fs = pstip->driver_create_fs_state(pstip->pipe, &pstip_fs);
 
+   FREE((void *)pstip_fs.tokens);
    return TRUE;
 }
 

commit 503632557e8904b775e1b6f3f84eb41bda3af122
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu May 14 10:26:56 2009 +0100

    mesa/st: restore flush to copy_texsubimage (was previously finish)
    
    Need a flush here even though the original finish was overkill.

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index aaed155..14b78d1 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1317,6 +1317,9 @@ st_copy_texsubimage(GLcontext *ctx,
    GLboolean use_fallback = GL_TRUE;
    GLboolean matching_base_formats;
 
+   /* any rendering in progress must flushed before we grab the fb image */
+   st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+
    /* make sure finalize_textures has been called? 
     */
    if (0) st_validate_state(ctx->st);

commit 557d2bb42397bb5511c32b4a2b39c7978e69dc8e
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jun 1 20:20:48 2009 -0700

    wgl: Destroy the framebuffer when the window is destroyed.

diff --git a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c
index 768cef3..de37d13 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c
@@ -45,6 +45,41 @@
 #include "stw_tls.h"
 
 
+struct stw_framebuffer *
+stw_framebuffer_from_hwnd_locked(
+   HWND hwnd )
+{
+   struct stw_framebuffer *fb;
+
+   for (fb = stw_dev->fb_head; fb != NULL; fb = fb->next)
+      if (fb->hWnd == hwnd)
+         break;
+
+   return fb;
+}
+
+
+static INLINE void
+stw_framebuffer_destroy_locked(
+   struct stw_framebuffer *fb )
+{
+   struct stw_framebuffer **link;
+
+   link = &stw_dev->fb_head;
+   while (*link != fb)
+      link = &(*link)->next;
+   assert(*link);
+   *link = fb->next;
+   fb->next = NULL;
+
+   st_unreference_framebuffer(fb->stfb);
+   
+   pipe_mutex_destroy( fb->mutex );
+   
+   FREE( fb );
+}
+
+
 /**
  * @sa http://msdn.microsoft.com/en-us/library/ms644975(VS.85).aspx
  * @sa http://msdn.microsoft.com/en-us/library/ms644960(VS.85).aspx
@@ -69,9 +104,7 @@ stw_call_window_proc(
       struct stw_framebuffer *fb;
 
       pipe_mutex_lock( stw_dev->mutex );
-      for (fb = stw_dev->fb_head; fb != NULL; fb = fb->next)
-         if (fb->hWnd == pParams->hwnd)
-            break;
+      fb = stw_framebuffer_from_hwnd_locked( pParams->hwnd );
       pipe_mutex_unlock( stw_dev->mutex );
       
       if(fb) {
@@ -90,6 +123,18 @@ stw_call_window_proc(
       }
    }
 
+   if (pParams->message == WM_DESTROY) {
+      struct stw_framebuffer *fb;
+
+      pipe_mutex_lock( stw_dev->mutex );
+      
+      fb = stw_framebuffer_from_hwnd_locked( pParams->hwnd );
+      if(fb)
+         stw_framebuffer_destroy_locked(fb);
+      
+      pipe_mutex_unlock( stw_dev->mutex );
+   }
+
    return CallNextHookEx(tls_data->hCallWndProcHook, nCode, wParam, lParam);
 }
 
@@ -212,27 +257,6 @@ stw_framebuffer_resize(
 }                      
 
 
-static INLINE void
-stw_framebuffer_destroy_locked(
-   struct stw_framebuffer *fb )
-{
-   struct stw_framebuffer **link;
-
-   link = &stw_dev->fb_head;
-   while (*link != fb)
-      link = &(*link)->next;
-   assert(*link);
-   *link = fb->next;
-   fb->next = NULL;
-
-   st_unreference_framebuffer(fb->stfb);
-   
-   pipe_mutex_destroy( fb->mutex );
-   
-   FREE( fb );
-}
-
-
 void
 stw_framebuffer_cleanup( void )
 {

commit 97f5953ced6938ca8e92cde62e8717ff505cc4e2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu May 14 15:57:27 2009 +0100

    progs/vpglsl: add similar support for point rendering as progs/vp

diff --git a/progs/vpglsl/psiz-imm.glsl b/progs/vpglsl/psiz-imm.glsl
new file mode 100644
index 0000000..101d314
--- /dev/null
+++ b/progs/vpglsl/psiz-imm.glsl
@@ -0,0 +1,6 @@
+
+void main() {
+    gl_FrontColor = gl_Color;
+    gl_PointSize = 2.0;
+    gl_Position = gl_Vertex;
+}
diff --git a/progs/vpglsl/psiz-mul.glsl b/progs/vpglsl/psiz-mul.glsl
new file mode 100644
index 0000000..77f4a46
--- /dev/null
+++ b/progs/vpglsl/psiz-mul.glsl
@@ -0,0 +1,6 @@
+
+void main() {
+    gl_FrontColor = gl_Color;
+    gl_PointSize = 10 * gl_Color.x;
+    gl_Position = gl_Vertex;
+}
diff --git a/progs/vpglsl/vp-tris.c b/progs/vpglsl/vp-tris.c
index 9ae410b..b2b0508 100644
--- a/progs/vpglsl/vp-tris.c
+++ b/progs/vpglsl/vp-tris.c
@@ -10,6 +10,10 @@
 
 static const char *filename = NULL;
 static GLuint nr_steps = 4;
+static GLuint prim = GL_TRIANGLES;
+static GLfloat psz = 1.0;
+static GLboolean pointsmooth = 0;
+static GLboolean program_point_size = 0;
 
 static GLuint fragShader;
 static GLuint vertShader;
@@ -229,6 +233,14 @@ static void subdiv( union vert *v0,
    }
 }
 
+static void enable( GLenum value, GLboolean flag )
+{
+   if (flag)
+      glEnable(value);
+   else
+      glDisable(value);
+}
+
 /** Assignment */
 #define ASSIGN_3V( V, V0, V1, V2 )  \
 do {                                \
@@ -241,10 +253,13 @@ static void Display( void )
 {
    glClearColor(0.3, 0.3, 0.3, 1);
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+   glPointSize(psz);
 
    glUseProgram(program);
+   enable( GL_POINT_SMOOTH, pointsmooth );
+   enable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB, program_point_size );
 
-   glBegin(GL_TRIANGLES);
+   glBegin(prim);
 
 
    {
@@ -291,10 +306,41 @@ static void Key( unsigned char key, int x, int y )
    (void) x;
    (void) y;
    switch (key) {
-      case 27:
-         CleanUp();
-         exit(0);
-         break;
+   case 'p':
+      prim = GL_POINTS;
+      break;
+   case 't':
+      prim = GL_TRIANGLES;
+      break;
+   case 's':
+      psz += .5;
+      break;
+   case 'S':
+      if (psz > .5)
+         psz -= .5;
+      break;
+   case 'm':
+      pointsmooth = !pointsmooth;
+      break;
+   case 'z':
+      program_point_size = !program_point_size;
+      break;
+   case '+':
+      nr_steps++;
+      break; 
+   case '-':
+      if (nr_steps) 
+         nr_steps--;
+      break;
+   case ' ':
+      psz = 1.0;
+      prim = GL_TRIANGLES;
+      nr_steps = 4;
+      break;
+   case 27:
+      CleanUp();
+      exit(0);
+      break;
    }
    glutPostRedisplay();
 }
@@ -305,7 +351,7 @@ int main( int argc, char *argv[] )
    glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 250, 250 );
    glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
-   glutCreateWindow(argv[0]);
+   glutCreateWindow(argv[argc-1]);
    glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );

commit f989390af6f827d1ea36560381340148811836f3
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Wed May 13 22:35:06 2009 +0200

    st/gl: Fix mip gen for compressed textures

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index b182106..aaed155 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -673,7 +673,7 @@ st_TexImage(GLcontext * ctx,
                                    PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
       if (compress_with_blit(ctx, target, level, 0, 0, 0, width, height, depth,
                              format, type, pixels, unpack, texImage)) {
-         return;
+         goto done;
       }
    }
 
@@ -750,6 +750,7 @@ st_TexImage(GLcontext * ctx,
 
    _mesa_unmap_teximage_pbo(ctx, unpack);
 
+done:
    if (stImage->pt && texImage->Data) {
       st_texture_image_unmap(ctx->st, stImage);
       texImage->Data = NULL;
@@ -1061,7 +1062,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
                              xoffset, yoffset, zoffset,
                              width, height, depth,
                              format, type, pixels, packing, texImage)) {
-         return;
+         goto done;
       }
    }
 
@@ -1110,16 +1111,17 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
       }
    }
 
-   if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
-      ctx->Driver.GenerateMipmap(ctx, target, texObj);


Reply to: