From 1af6fc1b5d93e54d6674de8b5870448b29f139a7 Mon Sep 17 00:00:00 2001
From: marha <marha@users.sourceforge.net>
Date: Mon, 4 Jun 2012 09:21:39 +0200
Subject: fontconfig libX11 libXft mesa pixman xserver xkeyboard-config git
 update 4 May 2012

---
 mesalib/configs/autoconf.in                        |  9 ++++
 mesalib/configure.ac                               | 29 ++++++++++++-
 mesalib/src/SConscript                             |  1 +
 mesalib/src/glsl/ast_to_hir.cpp                    |  3 --
 mesalib/src/glsl/ralloc.c                          |  2 +-
 mesalib/src/mapi/glapi/SConscript                  | 25 +++++++++++
 mesalib/src/mapi/glapi/gen/SConscript              | 49 ++++++++++++++++++++++
 mesalib/src/mesa/Makefile                          |  1 +
 mesalib/src/mesa/SConscript                        | 15 ++++++-
 mesalib/src/mesa/drivers/common/meta.c             |  2 +-
 mesalib/src/mesa/main/attrib.c                     |  8 ++++
 mesalib/src/mesa/state_tracker/st_draw_feedback.c  |  9 ++--
 mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  4 ++
 13 files changed, 144 insertions(+), 13 deletions(-)
 create mode 100644 mesalib/src/mapi/glapi/gen/SConscript

(limited to 'mesalib')

diff --git a/mesalib/configs/autoconf.in b/mesalib/configs/autoconf.in
index 38f49a295..ce02ae6eb 100644
--- a/mesalib/configs/autoconf.in
+++ b/mesalib/configs/autoconf.in
@@ -34,8 +34,10 @@ X11_LIBS = @X11_LIBS@
 X11_CFLAGS = @X11_CFLAGS@
 LLVM_BINDIR = @LLVM_BINDIR@
 LLVM_CFLAGS = @LLVM_CFLAGS@
+LLVM_CPPFLAGS = @LLVM_CPPFLAGS@
 LLVM_CXXFLAGS = @LLVM_CXXFLAGS@
 LLVM_LDFLAGS = @LLVM_LDFLAGS@
+LLVM_LIBDIR = @LLVM_LIBDIR@
 LLVM_LIBS = @LLVM_LIBS@
 LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@
 GLW_CFLAGS = @GLW_CFLAGS@
@@ -64,6 +66,10 @@ NM = @NM@
 # Perl
 PERL = @PERL@
 
+# Indent (used for generating dispatch tables)
+INDENT = @INDENT@
+INDENT_FLAGS = @INDENT_FLAGS@
+
 # Python and flags (generally only needed by the developers)
 PYTHON2 = @PYTHON2@
 PYTHON_FLAGS = -t -O -O
@@ -187,6 +193,9 @@ VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@
 # Xorg driver install directory (for xorg state-tracker)
 XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
 
+# Path to OpenCL C library libclc
+LIBCLC_PATH = @LIBCLC_PATH@
+
 # pkg-config substitutions
 GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
 GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
diff --git a/mesalib/configure.ac b/mesalib/configure.ac
index 20bd00b67..fc1c28eb2 100644
--- a/mesalib/configure.ac
+++ b/mesalib/configure.ac
@@ -72,6 +72,11 @@ AC_PROG_LEX
 
 AC_PATH_PROG([PERL], [perl])
 
+AC_CHECK_PROG(INDENT, indent, indent, cat)
+if test "x$INDENT" != "xcat"; then
+    AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool')
+fi
+
 dnl Our fallback install-sh is a symlink to minstall. Use the existing
 dnl configuration in that case.
 AC_PROG_INSTALL
@@ -266,6 +271,7 @@ if test "x$enable_32bit" = xyes; then
     if test "x$GCC" = xyes; then
         CFLAGS="$CFLAGS -m32"
         ARCH_FLAGS="$ARCH_FLAGS -m32"
+        CCASFLAGS="$CCASFLAGS -m32"
     fi
     if test "x$GXX" = xyes; then
         CXXFLAGS="$CXXFLAGS -m32"
@@ -1615,6 +1621,14 @@ dnl
 dnl OpenCL configuration
 dnl
 
