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

mesa: Changes to 'debian-experimental'



 Makefile                              |    8 ++--
 debian/changelog                      |    4 +-
 docs/README.MINGW32                   |   22 ++++++++++---
 docs/relnotes-7.0.1.html              |    2 +
 include/GL/gl.h                       |    6 ---
 include/GL/glut.h                     |    2 -
 include/GL/mesa_wgl.h                 |    3 -
 progs/osdemos/ostest1.c               |    7 +++-
 progs/samples/Makefile.mgw            |   21 +-----------
 progs/xdemos/pbdemo.c                 |    9 ++---
 src/glu/sgi/Makefile.mgw              |   35 ++++++++++-----------
 src/glut/glx/Makefile.mgw             |   41 ++++++++++--------------
 src/mesa/Makefile.mgw                 |   52 +++++++++++++++----------------
 src/mesa/drivers/x11/fakeglx.c        |   11 ++++--
 src/mesa/shader/program.c             |    2 -
 src/mesa/shader/slang/slang_codegen.c |   56 +++++++++++++++++++++-------------
 src/mesa/shader/slang/slang_compile.c |    2 -
 src/mesa/shader/slang/slang_emit.c    |   30 +++++++++---------
 src/mesa/shader/slang/slang_ir.c      |    4 +-
 src/mesa/shader/slang/slang_ir.h      |    2 -
 20 files changed, 164 insertions(+), 155 deletions(-)

New commits:
commit 593de57fa2b1e798083d3cc4c55a5bc6dbad1ef3
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri Jul 27 20:18:21 2007 +0200

    Prepare changelog for upload.

diff --git a/debian/changelog b/debian/changelog
index 3c72d7d..b9bb460 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (7.0.1~rc2-1) UNRELEASED; urgency=low
+mesa (7.0.1~rc2-1) experimental; urgency=low
 
   [ David Nusinow ]
   * New upstream release candidate
@@ -9,7 +9,7 @@ mesa (7.0.1~rc2-1) UNRELEASED; urgency=low
     files without being cut off.  Thanks, Marc 'HE' Brockschmidt!
   * Add a shlibs file for libgl1-mesa-swx11-i686.
 
- -- Julien Cristau <jcristau@debian.org>  Fri, 27 Jul 2007 19:59:18 +0200
+ -- Julien Cristau <jcristau@debian.org>  Fri, 27 Jul 2007 20:17:48 +0200
 
 mesa (6.5.3-1) experimental; urgency=low
 

commit 04b0e43ea694aae628305574f4c606e38e669f78
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri Jul 27 19:59:38 2007 +0200

    New upstream release candidate.

diff --git a/debian/changelog b/debian/changelog
index 3fdb103..3c72d7d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (7.0.1~rc1-1) UNRELEASED; urgency=low
+mesa (7.0.1~rc2-1) UNRELEASED; urgency=low
 
   [ David Nusinow ]
   * New upstream release candidate
@@ -9,7 +9,7 @@ mesa (7.0.1~rc1-1) UNRELEASED; urgency=low
     files without being cut off.  Thanks, Marc 'HE' Brockschmidt!
   * Add a shlibs file for libgl1-mesa-swx11-i686.
 
- -- Julien Cristau <jcristau@debian.org>  Mon, 23 Jul 2007 16:29:27 +0200
+ -- Julien Cristau <jcristau@debian.org>  Fri, 27 Jul 2007 19:59:18 +0200
 
 mesa (6.5.3-1) experimental; urgency=low
 

commit 121b4ac22072a0fbd2f3ed30cafe4e69403c72c2
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Jul 27 11:12:21 2007 -0600

    More Mingw32 fixes from Zhang (zxpmyth@yahoo.com.cn)

diff --git a/docs/README.MINGW32 b/docs/README.MINGW32
index 138dd43..9477b2b 100644
--- a/docs/README.MINGW32
+++ b/docs/README.MINGW32
@@ -91,9 +91,11 @@ Running the Build:
 
 
 
-*******************This section is added by Heromyth*****************************
-Updated on 2007-7-21, by Heromyth <zxpmyth@yahoo.com.cn>
+******This section is added by Heromyth <zxpmyth@yahoo.com.cn>*************
 
+====================
+Updated on 2007-7-21
+====================
 
 Notice:
 	1) The generated DLLs are *not* compatible with the ones built
