[Mesa-dev] [PATCH] Fix build to use glsl_parser.hh instead of glsl_parser.h.

2012-07-13 Thread Marcin Baczyński
Commit 68e04cc6014bf7a2c9bd0b3b783b4ec12aa2e824 changed .cpp - .cc,
but forgot to update references .h - .hh.

Also update Doxygen and .gitignore.

Signed-off-by: Marcin Baczyński marb...@gmail.com
---

Fixes a build failure for me when after configuring with

$ ./autogen.sh --prefix=/usr \
--with-dri-drivers=\
--with-gallium-drivers=r600,swrast\
--enable-texture-float\
--enable-glx-tls\
--enable-vdpau

make stops with

(...)
Making all in glsl
gmake[2]: Entering directory `/data/mesa/src/glsl'
gmake[2]: *** No rule to make target `glsl_parser.h', needed by `all'.  Stop.
gmake[2]: *** Waiting for unfinished jobs

 Makefile.am |4 ++--
 doxygen/glsl.doxy   |8 
 src/glsl/.gitignore |1 +
 src/glsl/Makefile.am|2 +-
 src/glsl/glsl_lexer.ll  |2 +-
 src/glsl/glsl_parser_extras.cpp |2 +-
 6 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b2c810a..4d91ebb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,7 +59,7 @@ EXTRA_FILES = \
aclocal.m4  \
configure   \
src/glsl/glsl_parser.cc \
-   src/glsl/glsl_parser.h  \
+   src/glsl/glsl_parser.hh \
src/glsl/glsl_lexer.cc  \
src/glsl/glcpp/glcpp-lex.c  \
src/glsl/glcpp/glcpp-parse.c\
@@ -80,7 +80,7 @@ IGNORE_FILES = \
 
 parsers: configure
-@touch $(top_builddir)/configs/current
-   $(MAKE) -C src/glsl glsl_parser.cc glsl_parser.h glsl_lexer.cc
+   $(MAKE) -C src/glsl glsl_parser.cc glsl_parser.hh glsl_lexer.cc
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c 
program/program_parse.tab.h
 
diff --git a/doxygen/glsl.doxy b/doxygen/glsl.doxy
index 5411ec4..d110202 100644
--- a/doxygen/glsl.doxy
+++ b/doxygen/glsl.doxy
@@ -11,10 +11,10 @@ PROJECT_NAME   = Mesa GLSL module
 #---
 INPUT  = ../src/glsl/
 RECURSIVE  = NO
-EXCLUDE= ../src/glsl/glsl_lexer.cpp \
- ../src/glsl/glsl_lexer.h \
- ../src/glsl/glsl_parser.cpp \
- ../src/glsl/glsl_parser.h
+EXCLUDE= ../src/glsl/glsl_lexer.cc \
+ ../src/glsl/glsl_lexer.hh \
+ ../src/glsl/glsl_parser.cc \
+ ../src/glsl/glsl_parser.hh
 EXCLUDE_PATTERNS   =
 #---
 # configuration options related to the HTML output
diff --git a/src/glsl/.gitignore b/src/glsl/.gitignore
index c9a9f30..f79c2a9 100644
--- a/src/glsl/.gitignore
+++ b/src/glsl/.gitignore
@@ -4,6 +4,7 @@ glsl_lexer.cpp
 glsl_parser.cc
 glsl_parser.cpp
 glsl_parser.h
+glsl_parser.hh
 glsl_parser.output
 builtin_function.cpp
 builtin_compiler
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 2b9ca2c..8db2802 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -87,7 +87,7 @@ builtin_compiler_SOURCES = \
 
 builtin_compiler_LDADD = libglslcommon.la
 
-BUILT_SOURCES = glsl_lexer.cc glsl_parser.cc glsl_parser.h builtin_function.cpp
+BUILT_SOURCES = glsl_lexer.cc glsl_parser.cc glsl_parser.hh 
builtin_function.cpp
 CLEANFILES = $(BUILT_SOURCES)
 
 builtin_function.cpp: builtins/profiles/* builtins/ir/* builtins/glsl/* 
builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py 
builtin_compiler$(EXEEXT)
diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll
index 24cda0c..64ce415 100644
--- a/src/glsl/glsl_lexer.ll
+++ b/src/glsl/glsl_lexer.ll
@@ -26,7 +26,7 @@
 #include strtod.h
 #include ast.h
 #include glsl_parser_extras.h
-#include glsl_parser.h
+#include glsl_parser.hh
 
 static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
 
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index d9ee406..9456825 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -32,7 +32,7 @@ extern C {
 #include ralloc.h
 #include ast.h
 #include glsl_parser_extras.h
-#include glsl_parser.h
+#include glsl_parser.hh
 #include ir_optimization.h
 #include loop_analysis.h
 
-- 
1.7.8.6

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] configure: allow C{,XX}FLAGS override

2011-07-13 Thread Marcin Baczyński
---

 Without this patch CFLAGS=-fstrict-aliasing ./autogen.sh ... has no effect,
 as the flag is followed by -fno-strict-aliasing added by configure.

 configure.ac |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index eace790..ef9f4b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,10 @@ AC_INIT([Mesa],[mesa_version],
 AC_CONFIG_AUX_DIR([bin])
 AC_CANONICAL_HOST
 
+dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
+USER_CFLAGS=$CFLAGS
+USER_CXXFLAGS=$CXXFLAGS
+
 dnl Versions for external dependencies
 LIBDRM_REQUIRED=2.4.24
 LIBDRM_RADEON_REQUIRED=2.4.24
@@ -1906,6 +1910,10 @@ dnl Restore LDFLAGS and CPPFLAGS
 LDFLAGS=$_SAVE_LDFLAGS
 CPPFLAGS=$_SAVE_CPPFLAGS
 
+dnl Add user CFLAGS and CXXFLAGS
+CFLAGS=$CFLAGS $USER_CFLAGS
+CXXFLAGS=$CXXFLAGS $USER_CXXFLAGS
+
 dnl Substitute the config
 AC_CONFIG_FILES([configs/autoconf])
 
-- 
1.7.6

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] configure: fix gcc version check

2011-07-13 Thread Marcin Baczyński
---
 configure.ac |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index ef9f4b2..28c8e2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ if test x$GCC = xyes -a x$CLANG = xno; then
 GCC_VERSION=`$CC -dumpversion`
 if test $? -eq 0; then
 major=`echo $GCC_VERSION | cut -d. -f1`
-minor=`echo $GCC_VERSION | cut -d. -f1`
+minor=`echo $GCC_VERSION | cut -d. -f2`
 fi
 
 if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
-- 
1.7.6

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i915g: implement more opcodes.

2011-06-06 Thread Marcin Baczyński
2011/6/6 Stéphane Marchesin marc...@chromium.org:
 ---
  src/gallium/drivers/i915/i915_fpc_translate.c |   94 +---
  1 files changed, 82 insertions(+), 12 deletions(-)

 diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c 
 b/src/gallium/drivers/i915/i915_fpc_translate.c
 index 695a396..51766cd 100644
 --- a/src/gallium/drivers/i915/i915_fpc_translate.c
 +++ b/src/gallium/drivers/i915/i915_fpc_translate.c
 @@ -501,6 +501,17 @@ i915_translate_instruction(struct i915_fp_compile *p,
                       i915_emit_const4fv(p, cos_constants), 0);
       break;

 +  case TGSI_OPCODE_DP2:
 +      src0 = src_vector(p, inst-Src[0]);
 +      src1 = src_vector(p, inst-Src[1]);
 +
 +      i915_emit_arith(p,
 +                      A0_DP3,
 +                      get_result_vector(p, inst-Dst[0]),
 +                      get_result_flags(inst), 0,
 +                      swizzle(src0, X, Y, ZERO, ZERO), src1, 0);
 +      break;
 +
    case TGSI_OPCODE_DP3:
       emit_simple_arith(p, inst, A0_DP3, 2);
       break;
 @@ -706,7 +717,7 @@ i915_translate_instruction(struct i915_fp_compile *p,
       i915_emit_arith(p,
                       A0_RCP,
                       get_result_vector(p, inst-Dst[0]),
 -                         get_result_flags(inst), 0,
 +                      get_result_flags(inst), 0,
                       swizzle(src0, X, X, X, X), 0, 0);
       break;

 @@ -784,13 +795,36 @@ i915_translate_instruction(struct i915_fp_compile *p,
       }
       break;

 -   case TGSI_OPCODE_SGE:
 -      emit_simple_arith(p, inst, A0_SGE, 2);
 +   case TGSI_OPCODE_SEQ:
 +      /* if we're both = and = then we're == */
 +      src0 = src_vector(p, inst-Src[0]);
 +      src1 = src_vector(p, inst-Src[1]);
 +      tmp = i915_get_utemp(p);
 +
 +      i915_emit_arith(p,
 +                      A0_SGE,
 +                      tmp, A0_DEST_CHANNEL_ALL, 0,
 +                      src0,
 +                      src1, 0);
 +
 +      i915_emit_arith(p,
 +                      A0_SGE,
 +                      get_result_vector(p, inst-Dst[0]),
 +                      A0_DEST_CHANNEL_ALL, 0,
 +                      src1,
 +                      src0, 0);
 +
 +      i915_emit_arith(p,
 +                      A0_MUL,
 +                      get_result_vector(p, inst-Dst[0]),
 +                      A0_DEST_CHANNEL_ALL, 0,
 +                      get_result_vector(p, inst-Dst[0]),
 +                      tmp, 0);
 +
       break;

 -   case TGSI_OPCODE_SLE:
 -      /* like SGE, but swap reg0, reg1 */
 -      emit_simple_arith_swap2(p, inst, A0_SGE, 2);
 +   case TGSI_OPCODE_SGE:
 +      emit_simple_arith(p, inst, A0_SGE, 2);
       break;

    case TGSI_OPCODE_SIN:
 @@ -843,6 +877,11 @@ i915_translate_instruction(struct i915_fp_compile *p,
                       i915_emit_const4fv(p, sin_constants), 0);
       break;

 +   case TGSI_OPCODE_SLE:
 +      /* like SGE, but swap reg0, reg1 */
 +      emit_simple_arith_swap2(p, inst, A0_SGE, 2);
 +      break;
 +
    case TGSI_OPCODE_SLT:
       emit_simple_arith(p, inst, A0_SLT, 2);
       break;
 @@ -852,32 +891,59 @@ i915_translate_instruction(struct i915_fp_compile *p,
       emit_simple_arith_swap2(p, inst, A0_SLT, 2);
       break;

 -   case TGSI_OPCODE_SEQ:
 -      /* if we're both = and = then we're == */
 +   case TGSI_OPCODE_SNE:
 +      /* if we're neither  nor  then we're != */

Quite the opposite, I'd say ;)

       src0 = src_vector(p, inst-Src[0]);
       src1 = src_vector(p, inst-Src[1]);
       tmp = i915_get_utemp(p);

       i915_emit_arith(p,
 -                      A0_SGE,
 -                      tmp, A0_DEST_CHANNEL_ALL, 0,
 +                      A0_SLT,
 +                      tmp,
 +                      A0_DEST_CHANNEL_ALL, 0,
                       src0,
                       src1, 0);

       i915_emit_arith(p,
 -                      A0_SGE,
 +                      A0_SLT,
                       get_result_vector(p, inst-Dst[0]),
                       A0_DEST_CHANNEL_ALL, 0,
                       src1,
                       src0, 0);

       i915_emit_arith(p,
 -                      A0_MUL,
 +                      A0_ADD,
                       get_result_vector(p, inst-Dst[0]),
                       A0_DEST_CHANNEL_ALL, 0,
                       get_result_vector(p, inst-Dst[0]),
                       tmp, 0);
 +      break;

 +   case TGSI_OPCODE_SSG:
 +      /* compute (src0) - (src0) */
 +      src0 = src_vector(p, inst-Src[0]);
 +      tmp = i915_get_utemp(p);
 +
 +      i915_emit_arith(p,
 +                      A0_SLT,
 +                      tmp,
 +                      A0_DEST_CHANNEL_ALL, 0,
 +                      src0,
 +                      swizzle(src0, ZERO, ZERO, ZERO, ZERO), 0);
 +
 +      i915_emit_arith(p,
 +                      A0_SLT,
 +                      get_result_vector(p, inst-Dst[0]),
 +                      A0_DEST_CHANNEL_ALL, 0,
 +                      swizzle(src0, ZERO, ZERO, ZERO, ZERO),