+AC_ARG_WITH([libclc-path],
+   [AS_HELP_STRING([--with-libclc-path],
+         [Path to libclc builtins library.  Example: --with-libclc-path=\$HOME/libclc/])],
+   [LIBCLC_PATH="$withval"],
+   [LIBCLC_PATH=""])
+
+AC_SUBST([LIBCLC_PATH])
+
 if test "x$enable_opencl" = xyes; then
     if test "x$with_gallium_drivers" = x; then
         AC_MSG_ERROR([cannot enable OpenCL without Gallium])
@@ -1692,7 +1706,9 @@ fi
 
 AC_SUBST([LLVM_BINDIR])
 AC_SUBST([LLVM_CFLAGS])
+AC_SUBST([LLVM_CPPFLAGS])
 AC_SUBST([LLVM_CXXFLAGS])
+AC_SUBST([LLVM_LIBDIR])
 AC_SUBST([LLVM_LIBS])
 AC_SUBST([LLVM_LDFLAGS])
 AC_SUBST([LLVM_INCLUDEDIR])
@@ -1839,11 +1855,16 @@ if test "x$enable_gallium_llvm" = xyes; then
 	    LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`"
 	else
 	    LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter`"
+            if test "x$enable_opencl" = xyes; then
+                LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs ipo linker instrumentation`"
+            fi
 	fi
 	LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
 	LLVM_BINDIR=`$LLVM_CONFIG --bindir`
 	LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags`
+	LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags`
 	LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
+	LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
 	DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`"
 	MESA_LLVM=1
     else
@@ -1973,13 +1994,18 @@ if test "x$with_gallium_drivers" != x; then
             PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
             gallium_require_drm_loader
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
-            if test "x$enable_r600_llvm" = xyes; then
+            if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
                 if test "x$LLVM_VERSION" != "x3.1"; then
                     AC_MSG_ERROR([LLVM 3.1 is required for the r600 llvm compiler.])
                 fi
                 NEED_RADEON_GALLIUM=yes;
+            fi
+            if test "x$enable_r600_llvm" = xyes; then
                 USE_R600_LLVM_COMPILER=yes;
             fi
+            if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then
+                LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs bitreader asmparser`"
+            fi
             gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
             ;;
         xradeonsi)
@@ -2075,6 +2101,7 @@ AM_CONDITIONAL(NEED_RADEON_GALLIUM, test x$NEED_RADEON_GALLIUM = xyes)
 AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
 AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
+AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
 AC_SUBST([GALLIUM_MAKE_DIRS])
 
 AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
diff --git a/mesalib/src/SConscript b/mesalib/src/SConscript
index 3d0087887..75c444677 100644
--- a/mesalib/src/SConscript
+++ b/mesalib/src/SConscript
@@ -16,6 +16,7 @@ if env['hostonly']:
 # used.  libgl-xlib and libgl-gdi adapt themselves to use the targets defined
 # in mapi/glapi-shared/SConscript.  mesa/SConscript also adapts itself to
 # enable OpenGL ES support.
+SConscript('mapi/glapi/gen/SConscript')
 SConscript('mapi/glapi/SConscript')
 SConscript('mesa/SConscript')
 
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index e23718bdb..15aa88ea9 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -3733,13 +3733,10 @@ ast_case_label::hir(exec_list *instructions,
       instructions->push_tail(set_fallthru_on_test);
    } else { /* default case */
       if (state->switch_state.previous_default) {
-	 printf("a\n");
 	 YYLTYPE loc = this->get_location();
 	 _mesa_glsl_error(& loc, state,
 			  "multiple default labels in one switch");
 
-	 printf("b\n");
-
 	 loc = state->switch_state.previous_default->get_location();
 	 _mesa_glsl_error(& loc, state,
 			  "this is the first default label");
diff --git a/mesalib/src/glsl/ralloc.c b/mesalib/src/glsl/ralloc.c
index 2f93dcdea..3da09b559 100644
--- a/mesalib/src/glsl/ralloc.c
+++ b/mesalib/src/glsl/ralloc.c
@@ -278,7 +278,7 @@ ralloc_parent(const void *ptr)
       return NULL;
 
    info = get_header(ptr);
-   return PTR_FROM_HEADER(info->parent);
+   return info->parent ? PTR_FROM_HEADER(info->parent) : NULL;
 }
 
 static void *autofree_context = NULL;
diff --git a/mesalib/src/mapi/glapi/SConscript b/mesalib/src/mapi/glapi/SConscript
index 4097a7fe1..ad007a6f4 100644
--- a/mesalib/src/mapi/glapi/SConscript
+++ b/mesalib/src/mapi/glapi/SConscript
@@ -2,6 +2,8 @@
 # SConscript for glapi
 
 
+from sys import executable as python_cmd
+
 Import('*')
 
 env = env.Clone()
@@ -47,6 +49,8 @@ for s in mapi_sources:
 # Assembly sources
 #
 if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
+    GLAPI = '#src/mapi/glapi/'
+
     if env['machine'] == 'x86':
         env.Append(CPPDEFINES = [
             'USE_X86_ASM',
@@ -54,6 +58,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
         glapi_sources += [
             'glapi_x86.S',
         ]
+        env.CodeGenerate(
+            target = 'glapi_x86.S',
+            script = GLAPI + 'gen/gl_x86_asm.py',
+            source = GLAPI + 'gen/gl_API.xml',
+            command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+            )
     elif env['machine'] == 'x86_64':
         env.Append(CPPDEFINES = [
             'USE_X86_64_ASM',
@@ -61,6 +71,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
         glapi_sources += [
             'glapi_x86-64.S'
         ]
+        env.CodeGenerate(
+            target = 'glapi_x86-64.S',
+            script = GLAPI + 'gen/gl_x86-64_asm.py',
+            source = GLAPI + 'gen/gl_API.xml',
+            command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+            )
     elif env['machine'] == 'sparc':
         env.Append(CPPDEFINES = [
             'USE_SPARC_ASM',
@@ -68,6 +84,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
         glapi_sources += [
             'glapi_sparc.S'
         ]
+        env.CodeGenerate(
+            target = 'glapi_sparc.S',
+            script = GLAPI + 'gen/gl_SPARC_asm.py',
+            source = GLAPI + 'gen/gl_API.xml',
+            command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+            )
     else:
         pass
 
@@ -81,3 +103,6 @@ glapi = env.ConvenienceLibrary(
     source = glapi_sources,
 )
 Export('glapi')
+
+
+env.Depends(glapi_sources, glapi_headers)
diff --git a/mesalib/src/mapi/glapi/gen/SConscript b/mesalib/src/mapi/glapi/gen/SConscript
new file mode 100644
index 000000000..e8bb22731
--- /dev/null
+++ b/mesalib/src/mapi/glapi/gen/SConscript
@@ -0,0 +1,49 @@
+Import('*')
+
+from sys import executable as python_cmd
+
+
+# Generate the GL API headers that are used by various parts of the
+# Mesa and GLX tree.  Other .c and .h files are generated elsewhere
+# if they're only used in one place.
+
+GLAPI = '#src/mapi/glapi/'
+
+glapi_headers = []
+
+glapi_headers += env.CodeGenerate(
+    target = '#src/mesa/main/dispatch.h',
+    script = GLAPI + 'gen/gl_table.py',
+    source = GLAPI + 'gen/gl_API.xml',
+    command = python_cmd + ' $SCRIPT -m remap_table -f $SOURCE > $TARGET',
+    )
+
+glapi_headers += env.CodeGenerate(
+    target = '#src/mapi/glapi/glapitable.h',
+    script = GLAPI + 'gen/gl_table.py',
+    source = GLAPI + 'gen/gl_API.xml',
+    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+    )
+
+glapi_headers += env.CodeGenerate(
+    target = '#src/mapi/glapi/glapitemp.h',
+    script = GLAPI + 'gen/gl_apitemp.py',
+    source = GLAPI + 'gen/gl_API.xml',
+    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+    )
+
+glapi_headers += env.CodeGenerate(
+    target = '#src/mapi/glapi/glprocs.h',
+    script = GLAPI + 'gen/gl_procs.py',
+    source = GLAPI + 'gen/gl_API.xml',
+    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+    )
+
+glapi_headers += env.CodeGenerate(
+    target = '#src/mesa/main/remap_helper.h',
+    script = GLAPI + 'gen/remap_helper.py',
+    source = GLAPI + 'gen/gl_API.xml',
+    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+    )
+
+env.Export('glapi_headers')
diff --git a/mesalib/src/mesa/Makefile b/mesalib/src/mesa/Makefile
index 069527e3a..05aea8d93 100644
--- a/mesalib/src/mesa/Makefile
+++ b/mesalib/src/mesa/Makefile
@@ -215,6 +215,7 @@ clean:
 	-@cd drivers/osmesa && $(MAKE) clean
 	-@cd x86 && $(MAKE) clean
 	-@cd x86-64 && $(MAKE) clean
+	-@cd libdricore && $(MAKE) clean
 
 
 -include $(DEPENDS)
diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript
index d7932c7c9..99bdfad46 100644
--- a/mesalib/src/mesa/SConscript
+++ b/mesalib/src/mesa/SConscript
@@ -6,6 +6,7 @@ Import('*')
 import filecmp
 import os
 import subprocess
+from sys import executable as python_cmd
 
 env = env.Clone()
 
@@ -328,8 +329,9 @@ mesa_sources = (
     statetracker_sources
 )
 
+GLAPI = '#src/mapi/glapi/'
+
 if env['gles']:
-    from sys import executable as python_cmd
 
     env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1'])
 
@@ -349,7 +351,6 @@ if env['gles']:
     )
 
     # generate GLES headers
-    GLAPI = '#src/mapi/glapi/'
     gles_headers = []
     gles_headers += env.CodeGenerate(
         target = 'main/api_exec_es1_dispatch.h',
@@ -452,6 +453,16 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
         env.Append(CPPPATH = [matypes[0].dir])
 
 
+# The enums.c file is generated from the GL/ES API.xml file
+env.CodeGenerate(
+    target = 'main/enums.c',
+    script = GLAPI + 'gen/gl_enums.py',
+    source = GLAPI + 'gen/gl_and_es_API.xml',
+    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+    )
+
+# We also depend on the auto-generated GL API headers
+env.Depends(mesa_sources, glapi_headers)
 
 
 def write_git_sha1_h_file(filename):
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index 95336fc28..a20e41972 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -1793,7 +1793,7 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
    clear->ColorLocation = _mesa_GetUniformLocationARB(clear->ShaderProg,
 						      "color");
 
-   if (ctx->Const.GLSLVersion >= 130) {
+   if (ctx->API == API_OPENGL && ctx->Const.GLSLVersion >= 130) {
       vs = compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_int_source);
       fs = compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_int_source);
 
diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c
index b114ec941..318d576e8 100644
--- a/mesalib/src/mesa/main/attrib.c
+++ b/mesalib/src/mesa/main/attrib.c
@@ -799,6 +799,14 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
             _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
                                 samp->CompareFailValue);
          }
+         if (ctx->Extensions.ARB_shadow) {
+            _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE,
+                                samp->CompareMode);
+            _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC,
+                                samp->CompareFunc);
+         }
+         if (ctx->Extensions.ARB_depth_texture)
+            _mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode);
       }
 
       /* remove saved references to the texture objects */
diff --git a/mesalib/src/mesa/state_tracker/st_draw_feedback.c b/mesalib/src/mesa/state_tracker/st_draw_feedback.c
index 4209fb214..820918e51 100644
--- a/mesalib/src/mesa/state_tracker/st_draw_feedback.c
+++ b/mesalib/src/mesa/state_tracker/st_draw_feedback.c
@@ -232,8 +232,9 @@ st_feedback_draw_vbo(struct gl_context *ctx,
          mapped_indices = ib->ptr;
       }
 
-      draw_set_index_buffer(draw, &ibuffer);
-      draw_set_mapped_index_buffer(draw, mapped_indices);
+      draw_set_indexes(draw,
+                       (ubyte *) mapped_indices + ibuffer.offset,
+                       ibuffer.index_size);
    }
 
    /* set the constant buffer */
@@ -252,9 +253,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
     * unmap vertex/index buffers
     */
    if (ib) {
-      draw_set_mapped_index_buffer(draw, NULL);
-      draw_set_index_buffer(draw, NULL);
-
+      draw_set_indexes(draw, NULL, 0);
       if (ib_transfer)
          pipe_buffer_unmap(pipe, ib_transfer);
       pipe_resource_reference(&ibuffer.buffer, NULL);
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 60a4e2831..e8d60f80d 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2810,8 +2810,12 @@ glsl_to_tgsi_visitor::glsl_to_tgsi_visitor()
    num_immediates = 0;
    current_function = NULL;
    num_address_regs = 0;
+   samplers_used = 0;
    indirect_addr_temps = false;
    indirect_addr_consts = false;
+   num_clip_distances = 0;
+   glsl_version = 0;
+   native_integers = false;
    mem_ctx = ralloc_context(NULL);
    ctx = NULL;
    prog = NULL;
-- 
cgit v1.2.3