@@ -115,7 +117,7 @@ For example, run:
 , and delete all the lines where all the wgl*() functions are. Because they would 
 be conflicted with the ones in <Mesa3D-root>\include\GL\mesa_wgl.h.
 
-======= Conflicted Functions List ======
+>>>>>>>>>> Conflicted Functions List >>>>>>>>>>
 WINGDIAPI BOOL WINAPI wglCopyContext(HGLRC,HGLRC,UINT);
 WINGDIAPI HGLRC WINAPI wglCreateContext(HDC);
 WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC,int);
@@ -134,6 +136,18 @@ WINGDIAPI BOOL WINAPI wglUseFontBitmapsA(HDC,DWORD,DWORD,DWORD);
 WINGDIAPI BOOL WINAPI wglUseFontBitmapsW(HDC,DWORD,DWORD,DWORD);
 WINGDIAPI BOOL WINAPI wglUseFontOutlinesA(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT);
 WINGDIAPI BOOL WINAPI wglUseFontOutlinesW(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT);
-===================
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+====================
+Updated on 2007-7-22
+====================
+	I havn't thought that I would find a better way to solve my problems so soon. 
+I changed the method in which the import-libs and DLLs are made. After this update,
+the DLLs of MESA are more optimized and more compatible. 
+	It seems that there is no need to keep the building way of 'NO-STDCALL'.The 
+way of USING_STDCALL is so nice! The file <Mesa3D-root>\configs\config.mgw is 
+also not needed, and can be deleted safely!
+	
+
 
 *********************************************************************************
\ No newline at end of file
diff --git a/include/GL/gl.h b/include/GL/gl.h
index ff012d5..ce5e90e 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -58,11 +58,7 @@
 #  else /* for use with static link lib build of Win32 edition only */
 #    define GLAPI extern
 #  endif /* _STATIC_MESA support */
-#  if defined(__MINGW32__) && defined(GL_NO_STDCALL)  /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
-#    define GLAPIENTRY 
-#  else
-#    define GLAPIENTRY __stdcall
-#  endif
+#  define GLAPIENTRY __stdcall
 #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
 #  define GLAPI extern
 #  define GLAPIENTRY __stdcall
diff --git a/include/GL/glut.h b/include/GL/glut.h
index e286349..137b8ef 100644
--- a/include/GL/glut.h
+++ b/include/GL/glut.h
@@ -112,7 +112,7 @@ extern _CRTIMP void __cdecl exit(int);
    and redifinition of Windows system defs, also removes requirement of
    pretty much any standard windows header from this file */
 
-#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
+#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
 #	define GLUTAPIENTRY __stdcall
 #else
 #	define GLUTAPIENTRY
diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h
index 1d77457..5714723 100644
--- a/include/GL/mesa_wgl.h
+++ b/include/GL/mesa_wgl.h
@@ -81,8 +81,6 @@ WGLAPI int   GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *)
 WGLAPI int   GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
 WGLAPI int   GLAPIENTRY wglGetPixelFormat(HDC hdc);
 
-
-#if defined(GL_NO_STDCALL) || !defined(__MINGW32__)
 WGLAPI int   GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
 WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
 WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
@@ -101,7 +99,6 @@ WGLAPI int   GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, un
 WGLAPI int   GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
 WGLAPI int   GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
 WGLAPI int   GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
-#endif
 
 #ifndef __MINGW32__
 WGLAPI int   GLAPIENTRY SwapBuffers(HDC);
diff --git a/progs/samples/Makefile.mgw b/progs/samples/Makefile.mgw
index 3b2fd78..8bb975b 100644
--- a/progs/samples/Makefile.mgw
+++ b/progs/samples/Makefile.mgw
@@ -53,14 +53,9 @@
 
 TOP = ../..
 
-include $(TOP)/configs/config.mgw
-ALL_USING_STDCALL ?= 1
-GL_USING_STDCALL ?= 1
-GLUT_USING_STDCALL ?= 1
-
 CC = mingw32-gcc
 CFLAGS = -Wall -pedantic
-CFLAGS += -O2 -ffast-math
+CFLAGS += -O2 -ffast-math -D_DLL
 CFLAGS += -I$(TOP)/include -I../util
 ifeq ($(FX),1)
   CFLAGS += -DFX
@@ -68,17 +63,6 @@ endif
 
 CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK
 
-ifeq ($(GL_USING_STDCALL),0)
-  CFLAGS += -DGL_NO_STDCALL
-endif
-
-ifeq ($(GLUT_USING_STDCALL),1)
-  CFLAGS += -D_STDCALL_SUPPORTED
-else
-  CFLAGS += -DGLUT_NO_STDCALL
-endif
-
-
 LD = mingw32-g++
 LDFLAGS = -s -L$(TOP)/lib
 
@@ -87,7 +71,8 @@ LDLIBS = -lglut32 -lglu32 -lopengl32
 .c.o:
 	$(CC) -o $@ $(CFLAGS) -c $<
 %.exe: ../util/readtex.o ../util/showbuffer.o %.o
-	$(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS)
+	$(LD) -o $@ $(LDFLAGS) $(LDLIBS) $^
+
 
 all:
 	$(error Must specify <filename.exe> to build)
diff --git a/src/glu/sgi/Makefile.mgw b/src/glu/sgi/Makefile.mgw
index 43b421e..d00d97a 100644
--- a/src/glu/sgi/Makefile.mgw
+++ b/src/glu/sgi/Makefile.mgw
@@ -70,30 +70,31 @@
 TOOLS_PREFIX = mingw32-
 
 TOP = ../../..
-
 LIBDIR = $(TOP)/lib
 
-GLU_DLL = glu32.dll
-GLU_IMP = libglu32.a
-GLU_DEF = glu.def
+LIB_NAME = glu32
+DLL_EXT = .dll
+IMP_EXT = .a
+LIB_PRE = lib
+STRIP = -s
+
+AR = ar
+ARFLAGS = crus
+DLLTOOL = dlltool
 
-include $(TOP)/configs/config.mgw
-GL_USING_STDCALL ?= 1
+GLU_DLL = $(LIB_NAME)$(DLL_EXT)
+GLU_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
+GLU_DEF = $(LIB_NAME).def
 
 LDLIBS = -L$(LIBDIR) -lopengl32
-LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLU_IMP) -Wl,--output-def=$(LIBDIR)/$(GLU_DEF)
+LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
 
 CFLAGS += -DBUILD_GLU32 -D_DLL
 
-ifeq ($(GL_USING_STDCALL),1)
-  LDFLAGS += -Wl,--add-stdcall-alias
-else
-  CFLAGS += -DGL_NO_STDCALL
-endif
 
-CC = gcc
+CC = $(TOOLS_PREFIX)gcc
 CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
-CXX = g++
+CXX = $(TOOLS_PREFIX)g++
 CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
 
 AR = ar
@@ -216,9 +217,9 @@ $(LIBDIR):
 	mkdir -p $(LIBDIR)
 
 $(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
-	g++ -shared -fPIC -o $(LIBDIR)/$(GLU_DLL) $(LDFLAGS) \
-    $^ $(LDLIBS)
-
+	$(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLU_DLL) $^ $(LDLIBS)
+	$(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLU_DEF) $^
+	$(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLU_IMP) --def $(LIBDIR)/$(GLU_DEF)
 
 
 clean:
diff --git a/src/glut/glx/Makefile.mgw b/src/glut/glx/Makefile.mgw
index ae4eb6a..9fff2e1 100644
--- a/src/glut/glx/Makefile.mgw
+++ b/src/glut/glx/Makefile.mgw
@@ -74,35 +74,29 @@ TOP = ../../..
 
 LIBDIR = $(TOP)/lib
 
-GLUT_DLL = glut32.dll
-GLUT_IMP = libglut32.a
-GLUT_DEF = glut.def
+LIB_NAME = glut32
 
-include $(TOP)/configs/config.mgw
-GLUT_USING_STDCALL ?= 1
+DLL_EXT = .dll
+IMP_EXT = .a
+LIB_PRE = lib
+STRIP = -s
 
+AR = ar
+ARFLAGS = crus
+DLLTOOL = dlltool
 
+GLUT_DLL = $(LIB_NAME)$(DLL_EXT)
+GLUT_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
+GLUT_DEF = $(LIB_NAME).def
 
 LDLIBS = -L$(LIBDIR) -lwinmm -lgdi32 -luser32 -lopengl32 -lglu32 
-LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLUT_IMP) -Wl,--output-def=$(LIBDIR)/$(GLUT_DEF) 
+LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
 
 CFLAGS += -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DMESA -D_DLL
-
-ifeq ($(GL_USING_STDCALL),0)
-  CFLAGS += -DGL_NO_STDCALL
-endif
-
-ifeq ($(GLUT_USING_STDCALL),1)
-  CFLAGS += -D_STDCALL_SUPPORTED
-  LDFLAGS += -Wl,--add-stdcall-alias
-else
-  CFLAGS += -DGLUT_NO_STDCALL
-endif
-
 CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include 
 
-CC = gcc
-CXX = g++
+CC = $(TOOLS_PREFIX)gcc
+CXX = $(TOOLS_PREFIX)g++
 CXXFLAGS = $(CFLAGS)
 
 AR = ar
@@ -189,10 +183,9 @@ $(LIBDIR):
 	mkdir -p $(LIBDIR)
 
 $(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
-	$(CXX) -shared -fPIC -o $(LIBDIR)/$(GLUT_DLL) $(LDFLAGS) \
-	$^ $(LDLIBS)
-
-
+	$(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLUT_DLL) $^ $(LDLIBS)
+	$(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLUT_DEF) $^
+	$(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLUT_IMP) --def $(LIBDIR)/$(GLUT_DEF) 
 
 clean:
 	-$(call UNLINK,*.o)
\ No newline at end of file
diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw
index 3b52834..6244ded 100644
--- a/src/mesa/Makefile.mgw
+++ b/src/mesa/Makefile.mgw
@@ -69,39 +69,37 @@
 # Set this to the prefix of your build tools, i.e. mingw32-
 TOOLS_PREFIX = mingw32-
 
+ifeq ($(ICD),1)
+  LIB_NAME = mesa32
+else
+  LIB_NAME = opengl32
+endif
 
+DLL_EXT = .dll
+IMP_EXT = .a
+LIB_PRE = lib
+STRIP = -s
+
+AR = ar
+ARFLAGS = crus
+DLLTOOL = dlltool
 
 TOP = ../..
 GLIDE ?= $(TOP)/glide3
 LIBDIR = $(TOP)/lib
-ifeq ($(ICD),1)
-  GL_DLL = mesa32.dll
-  GL_IMP = libmesa32.a
-else
-  GL_DLL = opengl32.dll
-  GL_IMP = libopengl32.a
-endif
-
-GL_DEF = gl.def
 
-include $(TOP)/configs/config.mgw
-GL_USING_STDCALL ?= 1
+GL_DLL = $(LIB_NAME)$(DLL_EXT)
+GL_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
 
 MESA_LIB = libmesa.a
+CC = $(TOOLS_PREFIX)gcc
 
 LDLIBS = -lgdi32 -luser32 -liberty
-LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GL_IMP) -Wl,--output-def=$(LIBDIR)/gl.def
-
-CC = $(TOOLS_PREFIX)gcc
-CFLAGS += -DBUILD_GL32 -D_OPENGL32_ -D_DLL -DMESA_MINWARN -DNDEBUG -D_USRDLL -DGDI_EXPORTS
+LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
 
-ifeq ($(GL_USING_STDCALL),1)
-  LDFLAGS += -Wl,--add-stdcall-alias
-else
-  CFLAGS += -DGL_NO_STDCALL
-endif
+CFLAGS += -DBUILD_GL32 -D_DLL -DMESA_MINWARN
+CFLAGS += -DNDEBUG -DUSE_EXTERNAL_DXTN_LIB=1
 
-CFLAGS += -DUSE_EXTERNAL_DXTN_LIB=1
 ifeq ($(FX),1)
   CFLAGS += -I$(GLIDE)/include -DFX
   LDLIBS += -L$(GLIDE)/lib -lglide3x
@@ -112,12 +110,11 @@ else
     CFLAGS += -DUSE_MGL_NAMESPACE
     GL_DEF = drivers/windows/icd/mesa.def
   else    
-    GL_DEF = drivers/windows/gdi/mesa.def
+    GL_DEF = $(LIB_NAME).def
   endif
 endif
 
-AR = ar
-ARFLAGS = crus
+
 
 UNLINK = del $(subst /,\,$(1))
 ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
@@ -173,14 +170,17 @@ RESOURCE = $(GL_RES:.rc=.res)
 .rc.res:
 	windres -o $@ -Irc -Ocoff $<
 
+
 all: $(LIBDIR) $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP)
 
 $(LIBDIR):
 	mkdir -p $(LIBDIR)
 
 $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS) $(RESOURCE)
-	$(CC) -shared -fPIC -o $(LIBDIR)/$(GL_DLL) $(LDFLAGS) \
-	$^ $(LDLIBS)
+	$(CC) $(LDFLAGS) -o $(LIBDIR)/$(GL_DLL) $^ $(LDLIBS)
+	$(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GL_DEF) $^
+	$(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GL_IMP) --def $(LIBDIR)/$(GL_DEF)
+
 
 $(X86_OBJECTS): x86/matypes.h
 

commit cdbd5db3afc1ba3e6dca8b2af622f719324944e0
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Fri Jul 27 11:10:00 2007 -0600

    release candidate 2

diff --git a/Makefile b/Makefile
index 920e8af..bdb62ae 100644
--- a/Makefile
+++ b/Makefile
@@ -162,10 +162,10 @@ ultrix-gcc:
 
 # Rules for making release tarballs
 
-DIRECTORY = Mesa-7.0.1
-LIB_NAME = MesaLib-7.0.1
-DEMO_NAME = MesaDemos-7.0.1
-GLUT_NAME = MesaGLUT-7.0.1
+DIRECTORY = Mesa-7.0.1-rc2
+LIB_NAME = MesaLib-7.0.1-rc2
+DEMO_NAME = MesaDemos-7.0.1-rc2
+GLUT_NAME = MesaGLUT-7.0.1-rc2
 
 MAIN_FILES = \
 	$(DIRECTORY)/Makefile*						\

commit b2240f6ad4e498a73395b0406d18d2abc82c0ad4
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Thu Jul 26 15:33:39 2007 -0600

    fix bug 11731

diff --git a/docs/relnotes-7.0.1.html b/docs/relnotes-7.0.1.html
index 9c57dcc..b13087f 100644
--- a/docs/relnotes-7.0.1.html
+++ b/docs/relnotes-7.0.1.html
@@ -44,6 +44,7 @@ Mesa 7.0.1 is a stable release with bug fixes since version 7.0.
 <li>Queries of GL_INFO_LOG_LENGTH, GL_SHADER_SOURCE_LENGTH didn't include
 the terminating zero (bug 11588)
 <li>glXChooseFBConfig() in Xlib driver didn't handle GLX_STEREO flag properly
+<li>Fixed a GLSL function call bug (#11731)
 </ul>
 
 

commit 33814a55f89aa0f34692c22bd7139dc7c4653bd4
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Thu Jul 26 15:32:34 2007 -0600

    Fix function call bug 11731.  Also, fix up IR_CALL/IR_FUNC confusion.

diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 31b8d52..8b2bdd7 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.0.1
+ * Version:  7.1
  *
  * Copyright (C) 2005-2007  Brian Paul   All Rights Reserved.
  *
@@ -37,13 +37,13 @@
 
 
 
-#include "imports.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "program.h"
-#include "prog_instruction.h"
-#include "prog_parameter.h"
-#include "prog_statevars.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "shader/program.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
 #include "slang_typeinfo.h"
 #include "slang_codegen.h"
 #include "slang_compile.h"
@@ -536,7 +536,7 @@ new_not(slang_ir_node *n)
 static slang_ir_node *
 new_inlined_function_call(slang_ir_node *code, slang_label *name)
 {
-   slang_ir_node *n = new_node1(IR_FUNC, code);
+   slang_ir_node *n = new_node1(IR_CALL, code);
    assert(name);
    if (n)
       n->Label = name;
@@ -1202,17 +1202,29 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun,
       /* non-assembly function */
       inlined = slang_inline_function_call(A, fun, oper, dest);
       if (inlined && _slang_find_node_type(inlined, SLANG_OPER_RETURN)) {
-         /* This inlined function has one or more 'return' statements.
+         slang_operation *callOper;
+         /* The function we're calling has one or more 'return' statements.
           * So, we can't truly inline this function because we need to
           * implement 'return' with RET (and CAL).
+          * Nevertheless, we performed "inlining" to make a new instance
+          * of the function body to deal with static register allocation.
+          *
           * XXX check if there's one 'return' and if it's the very last
           * statement in the function - we can optimize that case.
           */
          assert(inlined->type == SLANG_OPER_BLOCK_NEW_SCOPE ||
                 inlined->type == SLANG_OPER_SEQUENCE);
-         inlined->type = SLANG_OPER_INLINED_CALL;
-         inlined->fun = fun;
-         inlined->label = _slang_label_new_unique((char*) fun->header.a_name);
+         if (_slang_function_has_return_value(fun) && !dest) {
+            assert(inlined->children[0].type == SLANG_OPER_VARIABLE_DECL);
+            assert(inlined->children[2].type == SLANG_OPER_IDENTIFIER);
+            callOper = &inlined->children[1];
+         }
+         else {
+            callOper = inlined;
+         }
+         callOper->type = SLANG_OPER_INLINED_CALL;
+         callOper->fun = fun;
+         callOper->label = _slang_label_new_unique((char*) fun->header.a_name);
       }
    }
 
@@ -1949,8 +1961,7 @@ static slang_ir_node *
 _slang_gen_return(slang_assemble_ctx * A, slang_operation *oper)
 {
    const GLboolean haveReturnValue
-      = (oper->num_children == 1 &&
-         oper->children[0].type != SLANG_OPER_VOID);
+      = (oper->num_children == 1 && oper->children[0].type != SLANG_OPER_VOID);
 
    /* error checking */
    assert(A->CurFunction);
@@ -1960,7 +1971,7 @@ _slang_gen_return(slang_assemble_ctx * A, slang_operation *oper)
       return NULL;
    }
    else if (!haveReturnValue &&
-       A->CurFunction->header.type.specifier.type != SLANG_SPEC_VOID) {
+            A->CurFunction->header.type.specifier.type != SLANG_SPEC_VOID) {
       slang_info_log_error(A->log, "return statement requires an expression");
       return NULL;
    }
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 7804e19..fe13f28 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -36,13 +36,13 @@
  ***/
 
 
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "program.h"
-#include "prog_instruction.h"
-#include "prog_parameter.h"
-#include "prog_print.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "shader/program.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
 #include "slang_builtin.h"
 #include "slang_emit.h"
 #include "slang_mem.h"
@@ -780,16 +780,18 @@ emit_label(slang_emit_info *emitInfo, const slang_ir_node *n)
 
 
 /**
- * Emit code for an inlined function call (subroutine).
+ * Emit code for a function call.
+ * Note that for each time a function is called, we emit the function's
+ * body code again because the set of available registers may be different.
  */
 static struct prog_instruction *
-emit_func(slang_emit_info *emitInfo, slang_ir_node *n)
+emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n)
 {
    struct gl_program *progSave;
    struct prog_instruction *inst;
    GLuint subroutineId;
 
-   assert(n->Opcode == IR_FUNC);
+   assert(n->Opcode == IR_CALL);
    assert(n->Label);
 
    /* save/push cur program */
@@ -1687,10 +1689,10 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n)
    case IR_KILL:
       return emit_kill(emitInfo);
 
-   case IR_FUNC:
-      /* new variable scope for subroutines/function calls*/
+   case IR_CALL:
+      /* new variable scope for subroutines/function calls */
       _slang_push_var_table(emitInfo->vt);
-      inst = emit_func(emitInfo, n);
+      inst = emit_fcall(emitInfo, n);
       _slang_pop_var_table(emitInfo->vt);
       return inst;
 
@@ -1782,7 +1784,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo)
    emitInfo->NumSubroutines = 0;
 
    /* Examine CAL instructions.
-    * At this point, the BranchTarget field of the CAL instructions is
+    * At this point, the BranchTarget field of the CAL instruction is
     * the number/id of the subroutine to call (an index into the
     * emitInfo->Subroutines list).
     * Translate that into an actual instruction location now.
diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c
index a6903cc..92e8d03 100644
--- a/src/mesa/shader/slang/slang_ir.c
+++ b/src/mesa/shader/slang/slang_ir.c
@@ -27,7 +27,7 @@
 #include "context.h"
 #include "slang_ir.h"
 #include "slang_mem.h"
-#include "prog_print.h"
+#include "shader/prog_print.h"
 
 
 static const slang_ir_info IrInfo[] = {
@@ -311,7 +311,7 @@ _slang_print_ir_tree(const slang_ir_node *n, int indent)
       printf("RETURN\n");
       break;
    case IR_CALL:
-      printf("CALL\n");
+      printf("CALL %s\n", n->Label->Name);
       break;
 
    case IR_LOOP:
diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h
index 69db4b5..c7c0ddb 100644
--- a/src/mesa/shader/slang/slang_ir.h
+++ b/src/mesa/shader/slang/slang_ir.h
@@ -62,8 +62,6 @@ typedef enum
    IR_RETURN,    /* return from subroutine */
    IR_CALL,      /* call subroutine */
 
-   IR_FUNC,      /* inlined function code */
-
    IR_LOOP,      /* high-level loop-begin / loop-end */
                  /* Children[0] = loop body */
                  /* Children[1] = loop tail code, or NULL */

commit a57c5a417be1d6b5dd8ce972327e022efea24810
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Thu Jul 26 11:39:37 2007 -0600

    generate error upon writing to varying var in fragment program (bug 11733)

diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 94cb6b3..31b8d52 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2236,7 +2236,9 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
       }
       if (var->type.qualifier == SLANG_QUAL_CONST ||
           var->type.qualifier == SLANG_QUAL_ATTRIBUTE ||
-          var->type.qualifier == SLANG_QUAL_UNIFORM) {
+          var->type.qualifier == SLANG_QUAL_UNIFORM ||
+          (var->type.qualifier == SLANG_QUAL_VARYING &&
+           A->program->Target == GL_FRAGMENT_PROGRAM_ARB)) {
          slang_info_log_error(A->log,
                               "illegal assignment to read-only variable '%s'",
                               (char *) oper->children[0].a_id);
@@ -2264,10 +2266,11 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
       lhs = _slang_gen_operation(A, &oper->children[0]);
 
       if (lhs) {
-         if (lhs->Store->File != PROGRAM_OUTPUT &&
-             lhs->Store->File != PROGRAM_TEMPORARY &&
-             lhs->Store->File != PROGRAM_VARYING &&
-             lhs->Store->File != PROGRAM_UNDEFINED) {
+         if (!(lhs->Store->File == PROGRAM_OUTPUT ||
+               lhs->Store->File == PROGRAM_TEMPORARY ||
+               (lhs->Store->File == PROGRAM_VARYING &&
+                A->program->Target == GL_VERTEX_PROGRAM_ARB) ||
+               lhs->Store->File == PROGRAM_UNDEFINED)) {
             slang_info_log_error(A->log,
                                  "illegal assignment to read-only l-value");
             return NULL;

commit ff1a28de17a0d8f43723350c29103ff3af69a73f
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Thu Jul 26 08:19:40 2007 -0600

    clamp float colors

diff --git a/progs/osdemos/ostest1.c b/progs/osdemos/ostest1.c
index 001e368..2c7adfc 100644
--- a/progs/osdemos/ostest1.c
+++ b/progs/osdemos/ostest1.c
@@ -409,6 +409,8 @@ test(GLenum type, GLint bits, const char *filename)
 
    printf("Rendering %d bit/channel image: %s\n", bits, filename);
 
+   OSMesaColorClamp(GL_TRUE);
+
    init_context();
    render_image();
    if (Gradient)
@@ -421,7 +423,7 @@ test(GLenum type, GLint bits, const char *filename)
    if (WriteFiles && filename != NULL) {
       if (type == GL_UNSIGNED_SHORT) {
          GLushort *buffer16 = (GLushort *) buffer;
-         GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4);
+         GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
          int i;
          for (i = 0; i < WIDTH * HEIGHT * 4; i++)
             buffer8[i] = buffer16[i] >> 8;
@@ -430,8 +432,9 @@ test(GLenum type, GLint bits, const char *filename)
       }
       else if (type == GL_FLOAT) {
          GLfloat *buffer32 = (GLfloat *) buffer;
-         GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4);
+         GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
          int i;
+         /* colors may be outside [0,1] so we need to clamp */
          for (i = 0; i < WIDTH * HEIGHT * 4; i++)
             buffer8[i] = (GLubyte) (buffer32[i] * 255.0);
          write_ppm(filename, buffer8, WIDTH, HEIGHT);

commit 772f57f99b5e57f6d2263808b43ebf6e4885f0d1
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Jul 24 09:56:54 2007 -0600

    call ctx->Driver.NewProgram() instead of _mesa_new_program()

diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 4205919..1f22739 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -333,7 +333,7 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog)
 {
    struct gl_program *clone;
 
-   clone = _mesa_new_program(ctx, prog->Target, prog->Id);
+   clone = ctx->Driver.NewProgram(ctx, prog->Target, prog->Id);
    if (!clone)
       return NULL;
 
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index a4dd5b8..7b2d302 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -2135,7 +2135,7 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader)
          progTarget = GL_FRAGMENT_PROGRAM_ARB;
       shader->Programs
          = (struct gl_program **) malloc(sizeof(struct gl_program*));
-      shader->Programs[0] = _mesa_new_program(ctx, progTarget, 1);
+      shader->Programs[0] = ctx->Driver.NewProgram(ctx, progTarget, 1);
       shader->NumPrograms = 1;
 
       shader->Programs[0]->Parameters = _mesa_new_parameter_list();

commit dacee32b8bbc255983577f3194da8d7197dd36f1
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Tue Jul 24 09:19:44 2007 -0600

    fix logic error, typos

diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c
index efdfdfa..7db0017 100644
--- a/progs/xdemos/pbdemo.c
+++ b/progs/xdemos/pbdemo.c
@@ -93,7 +93,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
          None
       },
       {
-         /* Single bufferd, without depth buffer */
+         /* Single buffered, without depth buffer */
          GLX_RENDER_TYPE, GLX_RGBA_BIT,
          GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
          GLX_RED_SIZE, 1,
@@ -105,7 +105,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
          None
       },
       {
-         /* Double bufferd, without depth buffer */
+         /* Double buffered, without depth buffer */
          GLX_RENDER_TYPE, GLX_RGBA_BIT,
          GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
          GLX_RED_SIZE, 1,
@@ -130,9 +130,8 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
       /* Get list of possible frame buffer configurations */
       fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs[attempt], &nConfigs);
       if (nConfigs==0 || !fbConfigs) {
-         printf("Error: glXChooseFBConfig failed\n");
-         XCloseDisplay(dpy);
-         return 0;
+         printf("Note: glXChooseFBConfig(%s) failed\n", fbString[attempt]);
+         continue;
       }
 
 #if 0 /*DEBUG*/

commit fa1a3eb06d4229dd698df097828f41416c7ee125
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Mon Jul 23 16:54:35 2007 -0600

    fix GLX_STEREO bug

diff --git a/docs/relnotes-7.0.1.html b/docs/relnotes-7.0.1.html
index 302ac1c..9c57dcc 100644
--- a/docs/relnotes-7.0.1.html
+++ b/docs/relnotes-7.0.1.html
@@ -43,6 +43,7 @@ Mesa 7.0.1 is a stable release with bug fixes since version 7.0.
 <li>Binding a zero-sized texture didn't disable texturing (bug 11309)
 <li>Queries of GL_INFO_LOG_LENGTH, GL_SHADER_SOURCE_LENGTH didn't include
 the terminating zero (bug 11588)
+<li>glXChooseFBConfig() in Xlib driver didn't handle GLX_STEREO flag properly
 </ul>
 
 

commit bd4817ca544883884bc8340d638bace58821dbd1
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Mon Jul 23 16:51:03 2007 -0600

    fix GLX_STEREO handling (bug 11705)

diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 86a4dea..50cfd99 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.2
+ * Version:  7.0.1
  *
- * 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"),
@@ -295,6 +295,11 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
       }
    }
 
+   if (stereoFlag) {
+      /* stereo not supported */
+      return NULL;
+   }
+
    /* Comparing IDs uses less memory but sometimes fails. */
    /* XXX revisit this after 3.0 is finished. */
    if (_mesa_getenv("MESA_GLX_VISUAL_HACK"))
@@ -1078,7 +1083,7 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
             else {
                stereo_flag = GL_TRUE;
             }
-            return NULL; /* stereo not supported */
+            break;
 	 case GLX_AUX_BUFFERS:
 	    parselist++;
             numAux = *parselist++;



Reply to: