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

mesa: Changes to 'debian-unstable'



 Makefile                                         |   10 
 bin/mklib                                        |    9 
 configs/linux-static                             |    3 
 configs/linux-x86-64-static                      |    3 
 configs/linux-x86-static                         |    3 
 debian/changelog                                 |   12 
 debian/control                                   |   14 
 docs/fbdev-dri.html                              |    6 
 docs/memory.html                                 |   21 +
 docs/news.html                                   |   17 +
 docs/relnotes-7.0.3.html                         |   59 +++
 docs/relnotes.html                               |    1 
 docs/shading.html                                |    1 
 include/GL/glutf90.h                             |    4 
 progs/trivial/.gitignore                         |   65 ----
 progs/xdemos/offset.c                            |    3 
 src/glut/glx/Makefile                            |    1 
 src/glut/glx/glut_event.c                        |    6 
 src/glut/glx/glut_fbc.c                          |  164 -----------
 src/glut/glx/glut_fcb.c                          |  164 +++++++++++
 src/glw/glw.pc.in                                |    2 
 src/mesa/Makefile                                |    2 
 src/mesa/drivers/common/driverfuncs.c            |    2 
 src/mesa/drivers/dri/i915tex/i830_vtbl.c         |   62 +++-
 src/mesa/drivers/dri/i915tex/i915_vtbl.c         |   55 +++
 src/mesa/drivers/dri/i915tex/intel_batchbuffer.c |    2 
 src/mesa/drivers/dri/i915tex/intel_batchbuffer.h |    3 
 src/mesa/drivers/dri/i915tex/intel_blit.c        |   32 +-
 src/mesa/drivers/dri/i915tex/intel_buffers.c     |   50 +--
 src/mesa/drivers/dri/i915tex/intel_context.c     |    2 
 src/mesa/drivers/dri/i915tex/intel_context.h     |    1 
 src/mesa/drivers/dri/i915tex/intel_screen.h      |    1 
 src/mesa/drivers/dri/i915tex/intel_tris.c        |    3 
 src/mesa/drivers/dri/i965/brw_wm_emit.c          |    1 
 src/mesa/drivers/dri/r200/r200_texstate.c        |    9 
 src/mesa/drivers/dri/radeon/radeon_screen.c      |    7 
 src/mesa/drivers/windows/gdi/wgl.c               |   16 -
 src/mesa/drivers/windows/gdi/wmesa.c             |    1 
 src/mesa/main/config.h                           |    2 
 src/mesa/main/context.c                          |    1 
 src/mesa/main/dd.h                               |    5 
 src/mesa/main/enable.c                           |    8 
 src/mesa/main/mtypes.h                           |   10 
 src/mesa/main/points.c                           |   11 
 src/mesa/main/version.h                          |    6 
 src/mesa/shader/arbprogparse.c                   |    2 
 src/mesa/shader/prog_execute.c                   |  128 ++++----
 src/mesa/shader/prog_execute.h                   |    3 
 src/mesa/shader/prog_parameter.c                 |    2 
 src/mesa/shader/prog_statevars.c                 |   93 ++++++
 src/mesa/shader/prog_statevars.h                 |    8 
 src/mesa/shader/slang/slang_builtin.c            |   16 -
 src/mesa/shader/slang/slang_codegen.c            |    3 
 src/mesa/shader/slang/slang_emit.c               |   12 
 src/mesa/swrast/s_aalinetemp.h                   |    1 
 src/mesa/swrast/s_aatritemp.h                    |   10 
 src/mesa/swrast/s_context.c                      |   27 +
 src/mesa/swrast/s_context.h                      |    4 
 src/mesa/swrast/s_fragprog.c                     |   32 +-
 src/mesa/swrast/s_linetemp.h                     |    3 
 src/mesa/swrast/s_pointtemp.h                    |    1 
 src/mesa/swrast/s_readpix.c                      |    5 
 src/mesa/swrast/s_texfilter.c                    |   35 --
 src/mesa/swrast/s_triangle.c                     |    2 
 src/mesa/swrast/s_tritemp.h                      |   11 
 src/mesa/swrast/swrast.h                         |    7 
 src/mesa/swrast_setup/ss_context.c               |    3 
 src/mesa/swrast_setup/ss_triangle.c              |   10 
 src/mesa/swrast_setup/ss_tritmp.h                |    2 
 src/mesa/tnl/t_vb_program.c                      |  340 +++++++++++++----------
 src/mesa/tnl/tnl.h                               |    8 
 src/mesa/tnl_dd/t_dd_tritmp.h                    |    8 
 72 files changed, 1012 insertions(+), 624 deletions(-)

New commits:
commit 942372dcdfa638a86e646f632b90b16e0901ecb0
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Dec 18 13:56:55 2007 +0100

    debian/control fixups
    
    * Bump Standards-Version to 3.7.3.
    * Move libgl1-mesa-swx11-dbg, mesa-common-dev and libosmesa6-dev to section
      libdevel.
    * libgl1-mesa-swx11 conflicts with libgl1-mesa-glx.  Move it and
      libgl1-mesa-swx11-dev to priority extra.
    * Fix typo in mesa-common-dev's long description.

diff --git a/debian/changelog b/debian/changelog
index 3bba7da..455d12f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
 mesa (7.0.2-3) UNRELEASED; urgency=low
 
   * Update to mesa_7_0_branch head (commit 0107acde).
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 18 Dec 2007 12:34:58 +0100
+  * Bump Standards-Version to 3.7.3.
+  * Move libgl1-mesa-swx11-dbg, mesa-common-dev and libosmesa6-dev to section
+    libdevel.
+  * libgl1-mesa-swx11 conflicts with libgl1-mesa-glx.  Move it and
+    libgl1-mesa-swx11-dev to priority extra.
+  * Fix typo in mesa-common-dev's long description.
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 18 Dec 2007 13:32:25 +0100
 
 mesa (7.0.2-2) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index 530ac81..ce7d201 100644
--- a/debian/control
+++ b/debian/control
@@ -3,11 +3,12 @@ Section: graphics
 Priority: optional
 Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
 Uploaders: Thierry Reding <thierry@gilfi.de>, Julien Cristau <jcristau@debian.org>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>
-Standards-Version: 3.7.2
+Standards-Version: 3.7.3
 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev
 
 Package: libgl1-mesa-swx11
 Section: libs
+Priority: extra
 Architecture: any
 Depends: ${shlibs:Depends}, libosmesa6 (>= 6.5.2-1)
 Conflicts: mesag3-glide, mesag3-glide2, mesag3+ggi, libgl1, nvidia-glx, mesag3, libgl1-mesa-swrast
@@ -28,7 +29,7 @@ Description: A free implementation of the OpenGL API -- runtime
  On Linux, this library is also known as libGL or libGL.so.1.
 
 Package: libgl1-mesa-swx11-dbg
-Section: libs
+Section: libdevel
 Priority: extra
 Architecture: any
 Depends: libgl1-mesa-swx11 (= ${binary:Version})
@@ -78,6 +79,7 @@ Description: Mesa OpenGL runtime [i686 optimized]
 
 Package: libgl1-mesa-swx11-dev
 Section: libdevel
+Priority: extra
 Architecture: any
 Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version})
 Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
@@ -229,14 +231,14 @@ Description: A free implementation of the OpenGL API -- GLX development files
  package.
 
 Package: mesa-common-dev
-Section: devel
+Section: libdevel
 Architecture: all
 Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 6.5.2)
 Depends: libx11-dev
 Description: Developer documentation for Mesa
  This package includes the specifications for the Mesa-specific OpenGL
- extensions, the complete set of release release notes and the
- development header files common to all Mesa packages.
+ extensions, the complete set of release notes and the development header
+ files common to all Mesa packages.
 
 Package: libosmesa6
 Section: libs
@@ -252,7 +254,7 @@ Description: Mesa Off-screen rendering extension
  renderer which do not require external libraries to work.
 
 Package: libosmesa6-dev
-Section: devel
+Section: libdevel
 Architecture: any
 Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) | libgl-dev
 Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev

commit b7f901088b826407e4e52f88a1feb971cc8a87ea
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Dec 18 13:32:01 2007 +0100

    Update changelog.

diff --git a/debian/changelog b/debian/changelog
index fc46e4e..3bba7da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mesa (7.0.2-3) UNRELEASED; urgency=low
+
+  * Update to mesa_7_0_branch head (commit 0107acde).
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 18 Dec 2007 12:34:58 +0100
+
 mesa (7.0.2-2) unstable; urgency=low
 
   [ Julien Cristau ]

commit 0107acded03c510df2093b0b98bca52b5734dd5b
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Mon Dec 17 12:20:56 2007 +0100

    i915tex: Fix issues with glDrawBuffer(GL_NONE).
    
    Don't dereference NULL renderbuffer pointer, and make sure the software
    fallback sticks.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=13694 .

diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c
index 78fb720..6778fdf 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c
@@ -714,7 +714,8 @@ intel_wait_flips(struct intel_context *intel, GLuint batch_flags)
 			     BUFFER_BIT_FRONT_LEFT ? BUFFER_FRONT_LEFT :
 			     BUFFER_BACK_LEFT);
 
-   if (intel_fb->Base.Name == 0 && intel_rb->pf_pending == intel_fb->pf_seq) {
+   if (intel_fb->Base.Name == 0 && intel_rb &&
+       intel_rb->pf_pending == intel_fb->pf_seq) {
       GLint pf_pipes = intel_fb->pf_pipes;
       BATCH_LOCALS;
 
@@ -1019,16 +1020,11 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
    /*
     * How many color buffers are we drawing into?
     */
-   if (fb->_NumColorDrawBuffers[0] != 1
-#if 0
-       /* XXX FBO temporary - always use software rendering */
-       || 1
-#endif
-      ) {
+   if (fb->_NumColorDrawBuffers[0] != 1) {
       /* writing to 0 or 2 or 4 color buffers */
       /*_mesa_debug(ctx, "Software rendering\n");*/
       FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE);
-      front = 1;                /* might not have back color buffer */
+      colorRegion = NULL;
    }
    else {
       /* draw to exactly one color buffer */
@@ -1037,30 +1033,30 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
       if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) {
          front = 1;
       }
-   }
 
-   /*
-    * Get the intel_renderbuffer for the colorbuffer we're drawing into.
-    * And set up cliprects.
-    */
-   if (fb->Name == 0) {
-      /* drawing to window system buffer */
-      if (front) {
-         intelSetFrontClipRects(intel);
-         colorRegion = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
+      /*
+       * Get the intel_renderbuffer for the colorbuffer we're drawing into.
+       * And set up cliprects.
+       */
+      if (fb->Name == 0) {
+	 /* drawing to window system buffer */
+	 if (front) {
+	    intelSetFrontClipRects(intel);
+	    colorRegion = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
+	 }
+	 else {
+	    intelSetBackClipRects(intel);
+	    colorRegion = intel_get_rb_region(fb, BUFFER_BACK_LEFT);
+	 }
       }
       else {
-         intelSetBackClipRects(intel);
-         colorRegion = intel_get_rb_region(fb, BUFFER_BACK_LEFT);
+	 /* drawing to user-created FBO */
+	 struct intel_renderbuffer *irb;
+	 intelSetRenderbufferClipRects(intel);
+	 irb = intel_renderbuffer(fb->_ColorDrawBuffers[0][0]);
+	 colorRegion = (irb && irb->region) ? irb->region : NULL;
       }
    }
-   else {
-      /* drawing to user-created FBO */
-      struct intel_renderbuffer *irb;
-      intelSetRenderbufferClipRects(intel);
-      irb = intel_renderbuffer(fb->_ColorDrawBuffers[0][0]);
-      colorRegion = (irb && irb->region) ? irb->region : NULL;
-   }
 
    /* Update culling direction which changes depending on the
     * orientation of the buffer:

commit 2ac5e08d1d41377dc873b31875701f59e74242ec
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Dec 14 14:33:53 2007 -0700

    fix polygon cull regression

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 47d5035..9b9b73f 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.0.3
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
@@ -128,21 +128,17 @@ _swrast_update_polygon( GLcontext *ctx )
    GLfloat backface_sign;
 
    if (ctx->Polygon.CullFlag) {
-      backface_sign = 1.0;
       switch (ctx->Polygon.CullFaceMode) {
       case GL_BACK:
-	 if (ctx->Polygon.FrontFace == GL_CCW)
-	    backface_sign = -1.0;
+         backface_sign = -1.0;
 	 break;
       case GL_FRONT:
-	 if (ctx->Polygon.FrontFace != GL_CCW)
-	    backface_sign = -1.0;
+         backface_sign = 1.0;
 	 break;
       case GL_FRONT_AND_BACK:
          /* fallthrough */
       default:
 	 backface_sign = 0.0;
-	 break;
       }
    }
    else {

commit 1837b8c214a362ccecc441f7b6880f623e70b8d6
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Wed Oct 31 17:12:07 2007 -0700

    configs: Fix linking with static libGL and --as-needed
    
    Linking of the programs breaks when using a static libGL and the GNU ld
    option --as-needed. This is because libXext is needed for the XShm
    functions.
    (cherry picked from commit 6aaf9bdd418e11d5ccb76a6ab85a8df36b0c8804)

diff --git a/configs/linux-static b/configs/linux-static
index 2a77d4c..1ee16be 100644
--- a/configs/linux-static
+++ b/configs/linux-static
@@ -22,4 +22,5 @@ GLUT_LIB_DEPS =
 GLW_LIB_DEPS = 
 
 # Need to specify all libraries we may need
-APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
+APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \
+	-lstdc++ -lm
diff --git a/configs/linux-x86-64-static b/configs/linux-x86-64-static
index 06e6fc3..611abf0 100644
--- a/configs/linux-x86-64-static
+++ b/configs/linux-x86-64-static
@@ -20,4 +20,5 @@ OSMESA_LIB_DEPS =
 GLU_LIB_DEPS = 
 GLUT_LIB_DEPS = 
 GLW_LIB_DEPS = 
-APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
+APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \
+	-lstdc++ -lm
diff --git a/configs/linux-x86-static b/configs/linux-x86-static
index 2b6478b..645196c 100644
--- a/configs/linux-x86-static
+++ b/configs/linux-x86-static
@@ -20,4 +20,5 @@ OSMESA_LIB_DEPS =
 GLU_LIB_DEPS = 
 GLUT_LIB_DEPS = 
 GLW_LIB_DEPS = 
-APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
+APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread \
+	-lstdc++ -lm

commit 03d2bc1774e3612edca4be48c5aeafaafa2a52b1
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Dec 4 14:06:26 2007 -0700

    fix gl_FrontFacing

diff --git a/docs/relnotes-7.0.3.html b/docs/relnotes-7.0.3.html
index 640013f..173833d 100644
--- a/docs/relnotes-7.0.3.html
+++ b/docs/relnotes-7.0.3.html
@@ -32,6 +32,7 @@ Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2.
 <li>Fix crash upon GLSL variable array indexes (not yet supported)
 <li>Two-sided stencil test didn't work in software rendering
 <li>Fix two-sided lighting bugs/crashes (bug 13368)
+<li>GLSL gl_FrontFacing didn't work properly
 </ul>
 
 

commit 385bddbde04ca3ec2a159e8c8a50d9009da25b63
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Dec 4 14:06:01 2007 -0700

    fix span->facing computation and gl_FrontFacing initialization

diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 324afb9..89114eb 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -118,7 +118,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
 
    if (ctx->Shader.CurrentProgram) {
       /* Store front/back facing value in register FOGC.Y */
-      machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) span->facing;
+      machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = 1.0 - span->facing;
    }
 
    machine->CurElement = col;
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index ae30fe5..891eaf6 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -172,7 +172,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
    EdgeT eMaj, eTop, eBot;
    GLfloat oneOverArea;
    const SWvertex *vMin, *vMid, *vMax;  /* Y(vMin)<=Y(vMid)<=Y(vMax) */
-   GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign;
+   GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign;
 #if !TRIANGLE_WALK_DOUBLE
    const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); /* for x/y coord snapping */
 #endif
@@ -292,18 +292,16 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
 #else
       const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
 #endif
-      /* Do backface culling */
-
-      if (area * bf < 0.0)
+      if (IS_INF_OR_NAN(area) || area == 0.0F)
          return;
 
-      if (IS_INF_OR_NAN(area) || area == 0.0F)
+      if (area * bf * swrast->_BackfaceCullSign < 0.0)
          return;
 
       oneOverArea = 1.0F / area;
 
       /* 0 = front, 1 = back */
-      span.facing = oneOverArea * swrast->_BackfaceSign > 0.0F;
+      span.facing = oneOverArea * bf > 0.0F;
    }
 
    /* Edge setup.  For a triangle strip these could be reused... */

commit c13542626729a6fe3e4dfbc71f3569119255b668
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Dec 4 14:05:11 2007 -0700

    Fix gl_FrontFacing compilation problem

diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 675dd83..ef9c0ab 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2344,7 +2344,8 @@ _slang_gen_field(slang_assemble_ctx * A, slang_operation *oper)
       return n;
    }
    else if (   ti.spec.type == SLANG_SPEC_FLOAT
-            || ti.spec.type == SLANG_SPEC_INT) {
+            || ti.spec.type == SLANG_SPEC_INT
+            || ti.spec.type == SLANG_SPEC_BOOL) {
       const GLuint rows = 1;
       slang_swizzle swz;
       slang_ir_node *n;

commit 4be0c981205b5530366a10eb96e06b93a2439391
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Tue Dec 4 10:46:45 2007 +0100

    Use -Bsymbolic for linking all shared objects.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=10132 .
    
    Also remove comment about SONAME, as SONAME only applies to shared libraries.
    (cherry picked from commit fc7ddea8535f1a9c196bf30f7864414e4ac18b8a)

diff --git a/bin/mklib b/bin/mklib
index 499e789..0fb9930 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -209,8 +209,13 @@ case $ARCH in
 	if [ $NOPREFIX = 1 ] ; then
 	    # No "lib" or ".so" part
 	    echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
-	    #OPTS="-shared -Wl,-soname,${LIBNAME}"  # soname???
-	    OPTS="-shared"
+	    case $ARCH in 'Linux' | 'GNU' | GNU/*)
+		OPTS="-Xlinker -Bsymbolic -shared"
+	    ;;
+	    *)
+		OPTS="-shared"
+	    ;;
+	    esac
 
 	    # Check if objects are 32-bit and we're running in 64-bit
 	    # environment.  If so, pass -m32 flag to linker.

commit e760aebd5aaecc220c6789fe925897909a876acd
Author: Brian <brian@i915.localnet.net>
Date:   Mon Dec 3 14:11:46 2007 -0700

    fix two-side lighting bug/crash

diff --git a/docs/relnotes-7.0.3.html b/docs/relnotes-7.0.3.html
index 4b41c5d..640013f 100644
--- a/docs/relnotes-7.0.3.html
+++ b/docs/relnotes-7.0.3.html
@@ -31,6 +31,7 @@ Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2.
 <li>GLSL gl_FrontLightModelProduct.sceneColor variable wasn't defined
 <li>Fix crash upon GLSL variable array indexes (not yet supported)
 <li>Two-sided stencil test didn't work in software rendering
+<li>Fix two-sided lighting bugs/crashes (bug 13368)
 </ul>
 
 

commit 1f6e7d9c297aba2e936352d6ae8a4198b5c64af5
Author: Brian <brian@i915.localnet.net>
Date:   Mon Dec 3 14:11:26 2007 -0700

    fix DD_TRI_LIGHT_TWOSIDE bug (#13368)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 1c6167b..0c2bf8c 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -5,9 +5,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.1
+ * Version:  7.0.3
  *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -364,12 +364,12 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
       case GL_LIGHTING:
          if (ctx->Light.Enabled == state)
             return;
+         FLUSH_VERTICES(ctx, _NEW_LIGHT);
+         ctx->Light.Enabled = state;
          if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
             ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
          else
             ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
-         FLUSH_VERTICES(ctx, _NEW_LIGHT);
-         ctx->Light.Enabled = state;
          break;
       case GL_LINE_SMOOTH:
          if (ctx->Line.SmoothFlag == state)

commit c6d421af05ccdd377df5cade301c5c25814ddf0c
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Mon Dec 3 11:57:14 2007 -0800

    Fix the library name in glw.pc
    
    Fix a copy and paste error s/GLU/GLw/ in glw.pc.
    (cherry picked from commit 2dc85e8078bed67cb5d8bc3e16484f56c61c61ca)

diff --git a/src/glw/glw.pc.in b/src/glw/glw.pc.in
index 951e2dc..9c2682f 100644
--- a/src/glw/glw.pc.in
+++ b/src/glw/glw.pc.in
@@ -7,5 +7,5 @@ Name: glw
 Description: Mesa OpenGL widget library
 Requires: gl
 Version: @VERSION@
-Libs: -L${libdir} -lGLU
+Libs: -L${libdir} -lGLw
 Cflags: -I${includedir}

commit 952df5e493198de91b329983dae5366102eb0a25
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Mon Dec 3 11:59:40 2007 -0700

    fix two-sided stencil

diff --git a/docs/relnotes-7.0.3.html b/docs/relnotes-7.0.3.html
index 8d46989..4b41c5d 100644
--- a/docs/relnotes-7.0.3.html
+++ b/docs/relnotes-7.0.3.html
@@ -30,6 +30,7 @@ Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2.
 <li>Fix GLUT/Fortran issues
 <li>GLSL gl_FrontLightModelProduct.sceneColor variable wasn't defined
 <li>Fix crash upon GLSL variable array indexes (not yet supported)
+<li>Two-sided stencil test didn't work in software rendering
 </ul>
 
 

commit 45acb8b058fc0f61a1c2687897c5d4042b534760
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Mon Dec 3 11:58:16 2007 -0700

    added missing quote char

diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index eea8eb9..d0c19f5 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -65,7 +65,7 @@ linux-solo: depend subdirs libmesa.a
 # Stand-alone Mesa libGL, no built-in drivers (DirectFB)
 
 libgl-core: $(CORE_OBJECTS)
-	@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS) \
+	@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
 		-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
 		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \
 		$(GL_LIB_DEPS)

commit e8997c0183dbdb59884cc02af81d2faab1beaba1
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Fri Nov 30 11:40:06 2007 +0100

    i915tex: Fix up state changes for i8xx.
    
    (cherry picked from commit 2af613e0b8e6f89cc7528ff5a969e18f077e61fc)

diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
index 5555b74..e76e2e7 100644
--- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -378,9 +378,15 @@ do {							\
 } while (0)
 
 static GLuint
+get_dirty(struct i830_hw_state *state)
+{
+   return state->active & ~state->emitted;
+}
+
+static GLuint
 get_state_size(struct i830_hw_state *state)
 {
-   GLuint dirty = state->active & ~state->emitted;
+   GLuint dirty = get_dirty(state);
    GLuint sz = 0;
    GLuint i;
 
@@ -411,7 +417,7 @@ get_state_size(struct i830_hw_state *state)
 /* Push the state into the sarea and/or texture memory.
  */
 static void
-i830_emit_state(struct intel_context *intel)
+i830_do_emit_state(struct intel_context *intel)
 {
    struct i830_context *i830 = i830_context(&intel->ctx);
    struct i830_hw_state *state = i830->current;
@@ -428,10 +434,32 @@ i830_emit_state(struct intel_context *intel)
     */
    intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
 
+   /* Workaround.  There are cases I haven't been able to track down
+    * where we aren't emitting a full state at the start of a new
+    * batchbuffer.  This code spots that we are on a new batchbuffer
+    * and forces a full state emit no matter what.  
+    *
+    * In the normal case state->emitted is already zero, this code is
+    * another set of checks to make sure it really is.
+    */
+   if (intel->batch->id != intel->last_state_batch_id ||
+       intel->batch->map == intel->batch->ptr) 
+   {
+      state->emitted = 0;
+      intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
+   }
+
    /* Do this here as we may have flushed the batchbuffer above,
     * causing more state to be dirty!
     */
-   dirty = state->active & ~state->emitted;
+   dirty = get_dirty(state);
+   state->emitted |= dirty;
+   assert(get_dirty(state) == 0);
+
+   if (intel->batch->id != intel->last_state_batch_id) {
+      assert(dirty & I830_UPLOAD_CTX);
+      intel->last_state_batch_id = intel->batch->id;
+   }
 
    if (dirty & I830_UPLOAD_INVARIENT) {
       DBG("I830_UPLOAD_INVARIENT:\n");
@@ -513,7 +541,30 @@ i830_emit_state(struct intel_context *intel)
       }
    }
 
-   state->emitted |= dirty;
+   intel->batch->dirty_state &= ~dirty;
+   assert(get_dirty(state) == 0);
+}
+
+static void
+i830_emit_state(struct intel_context *intel)
+{
+   struct i830_context *i830 = i830_context(&intel->ctx);
+
+   i830_do_emit_state( intel );
+
+   /* Second chance - catch batchbuffer wrap in the middle of state
+    * emit.  This shouldn't happen but it has been observed in
+    * testing.
+    */
+   if (get_dirty( i830->current )) {
+      /* Force a full re-emit if this happens.
+       */
+      i830->current->emitted = 0;
+      i830_do_emit_state( intel );
+   }
+
+   assert(get_dirty(i830->current) == 0);
+   assert((intel->batch->dirty_state & (1<<1)) == 0);
 }
 
 static void
@@ -650,8 +701,7 @@ i830_assert_not_dirty( struct intel_context *intel )
 {
    struct i830_context *i830 = i830_context(&intel->ctx);
    struct i830_hw_state *state = i830->current;
-   GLuint dirty = state->active & ~state->emitted;
-   assert(!dirty);
+   assert(!get_dirty(state));
 }
 
 

commit 169e62f563c4eb7dfa9c456a1ee03168af6b546a
Author: Brian <brian@i915.localnet.net>
Date:   Fri Nov 30 15:52:41 2007 -0700

    fix-build: remove ctx->_Facing assignment

diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h
index 0bf32ff..6c2378f 100644
--- a/src/mesa/tnl_dd/t_dd_tritmp.h
+++ b/src/mesa/tnl_dd/t_dd_tritmp.h
@@ -155,10 +155,6 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
       {
 	 facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit;
 
-         if (DO_TWOSTENCIL && ctx->Stencil.TestTwoSide) {
-            ctx->_Facing = facing; /* mixed mode rendering: for 2-sided stencil test */
-         }
-
 	 if (DO_UNFILLED) {
 	    if (facing) {
 	       mode = ctx->Polygon.BackMode;
@@ -421,10 +417,6 @@ static void TAG(quad)( GLcontext *ctx,
       {
 	 facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit;
 
-         if (DO_TWOSTENCIL && ctx->Stencil.TestTwoSide) {
-            ctx->_Facing = facing; /* mixed mode rendering: for 2-sided stencil test */
-         }
-
 	 if (DO_UNFILLED) {
 	    if (facing) {
 	       mode = ctx->Polygon.BackMode;

commit 1b43babfb126c6318d2f2468ec81b93ee1923774
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Nov 30 13:01:42 2007 -0700

    fix broken two-sided stencil

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 754b1a7..b599638 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -977,7 +977,6 @@ init_attrib_groups(GLcontext *ctx)
    /* Miscellaneous */
    ctx->NewState = _NEW_ALL;
    ctx->ErrorValue = (GLenum) GL_NO_ERROR;
-   ctx->_Facing = 0;
 
    return GL_TRUE;
 }
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2cc0622..96c3515 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3032,12 +3032,6 @@ struct __GLcontextRec
 
    struct gl_list_extensions ListExt; /**< driver dlist extensions */
 
-
-   GLuint _Facing; /**< This is a hack for 2-sided stencil test.
-		    *
-		    * We don't have a better way to communicate this value from
-		    * swrast_setup to swrast. */
-
    /** \name For debugging/development only */
    /*@{*/
    GLboolean FirstTimeCurrent;
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index 80cec0b..074ffe8 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -141,6 +141,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
       return;
 
    INIT_SPAN(line.span, GL_LINE, 0, 0, SPAN_XY | SPAN_COVERAGE);
+   line.span.facing = swrast->PointLineFacing;
 
    line.xAdj = line.dx / line.len * line.halfWidth;
    line.yAdj = line.dy / line.len * line.halfWidth;
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 9278b5a..b26f21f 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -78,7 +78,7 @@
    GLfloat texWidth[FRAG_ATTRIB_MAX];
    GLfloat texHeight[FRAG_ATTRIB_MAX];
 #endif
-   GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign;
+   GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign;
    
    (void) swrast;
 
@@ -116,6 +116,7 @@
    majDx = vMax->win[0] - vMin->win[0];
    majDy = vMax->win[1] - vMin->win[1];
 
+   /* front/back-face determination and cullling */
    {
       const GLfloat botDx = vMid->win[0] - vMin->win[0];
       const GLfloat botDy = vMid->win[1] - vMin->win[1];
@@ -124,6 +125,8 @@
       if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area))
 	 return;
       ltor = (GLboolean) (area < 0.0F);
+
+      span.facing = area * swrast->_BackfaceSign > 0.0F;
    }
 
    /* Plane equation setup:
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 2f25edb..47d5035 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -117,8 +117,8 @@ _swrast_update_rasterflags( GLcontext *ctx )
 
 
 /**
- * Examine polycon culls tate to compute the _BackfaceSign field.
- * _BackfaceSign will be 0 if no culling, -1 if culling back-faces,
+ * Examine polycon culls tate to compute the _BackfaceCullSign field.
+ * _BackfaceCullSign will be 0 if no culling, -1 if culling back-faces,
  * and 1 if culling front-faces.  The Polygon FrontFace state also
  * factors in.
  */
@@ -149,10 +149,15 @@ _swrast_update_polygon( GLcontext *ctx )
       backface_sign = 0.0;
    }
 
-   SWRAST_CONTEXT(ctx)->_BackfaceSign = backface_sign;
+   SWRAST_CONTEXT(ctx)->_BackfaceCullSign = backface_sign;
+
+   /* This is for front/back-face determination, but not for culling */
+   SWRAST_CONTEXT(ctx)->_BackfaceSign
+      = (ctx->Polygon.FrontFace == GL_CW) ? -1.0 : 1.0;
 }
 
 
+
 /**
  * Update the _PreferPixelFog field to indicate if we need to compute
  * fog blend factors (from the fog coords) per-fragment.
@@ -721,6 +726,12 @@ _swrast_ResetLineStipple( GLcontext *ctx )
 }
 
 void
+_swrast_SetFacing(GLcontext *ctx, GLuint facing)
+{
+   SWRAST_CONTEXT(ctx)->PointLineFacing = facing;
+}
+
+void
 _swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
 {
    if (SWRAST_DEBUG) {
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index c8333b8..58841ad 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -128,7 +128,8 @@ typedef struct
     * _swrast_validate_derived():
     */
    GLbitfield _RasterMask;
-   GLfloat _BackfaceSign;
+   GLfloat _BackfaceSign;      /** +1 or -1 */
+   GLfloat _BackfaceCullSign;  /** +1, 0, or -1 */
    GLboolean _PreferPixelFog;    /* Compute fog blend factor per fragment? */
    GLboolean _AnyTextureCombine;
    GLboolean _FogEnabled;
@@ -151,6 +152,7 @@ typedef struct
    /* Working values:
     */
    GLuint StippleCounter;    /**< Line stipple counter */
+   GLuint PointLineFacing;
    GLbitfield NewState;
    GLuint StateChanges;
    GLenum Primitive;    /* current primitive being drawn (ala glBegin) */
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 7fd94c8..324afb9 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -118,7 +118,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
 
    if (ctx->Shader.CurrentProgram) {
       /* Store front/back facing value in register FOGC.Y */
-      machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
+      machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) span->facing;
    }
 
    machine->CurElement = col;
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index b6e8f28..9e240a7 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -317,6 +317,9 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
    span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
    span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
 
+   span.facing = swrast->PointLineFacing;
+
+
    /*
     * Draw
     */
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index 9436464..7dcc1fc 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -105,6 +105,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
     */
    span->interpMask = SPAN_FOG;
    span->arrayMask = SPAN_XY | SPAN_Z;
+   span->facing = swrast->PointLineFacing;
    span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->attrib[FRAG_ATTRIB_FOGC][0];
    span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0;
    span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0;
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index fc9d29b..fc40084 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -58,7 +58,7 @@ _swrast_culltriangle( GLcontext *ctx,
    GLfloat fy = v2->win[1] - v0->win[1];
    GLfloat c = ex*fy-ey*fx;
 
-   if (c * SWRAST_CONTEXT(ctx)->_BackfaceSign > 0)
+   if (c * SWRAST_CONTEXT(ctx)->_BackfaceCullSign > 0)
       return 0;
 
    return 1;
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index dcc3e95..ae30fe5 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -172,7 +172,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
    EdgeT eMaj, eTop, eBot;
    GLfloat oneOverArea;
    const SWvertex *vMin, *vMid, *vMax;  /* Y(vMin)<=Y(vMid)<=Y(vMax) */
-   GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign;
+   GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign;
 #if !TRIANGLE_WALK_DOUBLE
    const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); /* for x/y coord snapping */
 #endif
@@ -293,6 +293,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
       const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
 #endif
       /* Do backface culling */
+
       if (area * bf < 0.0)
          return;
 
@@ -300,10 +301,10 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
          return;
 
       oneOverArea = 1.0F / area;
-   }
 
-
-   span.facing = ctx->_Facing; /* for 2-sided stencil test */
+      /* 0 = front, 1 = back */
+      span.facing = oneOverArea * swrast->_BackfaceSign > 0.0F;
+   }
 
    /* Edge setup.  For a triangle strip these could be reused... */
    {
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h


Reply to: