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

mesa: Changes to 'upstream-experimental'



 .gitignore                                              |    3 
 Makefile                                                |   24 
 bin/mklib                                               |    8 
 configs/default                                         |    6 
 configs/freebsd-dri                                     |    4 
 configs/linux-dri                                       |    2 
 configs/linux-solo                                      |   13 
 docs/MiniGLX.html                                       |   13 
 docs/contents.html                                      |    2 
 docs/download.html                                      |    6 
 docs/fbdev-dri.html                                     |  213 --
 docs/intro.html                                         |   20 
 docs/news.html                                          |    7 
 docs/relnotes-6.5.3.html                                |   10 
 docs/relnotes-7.0.html                                  |   85 
 docs/relnotes.html                                      |    1 
 docs/subset.html                                        |   17 
 include/GL/gl.h                                         |    4 
 progs/Makefile                                          |    4 
 progs/glsl/Makefile                                     |    7 
 progs/glsl/deriv.c                                      |  319 +++
 progs/miniglx/miniglxtest.c                             |  239 +-
 src/Makefile                                            |    6 
 src/glut/mini/window.c                                  |    2 
 src/glx/mini/Makefile                                   |   21 
 src/glx/mini/miniglx.c                                  |    6 
 src/glx/x11/glx_pbuffer.c                               |    2 
 src/glx/x11/indirect_vertex_array.c                     |    2 
 src/mesa/drivers/dri/Makefile                           |   14 
 src/mesa/drivers/dri/Makefile.template                  |   17 
 src/mesa/drivers/dri/i915/i915_texstate.c               |    8 
 src/mesa/drivers/dri/i915/intel_tex.c                   |   34 
 src/mesa/drivers/dri/i915/server/intel_dri.c            |   27 
 src/mesa/drivers/dri/i915tex/i915_tex_layout.c          |    4 
 src/mesa/drivers/dri/i915tex/intel_tex_validate.c       |   17 
 src/mesa/drivers/dri/i915tex/server/intel_dri.c         |   55 
 src/mesa/drivers/dri/i965/brw_cc.c                      |    1 
 src/mesa/drivers/dri/i965/brw_draw.c                    |    2 
 src/mesa/drivers/dri/intel/intel_tex_layout.c           |    2 
 src/mesa/drivers/dri/r200/r200_context.c                |    1 
 src/mesa/drivers/dri/r300/.gitignore                    |    3 
 src/mesa/drivers/dri/r300/Lindent                       |    2 
 src/mesa/drivers/dri/r300/Makefile                      |   35 
 src/mesa/drivers/dri/r300/pixel_shader.h                |  103 
 src/mesa/drivers/dri/r300/r300_cmdbuf.c                 |  550 ++---
 src/mesa/drivers/dri/r300/r300_cmdbuf.h                 |   52 
 src/mesa/drivers/dri/r300/r300_context.c                |  163 -
 src/mesa/drivers/dri/r300/r300_context.h                |  274 +-
 src/mesa/drivers/dri/r300/r300_emit.c                   |  627 +++++
 src/mesa/drivers/dri/r300/r300_emit.h                   |   88 
 src/mesa/drivers/dri/r300/r300_fragprog.c               | 1681 +++++++---------
 src/mesa/drivers/dri/r300/r300_fragprog.h               |   23 
 src/mesa/drivers/dri/r300/r300_ioctl.c                  |  365 +--
 src/mesa/drivers/dri/r300/r300_ioctl.h                  |   14 
 src/mesa/drivers/dri/r300/r300_maos.c                   |  627 -----
 src/mesa/drivers/dri/r300/r300_maos.h                   |   53 
 src/mesa/drivers/dri/r300/r300_mem.c                    |  385 +++
 src/mesa/drivers/dri/r300/r300_mem.h                    |   37 
 src/mesa/drivers/dri/r300/r300_program.h                |    6 
 src/mesa/drivers/dri/r300/r300_reg.h                    |   12 
 src/mesa/drivers/dri/r300/r300_render.c                 |  571 ++---
 src/mesa/drivers/dri/r300/r300_shader.c                 |   85 
 src/mesa/drivers/dri/r300/r300_state.c                  | 1642 +++++++--------
 src/mesa/drivers/dri/r300/r300_state.h                  |   20 
 src/mesa/drivers/dri/r300/r300_tex.c                    |  388 +--
 src/mesa/drivers/dri/r300/r300_tex.h                    |    3 
 src/mesa/drivers/dri/r300/r300_texmem.c                 |  183 -
 src/mesa/drivers/dri/r300/r300_texstate.c               |  391 +--
 src/mesa/drivers/dri/r300/r300_vertprog.c               | 1179 ++++++-----
 src/mesa/drivers/dri/r300/r300_vertprog.h               |   89 
 src/mesa/drivers/dri/r300/radeon_context.c              |   14 
 src/mesa/drivers/dri/r300/radeon_context.h              |   53 
 src/mesa/drivers/dri/r300/radeon_lock.c                 |  110 -
 src/mesa/drivers/dri/r300/radeon_lock.h                 |   55 
 src/mesa/drivers/dri/r300/radeon_mm.c                   |  492 ----
 src/mesa/drivers/dri/r300/radeon_mm.h                   |   40 
 src/mesa/drivers/dri/r300/radeon_span.c                 |  233 +-
 src/mesa/drivers/dri/r300/radeon_span.h                 |   46 
 src/mesa/drivers/dri/r300/radeon_state.c                |    3 
 src/mesa/drivers/dri/r300/radeon_state.h                |    2 
 src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c             |  656 ------
 src/mesa/drivers/dri/r300/vertex_shader.h               |   92 
 src/mesa/drivers/dri/radeon/radeon_context.c            |    2 
 src/mesa/drivers/dri/radeon/radeon_context.h            |  669 +++---
 src/mesa/drivers/dri/radeon/radeon_lock.c               |  117 -
 src/mesa/drivers/dri/radeon/radeon_lock.h               |   26 
 src/mesa/drivers/dri/radeon/radeon_screen.c             |    3 
 src/mesa/drivers/dri/radeon/radeon_span.c               |  217 +-
 src/mesa/drivers/dri/radeon/radeon_span.h               |   14 
 src/mesa/drivers/x11/glxapi.c                           |    2 
 src/mesa/drivers/x11/xm_dd.c                            |   12 
 src/mesa/glapi/gl_x86_asm.py                            |   15 
 src/mesa/glapi/glapi.c                                  |   20 
 src/mesa/main/attrib.c                                  |    1 
 src/mesa/main/config.h                                  |    9 
 src/mesa/main/context.c                                 |    7 
 src/mesa/main/enable.c                                  |  132 -
 src/mesa/main/fbobject.c                                |  129 -
 src/mesa/main/image.c                                   |  171 -
 src/mesa/main/imports.c                                 |   36 
 src/mesa/main/light.c                                   |   11 
 src/mesa/main/points.c                                  |   11 
 src/mesa/main/teximage.c                                |   81 
 src/mesa/main/texobj.c                                  |   30 
 src/mesa/main/texstate.c                                |  152 -
 src/mesa/main/version.h                                 |   14 
 src/mesa/shader/arbprogram.c                            |   16 
 src/mesa/shader/prog_execute.c                          |  291 --
 src/mesa/shader/prog_execute.h                          |    3 
 src/mesa/shader/prog_statevars.c                        |   16 
 src/mesa/shader/shader_api.c                            |   10 
 src/mesa/shader/slang/library/slang_common_builtin.gc   |   49 
 src/mesa/shader/slang/library/slang_common_builtin_gc.h | 1183 +++++------
 src/mesa/shader/slang/slang_codegen.c                   |  127 -
 src/mesa/shader/slang/slang_compile.c                   |    3 
 src/mesa/shader/slang/slang_ir.c                        |    2 
 src/mesa/swrast/s_aalinetemp.h                          |    4 
 src/mesa/swrast/s_aatritemp.h                           |    6 
 src/mesa/swrast/s_feedback.c                            |  112 -
 src/mesa/swrast/s_fragprog.c                            |   15 
 src/mesa/swrast/s_pointtemp.h                           |    2 
 src/mesa/swrast/s_span.c                                |    4 
 src/mesa/swrast/s_tritemp.h                             |   12 
 src/mesa/swrast_setup/ss_context.c                      |    9 
 src/mesa/tnl/t_vb_points.c                              |   10 
 src/mesa/tnl/t_vb_program.c                             |    2 
 src/mesa/tnl/t_vertex.c                                 |   10 
 src/mesa/x86/3dnow_normal.S                             |   48 
 src/mesa/x86/glapi_x86.S                                |   15 
 129 files changed, 7748 insertions(+), 8757 deletions(-)

New commits:
commit 131baefac30e46287f0c83f43fc0e7b858877830
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Jun 22 16:41:36 2007 -0600

    fix date for 7.0 release

diff --git a/docs/intro.html b/docs/intro.html
index ec481a9..0e37322 100644
--- a/docs/intro.html
+++ b/docs/intro.html
@@ -129,7 +129,7 @@ GL_ARB_fragment_program extensions.
 </p>
 
 <p>
-May 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification
+June 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification
 and OpenGL Shading Language.
 </p>
 

commit a450078b679f3353afcdf80915837630abecc4f2
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Jun 22 16:40:17 2007 -0600

    update version

diff --git a/docs/download.html b/docs/download.html
index 1afe64e..90f5663 100644
--- a/docs/download.html
+++ b/docs/download.html
@@ -9,11 +9,7 @@
 <H1>Downloading</H1>
 
 <p>
-Last development release: <b>6.5.3</b>
-</p>
-
-<p>
-Last stable release: <b>6.4.2</b>
+Last stable release: <b>7.0</b>
 </p>
 
 <p>

commit f6b041bf6c161ac709eafc67446e6ef7a5b8a2cd
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Jun 22 15:40:46 2007 -0600

    bring in Eric's FreeBSD fixes for -pthread

diff --git a/bin/mklib b/bin/mklib
index 21d48ed..8334595 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -104,6 +104,10 @@ do
 	    # this is a special case (see bugzilla 10876)
 	    DEPS="$DEPS $1"
 	    ;;
+	'-pthread')
+	    # for FreeBSD
+	    DEPS="$DEPS -pthread"
+	    ;;
 	'-cplusplus')
 	    CPLUSPLUS=1
 	    ;;
diff --git a/configs/freebsd-dri b/configs/freebsd-dri
index 1492e4a..402883d 100644
--- a/configs/freebsd-dri
+++ b/configs/freebsd-dri
@@ -27,9 +27,9 @@ ASM_SOURCES =
 # Library/program dependencies
 LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
 LIBDRM_LIB = `pkg-config --libs libdrm`
-DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
+DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
 GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-	-lm -lpthread $(LIBDRM_LIB)
+	-lm -pthread $(LIBDRM_LIB)
 
 GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
 GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11

commit 4f340d181aa328224ce284ccbf5d6808e7236529
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Wed Jun 20 19:59:15 2007 -0600

    set tentative 7.0 release date

diff --git a/docs/news.html b/docs/news.html
index cd09e25..58aca31 100644
--- a/docs/news.html
+++ b/docs/news.html
@@ -11,7 +11,7 @@
 <H1>News</H1>
 
 
-<h2>May ???, 2007</h2>
+<h2>June 22, 2007</h2>
 <p>
 <a href="relnotes-7.0.html">Mesa 7.0</a> is released.
 This is a stable release featuring OpenGL 2.1 support.
diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html
index 6696579..c3635ce 100644
--- a/docs/relnotes-7.0.html
+++ b/docs/relnotes-7.0.html
@@ -8,7 +8,7 @@
 
 <body bgcolor="#eeeeee">
 
-<H1>Mesa 7.0 Release Notes / (<em>in progress</em>)</H1>
+<H1>Mesa 7.0 Release Notes / June 22, 2007</H1>
 
 <p>
 Mesa 7.0 is a stable release, featuring OpenGL 2.1 API support.

commit b58e38e936b2f7c332c1fd6168132276563b96f3
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Jun 12 09:52:05 2007 -0600

    fix TEXTREL problem (bug 7459)

diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html
index 9098512..6696579 100644
--- a/docs/relnotes-7.0.html
+++ b/docs/relnotes-7.0.html
@@ -12,6 +12,7 @@
 
 <p>
 Mesa 7.0 is a stable release, featuring OpenGL 2.1 API support.
+A number of bugs have been fixed since the 6.5.3 release.
 </p>
 
 
@@ -42,6 +43,7 @@ TBD
 <li>Fixed a positional light source bug (bug 11009)
 <li>Fixed point size attenuation problem (bug 11042)
 <li>glPopAttrib didn't restore texture object's LOD bias (bug 11049)
+<li>Fixed a TLS / TEXTREL problem (bug 7459)
 </ul>
 
 

commit 8713cb48a801471ee2b4d120559cfee5bee68228
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Jun 12 09:46:12 2007 -0600

    Fix TEXREL issues when using GLX_USE_TLS (see bug 7459).

diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py
index 650331a..403e872 100644
--- a/src/mesa/glapi/gl_x86_asm.py
+++ b/src/mesa/glapi/gl_x86_asm.py
@@ -82,12 +82,18 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print ''
 		print '#ifdef GLX_USE_TLS'
 		print ''
+		print '#ifdef GLX_X86_READONLY_TEXT'
+		print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)'
+		print '#else'
+		print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */'
+		print '#endif'
+		print ''
 		print '#  define GL_STUB(fn,off,fn_alt)\t\t\t\\'
 		print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
 		print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
 		print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
 		print '\tCALL(_x86_get_dispatch) ;\t\t\t\\'
-		print '\tNOP ;\t\t\t\t\t\t\\'
+		print '\tCTX_INSNS ;					\\'
 		print '\tJMP(GL_OFFSET(off))'
 		print ''
 		print '#elif defined(PTHREADS)'
@@ -138,7 +144,10 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '\tHIDDEN(GLNAME(_x86_get_dispatch))'
 		print 'ALIGNTEXT16'
 		print 'GLNAME(_x86_get_dispatch):'
-		print '\tmovl\t%gs:_glapi_tls_Dispatch@NTPOFF, %eax'
+		print '\tcall	1f'
+		print '1:\tpopl	%eax'
+		print '\taddl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %eax'
+		print '\tmovl	_glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax'
 		print '\tret'
 		print ''
 		print '#elif defined(PTHREADS)'
@@ -158,7 +167,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '#endif'
 		print ''
 
-		print '#if defined( GLX_USE_TLS )'
+		print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )'
 		print '\t\t.section\twtext, "awx", @progbits'
 		print '#endif /* defined( GLX_USE_TLS ) */'
 
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 5815dbf..47c5782 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -1028,22 +1028,24 @@ _glapi_check_table(const struct _glapi_table *table)
 #if defined(PTHREADS) || defined(GLX_USE_TLS)
 /**
  * Perform platform-specific GL API entry-point fixups.
- * 
- * 
  */
 static void
 init_glapi_relocs( void )
 {
-#if defined( USE_X86_ASM ) && defined( GLX_USE_TLS )
-    extern void * _x86_get_dispatch(void);
-    const GLubyte * const get_disp = (const GLubyte *) _x86_get_dispatch;
+#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT)
+    extern unsigned long _x86_get_dispatch(void);
+    char run_time_patch[] = {
+       0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */
+    };
+    GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */
+    const GLubyte * const get_disp = (const GLubyte *) run_time_patch;
     GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start;
 
-
+    *offset = _x86_get_dispatch();
     while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) {
-	(void) memcpy( curr_func, get_disp, 6 );
+	(void) memcpy( curr_func, get_disp, sizeof(run_time_patch));
 	curr_func += DISPATCH_FUNCTION_SIZE;
     }
-#endif /* defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) */
-}
 #endif
+}
+#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 1106eee..2ffb21b 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -58,12 +58,18 @@
 
 #ifdef GLX_USE_TLS
 
+#ifdef GLX_X86_READONLY_TEXT
+# define CTX_INSNS MOV_L(GS:(EAX), EAX)
+#else
+# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */
+#endif
+
 #  define GL_STUB(fn,off,fn_alt)			\
 ALIGNTEXT16;						\
 GLOBL_FN(GL_PREFIX(fn, fn_alt));			\
 GL_PREFIX(fn, fn_alt):					\
 	CALL(_x86_get_dispatch) ;			\
-	NOP ;						\
+	CTX_INSNS ;					\
 	JMP(GL_OFFSET(off))
 
 #elif defined(PTHREADS)
@@ -114,7 +120,10 @@ SEG_TEXT
 	HIDDEN(GLNAME(_x86_get_dispatch))
 ALIGNTEXT16
 GLNAME(_x86_get_dispatch):
-	movl	%gs:_glapi_tls_Dispatch@NTPOFF, %eax
+	call	1f
+1:	popl	%eax
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %eax
+	movl	_glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax
 	ret
 
 #elif defined(PTHREADS)
@@ -133,7 +142,7 @@ GLNAME(_x86_get_dispatch):
 EXTERN GLNAME(_glapi_get_dispatch)
 #endif
 
-#if defined( GLX_USE_TLS )
+#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )
 		.section	wtext, "awx", @progbits
 #endif /* defined( GLX_USE_TLS ) */
 

commit 277c5e57ed30c99cbd0646707889580de0c0879e
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Jun 12 08:57:39 2007 -0600

    fix GLX_USE_TLS breakage

diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c
index 973f394..0fcd3d6 100644
--- a/src/mesa/drivers/x11/glxapi.c
+++ b/src/mesa/drivers/x11/glxapi.c
@@ -141,7 +141,7 @@ static void
 SetCurrentContext(GLXContext c)
 {
 #if defined(GLX_USE_TLS)
-   CurrentContext = context;
+   CurrentContext = c;
 #elif defined(THREADS)
    _glthread_SetTSD(&ContextTSD, c);
 #else

commit b3d62d5af58f5fcc4bc2cba9995ee1d26194c8ff
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Jun 8 12:36:00 2007 -0600

    disable depthBits check in check_compatible(), see bug 11161

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ace6849..e067840 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -6,9 +6,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
+ * Version:  7.0
  *
- * 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"),
@@ -1382,8 +1382,11 @@ check_compatible(const GLcontext *ctx, const GLframebuffer *buffer)
       return GL_FALSE;
    if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask)
       return GL_FALSE;
+#if 0
+   /* disabled (see bug 11161) */
    if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits)
       return GL_FALSE;
+#endif
    if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits)
       return GL_FALSE;
 

commit 9c0f0c8d811a4de8bd47e89e279eaae143f7bf7a
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Jun 8 12:35:37 2007 -0600

    remove old comment about DEFAULT_SOFTWARE_DEPTH_BITS

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index a4de3bd..24c2567 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -5,9 +5,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.2
+ * Version:  7.0
  *
- * 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"),
@@ -240,10 +240,7 @@
 
 
 /**
- * Bits per depth buffer value.  
- *
- * Any reasonable value up to 31 will work.  32 doesn't work because of integer
- * overflow problems in the rasterizer code.
+ * Bits per depth buffer value (max is 32).
  */
 #ifndef DEFAULT_SOFTWARE_DEPTH_BITS
 #define DEFAULT_SOFTWARE_DEPTH_BITS 16

commit 18a0a2a7acd4d6da86b85072eca9262fdf8defba
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Wed May 23 16:50:22 2007 -0600

    document bug 11049 fix

diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html
index 31f7b8c..9098512 100644
--- a/docs/relnotes-7.0.html
+++ b/docs/relnotes-7.0.html
@@ -41,6 +41,7 @@ TBD
 <li>ARB vp state.light[n].half value was incorrect (bug 10987)
 <li>Fixed a positional light source bug (bug 11009)
 <li>Fixed point size attenuation problem (bug 11042)
+<li>glPopAttrib didn't restore texture object's LOD bias (bug 11049)
 </ul>
 
 

commit 8b99d9e33cae27404d4a5d8626b8581d35aef28d
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Wed May 23 16:49:19 2007 -0600

    restore GL_TEXTURE_LOD_BIAS in _mesa_PopAttrib(), bug 11049

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index e2cfb8a..0b821cf 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -764,6 +764,7 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
          _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, obj->MagFilter);
          _mesa_TexParameterf(target, GL_TEXTURE_MIN_LOD, obj->MinLod);
          _mesa_TexParameterf(target, GL_TEXTURE_MAX_LOD, obj->MaxLod);
+         _mesa_TexParameterf(target, GL_TEXTURE_LOD_BIAS, obj->LodBias);
          _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, obj->BaseLevel);
          if (target != GL_TEXTURE_RECTANGLE_ARB)
             _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel);

commit 01e7e153e37f450c44fe755bd44b02ce0cecf873
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Wed May 23 08:59:02 2007 -0600

    document point attentuation fix

diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html
index 76c5eaa..31f7b8c 100644
--- a/docs/relnotes-7.0.html
+++ b/docs/relnotes-7.0.html
@@ -40,6 +40,7 @@ TBD
 <li>The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983)
 <li>ARB vp state.light[n].half value was incorrect (bug 10987)
 <li>Fixed a positional light source bug (bug 11009)
+<li>Fixed point size attenuation problem (bug 11042)
 </ul>
 
 

commit 0ad4ca24d2494a2fbe05a11d9f161e86c6850484
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Wed May 23 08:56:45 2007 -0600

    Fix point attentuation problem (bug 11042)
    
    ctx->Point._Attentuation was computed in wrong place and the VB->Eye coord Z
    array wasn't indexed correctly in run_point_stage().

diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 9caa9ab..8674c72 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -5,9 +5,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.1
+ * Version:  7.0
  *
- * 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"),
@@ -61,10 +61,6 @@ _mesa_PointSize( GLfloat size )
 			    ctx->Point.MinSize,
 			    ctx->Point.MaxSize);
 
-   ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 ||
-                             ctx->Point.Params[1] != 0.0 ||
-                             ctx->Point.Params[2] != 0.0);
-
    if (ctx->Driver.PointSize)
       ctx->Driver.PointSize(ctx, size);
 }
@@ -122,6 +118,9 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
 	       return;
 	    FLUSH_VERTICES(ctx, _NEW_POINT);
             COPY_3V(ctx->Point.Params, params);
+            ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 ||
+                                      ctx->Point.Params[1] != 0.0 ||
+                                      ctx->Point.Params[2] != 0.0);
          }
          else {
             _mesa_error(ctx, GL_INVALID_ENUM,
diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c
index 9327f8c..1ac14fe 100644
--- a/src/mesa/tnl/t_vb_points.c
+++ b/src/mesa/tnl/t_vb_points.c
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
+ * Version:  7.0
  *
- * 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"),
@@ -50,7 +50,8 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
    if (ctx->Point._Attenuated && !ctx->VertexProgram._Current) {
       struct point_stage_data *store = POINT_STAGE_DATA(stage);
       struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-      const GLfloat (*eye)[4] = (const GLfloat (*)[4]) VB->EyePtr->data;
+      const GLfloat *eyeCoord = (GLfloat *) VB->EyePtr->data + 2;
+      const GLint eyeCoordStride = VB->EyePtr->stride / sizeof(GLfloat);
       const GLfloat p0 = ctx->Point.Params[0];
       const GLfloat p1 = ctx->Point.Params[1];
       const GLfloat p2 = ctx->Point.Params[2];
@@ -59,10 +60,11 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
       GLuint i;
 
       for (i = 0; i < VB->Count; i++) {
-         const GLfloat dist = FABSF(eye[i][2]);
+         const GLfloat dist = FABSF(*eyeCoord);
          const GLfloat q = p0 + dist * (p1 + dist * p2);
          const GLfloat atten = (q != 0.0) ? SQRTF(1.0 / q) : 1.0;
          size[i][0] = pointSize * atten; /* clamping done in rasterization */
+         eyeCoord += eyeCoordStride;
       }
 
       VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->PointSize;

commit 724a155552a81d41c1513ff156d6a893857ac905
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Mon May 21 10:55:15 2007 -0600

    if light position is local, treat it as a homogeneous coord and divide by W (see bug 11009)

diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html
index ba1d67c..76c5eaa 100644
--- a/docs/relnotes-7.0.html
+++ b/docs/relnotes-7.0.html
@@ -39,6 +39,7 @@ TBD
 <li>Specifying an invalid texture unit as a sampler could lead to a crash
 <li>The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983)
 <li>ARB vp state.light[n].half value was incorrect (bug 10987)
+<li>Fixed a positional light source bug (bug 11009)
 </ul>
 
 
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 92d8a0a..6e05761 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.0
  *
- * Copyright (C) 1999-2005  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"),
@@ -1117,6 +1117,13 @@ compute_light_positions( GLcontext *ctx )
 	 }
 	 light->_VP_inf_spot_attenuation = 1.0;
       }
+      else {
+         /* positional light w/ homogeneous coordinate, divide by W */
+         GLfloat wInv = 1.0 / light->_Position[3];
+         light->_Position[0] *= wInv;
+         light->_Position[1] *= wInv;
+         light->_Position[2] *= wInv;
+      }
 
       if (light->_Flags & LIGHT_SPOT) {
 	 if (ctx->_NeedEyeCoords) {

commit d38b74a3163d14fc0fe82048250168c2af802355
Author: Roland Scheidegger <sroland@tungstengraphics.com>
Date:   Sat May 19 04:38:55 2007 +0200

    fix miptree layout (i915) for small compressed mipmaps
    
    This seems to work now. Also fix i945 set_level_info, need to match i915
    behaviour for storing mip height, as it's assumed to be the mip width
    (in texels) elsewhere and the division by 4 is done later (untested).

diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
index 2e1600c..9f40706 100644
--- a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
@@ -161,11 +161,9 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
             if (mt->compressed)
                img_height = MAX2(1, height / 4);
             else
-               img_height = MAX2(2, height);
+               img_height = (MAX2(2, height) + 1) & ~1;
 
 	    mt->total_height += img_height;
-	    mt->total_height += 1;
-	    mt->total_height &= ~1;
 
             width = minify(width);
             height = minify(height);
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c
index f356480..fcb5cc3 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_layout.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c
@@ -74,7 +74,7 @@ void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
       GLuint img_height;
 
       intel_miptree_set_level_info(mt, level, 1, x, y, width, 
-				   mt->compressed ? height/4 : height, 1);
+				   height, 1);
 
       if (mt->compressed)
 	 img_height = MAX2(1, height/4);

commit 54cab4b47b380d5cf5dde6524fa34f40ee3b275d
Author: Roland Scheidegger <sroland@tungstengraphics.com>
Date:   Sat May 19 03:08:45 2007 +0200

    fix copy & paste bug of previous commit, breaking dxt5 formats

diff --git a/src/mesa/drivers/dri/i915/intel_tex.c b/src/mesa/drivers/dri/i915/intel_tex.c
index 46f49e7..98ddc79 100644
--- a/src/mesa/drivers/dri/i915/intel_tex.c
+++ b/src/mesa/drivers/dri/i915/intel_tex.c
@@ -652,6 +652,7 @@ static void intelUploadTexImage( intelContextPtr intel,
 	case GL_RGBA_S3TC:
 	case GL_RGBA4_S3TC:
 	case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+	case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
 	  row_len = (image->Width * 4 + 15) & ~15;
 	  break;
 	default:

commit c093666bc57dd9afead69256eaf05fbe4f6beecb
Author: Roland Scheidegger <sroland@tungstengraphics.com>
Date:   Sat May 19 00:59:06 2007 +0200

    fix miptree comparison with compressed textures
    
    TexelBytes is always 0 with compressed textures, thus would never match
    mt->cpp. This caused constant blitting around of textures, and it fixes at
    least the horrible performance of Q3 if compressed textures are enabled.

diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
index 79d587a..0ae4fee 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
@@ -105,6 +105,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
 {
    struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
    struct intel_texture_object *intelObj = intel_texture_object(tObj);
+   int comp_byte = 0;
+   int cpp;
 
    GLuint face, i;
    GLuint nr_faces = 0;
@@ -148,6 +150,12 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
       intel_miptree_reference(&intelObj->mt, firstImage->mt);
    }
 
+   if (firstImage->base.IsCompressed) {
+      comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat);
+      cpp = comp_byte;
+   }
+   else cpp = firstImage->base.TexFormat->TexelBytes;
+
    /* Check tree can hold all active levels.  Check tree matches
     * target, imageFormat, etc.
     * 
@@ -165,7 +173,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
 	intelObj->mt->width0 != firstImage->base.Width ||
 	intelObj->mt->height0 != firstImage->base.Height ||
 	intelObj->mt->depth0 != firstImage->base.Depth ||
-	intelObj->mt->cpp != firstImage->base.TexFormat->TexelBytes ||
+	intelObj->mt->cpp != cpp ||
 	intelObj->mt->compressed != firstImage->base.IsCompressed)) {
       intel_miptree_release(intel, &intelObj->mt);
    }
@@ -174,10 +182,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
    /* May need to create a new tree:
     */
    if (!intelObj->mt) {
-      int comp_byte = 0;
-      
-      if (firstImage->base.IsCompressed)
-	 comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat);
       intelObj->mt = intel_miptree_create(intel,
                                           intelObj->base.Target,
                                           firstImage->base.InternalFormat,
@@ -186,8 +190,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
                                           firstImage->base.Width,
                                           firstImage->base.Height,
                                           firstImage->base.Depth,
-                                          firstImage->base.TexFormat->
-                                          TexelBytes,
+                                          cpp,
                                           comp_byte);
    }
 

commit 04972f6761489cb85d735384b33d5e52fce127be
Author: Roland Scheidegger <sroland@tungstengraphics.com>
Date:   Sat May 19 00:45:38 2007 +0200

    fix small s3tc mipmaps (#10968)
    
    make sure that always whole blocks are uploaded.
    (May still not work correctly if the top mip map is not at least a full block,
    that is 4 pixels wide - not sure, but probably doesn't happen in real world)

diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index 3b639e7..9f0c949 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -172,12 +172,8 @@ static void i915LayoutTextureImages( i915ContextPtr i915,
 	 
 	 t->intel.image[0][i].offset = total_height * pitch;
 	 t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
-	 if (t->intel.image[0][i].image->IsCompressed)
-	 {
-	   if (t->intel.image[0][i].image->Height > 4)
-	     total_height += t->intel.image[0][i].image->Height/4;
-	   else
-	     total_height += 1;
+	 if (t->intel.image[0][i].image->IsCompressed) {
+	    total_height += (t->intel.image[0][i].image->Height + 3) / 4;
 	 }
 	 else
 	   total_height += MAX2(2, t->intel.image[0][i].image->Height);
diff --git a/src/mesa/drivers/dri/i915/intel_tex.c b/src/mesa/drivers/dri/i915/intel_tex.c
index 6012d3e..46f49e7 100644
--- a/src/mesa/drivers/dri/i915/intel_tex.c
+++ b/src/mesa/drivers/dri/i915/intel_tex.c
@@ -634,18 +634,12 @@ static void intelUploadTexImage( intelContextPtr intel,
 			       image->Height);
    }
    else if (image->IsCompressed) {
-      GLuint row_len = image->Width * 2;
+      GLuint row_len = 0;
       GLubyte *dst = (GLubyte *)(t->BufAddr + offset);
       GLubyte *src = (GLubyte *)image->Data;
       GLuint j;
 
-      if (INTEL_DEBUG & DEBUG_TEXTURE)
-	 fprintf(stderr, 
-		 "Upload image %dx%dx%d offset %xm row_len %x "
-		 "pitch %x depth_pitch %x\n",
-		 image->Width, image->Height, image->Depth, offset,
-		 row_len, t->Pitch, t->depth_pitch);
-
+      /* must always copy whole blocks (8/16 bytes) */
       switch (image->InternalFormat) {
 	case GL_COMPRESSED_RGB_FXT1_3DFX:
 	case GL_COMPRESSED_RGBA_FXT1_3DFX:
@@ -653,24 +647,31 @@ static void intelUploadTexImage( intelContextPtr intel,
 	case GL_RGB4_S3TC:
 	case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
 	case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
-	  for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
-	    __memcpy(dst, src, row_len );
-	    src += row_len;
-	  }
+	  row_len = (image->Width * 2 + 7) & ~7;
 	  break;
 	case GL_RGBA_S3TC:
 	case GL_RGBA4_S3TC:
 	case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
-	case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
-	  for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
-	    __memcpy(dst, src, (image->Width*4) );
-	    src += image->Width*4;
-	  }
+	  row_len = (image->Width * 4 + 15) & ~15;
 	  break;
 	default:
 	  fprintf(stderr,"Internal Compressed format not supported %d\n", image->InternalFormat);
 	  break;
       }
+
+      if (INTEL_DEBUG & DEBUG_TEXTURE)
+	 fprintf(stderr, 
+		 "Upload image %dx%dx%d offset %xm row_len %x "
+		 "pitch %x depth_pitch %x\n",
+		 image->Width, image->Height, image->Depth, offset,
+		 row_len, t->Pitch, t->depth_pitch);
+
+      if (row_len) {
+	 for (j = 0 ; j < (image->Height + 3)/4 ; j++, dst += (t->Pitch)) {
+	   __memcpy(dst, src, row_len );
+	   src += row_len;
+	 }
+      }
    }
    /* Time for another vtbl entry:
     */

commit 67f823462267a743a096c947b8f04d1a43fe83c9
Author: Brian <brian@yutani.localnet.net>
Date:   Fri May 18 09:41:34 2007 -0600

    set version to 7.0

diff --git a/include/GL/gl.h b/include/GL/gl.h
index 78a00ae..fa0f891 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.1
+ * Version:  7.0
  *
- * 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"),

commit 201d6dbd9c7f335521ad2e554b5ecccb0868abd4
Author: Brian <brian@yutani.localnet.net>
Date:   Fri May 18 09:35:18 2007 -0600

    fix STATE_HALF_VECTOR value (bug 10987)

diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html
index 0430c88..ba1d67c 100644
--- a/docs/relnotes-7.0.html
+++ b/docs/relnotes-7.0.html
@@ -38,6 +38,7 @@ TBD
 <li>GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords)
 <li>Specifying an invalid texture unit as a sampler could lead to a crash
 <li>The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983)
+<li>ARB vp state.light[n].half value was incorrect (bug 10987)
 </ul>
 
 
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 953fbb9..975a617 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.0
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
@@ -121,17 +121,17 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
             return;
          case STATE_HALF_VECTOR:
             {
-               GLfloat eye_z[] = {0, 0, 1};
-					
+               static const GLfloat eye_z[] = {0, 0, 1};
+               GLfloat p[3];
                /* Compute infinite half angle vector:
-                *   half-vector = light_position + (0, 0, 1) 
-                * and then normalize.  w = 0
-		*
+                *   halfVector = normalize(normalize(lightPos) + (0, 0, 1))
 		* light.EyePosition.w should be 0 for infinite lights.
                 */
-	       ADD_3V(value, eye_z, ctx->Light.Light[ln].EyePosition);
+               COPY_3V(p, ctx->Light.Light[ln].EyePosition);
+               NORMALIZE_3FV(p);
+	       ADD_3V(value, p, eye_z);
 	       NORMALIZE_3FV(value);
-	       value[3] = 0;
+	       value[3] = 1.0;
             }						  
             return;
 	 case STATE_POSITION_NORMALIZED:

commit fbcac5aa8316354cbd6bb4b13df867a0c7e7c7f1
Author: Ian Romanick <idr@us.ibm.com>
Date:   Thu May 17 11:13:41 2007 -0700

    Refactor determining whether a texture target can use compressed format

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 9fb430f..c8ce79e 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c



Reply to: