summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/glsl
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-02-20 22:51:21 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-02-20 22:51:21 +0000
commite6e3394a78b6d19474b3aea1458d8718d19d8325 (patch)
treefe92a58246a2181ba1459d22b92fbfc629b3cbb9 /dist/Mesa/src/glsl
parent8bb43317c5713539f43fcdcb25a30cf59aa981d6 (diff)
Import Mesa 10.2.9
Diffstat (limited to 'dist/Mesa/src/glsl')
-rw-r--r--dist/Mesa/src/glsl/Android.mk4
-rw-r--r--dist/Mesa/src/glsl/Makefile.am23
-rw-r--r--dist/Mesa/src/glsl/Makefile.in288
-rw-r--r--dist/Mesa/src/glsl/Makefile.sources9
-rw-r--r--dist/Mesa/src/glsl/README16
-rw-r--r--dist/Mesa/src/glsl/ast_array_index.cpp26
-rw-r--r--dist/Mesa/src/glsl/builtin_functions.cpp274
-rw-r--r--dist/Mesa/src/glsl/builtin_types.cpp81
-rw-r--r--dist/Mesa/src/glsl/builtin_variables.cpp41
-rw-r--r--dist/Mesa/src/glsl/glcpp/glcpp.h15
-rw-r--r--dist/Mesa/src/glsl/glcpp/pp.c96
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/000-content-with-spaces.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/001-define.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/002-define-chain.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/004-define-recursive.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/005-define-composite-chain.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/008-define-empty.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/009-undef.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/010-undef-re-define.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/011-define-func-empty.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/012-define-func-no-args.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/017-define-func-2-args.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/021-define-func-compose.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c21
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected22
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/040-token-pasting.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/041-if-0.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/042-if-1.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/043-if-0-else.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/044-if-1-else.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/045-if-0-elif.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/046-if-1-elsif.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/047-if-elif-else.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/048-if-nested.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/050-if-defined.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/051-if-relational.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/052-if-bitwise.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/054-if-with-macros.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/057-empty-arguments.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/064-version.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/065-if-defined-parens.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/068-accidental-pasting.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/069-repeated-argument.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/071-punctuator.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/074-elif-undef.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/077-else-without-if.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/078-elif-without-if.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/079-endif-without-if.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/080-if-without-expression.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/081-elif-without-expression.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/082-invalid-paste.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/083-unterminated-if.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/087-if-comments.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c2
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/090-hash-error.c.expected4
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/091-hash-line.c.expected5
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/096-paste-twice.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/099-c99-example.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/100-macro-with-colon.c.expected5
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/101-macros-used-twice.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/104-hash-line-followed-by-code.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/105-multiline-hash-line.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/106-multiline-hash-if.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/107-multiline-hash-elif.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/108-no-space-after-hash-version.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/109-no-space-after-hash-line.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/115-line-continuations.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/118-comment-becomes-space.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/119-elif-after-else.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/121-comment-bug-72686.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glsl_symbol_table.h35
-rw-r--r--dist/Mesa/src/glsl/hir_field_selection.cpp1
-rw-r--r--dist/Mesa/src/glsl/ir_basic_block.cpp9
-rw-r--r--dist/Mesa/src/glsl/ir_builder.cpp24
-rw-r--r--dist/Mesa/src/glsl/ir_builder.h4
-rw-r--r--dist/Mesa/src/glsl/ir_expression_flattening.cpp6
-rw-r--r--dist/Mesa/src/glsl/ir_hierarchical_visitor.cpp196
-rw-r--r--dist/Mesa/src/glsl/ir_rvalue_visitor.h6
-rw-r--r--dist/Mesa/src/glsl/ir_uniform.h29
-rw-r--r--dist/Mesa/src/glsl/ir_variable_refcount.cpp2
-rw-r--r--dist/Mesa/src/glsl/link_atomics.cpp21
-rw-r--r--dist/Mesa/src/glsl/link_interface_blocks.cpp16
-rw-r--r--dist/Mesa/src/glsl/link_uniform_block_active_visitor.cpp89
-rw-r--r--dist/Mesa/src/glsl/link_uniform_block_active_visitor.h5
-rw-r--r--dist/Mesa/src/glsl/link_uniform_blocks.cpp32
-rw-r--r--dist/Mesa/src/glsl/link_uniform_initializers.cpp33
-rw-r--r--dist/Mesa/src/glsl/link_uniforms.cpp269
-rw-r--r--dist/Mesa/src/glsl/link_varyings.cpp127
-rw-r--r--dist/Mesa/src/glsl/link_varyings.h17
-rw-r--r--dist/Mesa/src/glsl/list.h664
-rw-r--r--dist/Mesa/src/glsl/loop_controls.cpp21
-rw-r--r--dist/Mesa/src/glsl/loop_unroll.cpp19
-rw-r--r--dist/Mesa/src/glsl/lower_discard.cpp4
-rw-r--r--dist/Mesa/src/glsl/lower_named_interface_blocks.cpp4
-rw-r--r--dist/Mesa/src/glsl/lower_offset_array.cpp13
-rw-r--r--dist/Mesa/src/glsl/lower_output_reads.cpp4
-rw-r--r--dist/Mesa/src/glsl/lower_packed_varyings.cpp14
-rw-r--r--dist/Mesa/src/glsl/lower_texture_projection.cpp2
-rw-r--r--dist/Mesa/src/glsl/lower_ubo_reference.cpp237
-rw-r--r--dist/Mesa/src/glsl/opt_algebraic.cpp212
-rw-r--r--dist/Mesa/src/glsl/opt_array_splitting.cpp19
-rw-r--r--dist/Mesa/src/glsl/opt_cse.cpp22
-rw-r--r--dist/Mesa/src/glsl/opt_dead_builtin_varyings.cpp2
-rw-r--r--dist/Mesa/src/glsl/opt_dead_code.cpp37
-rw-r--r--dist/Mesa/src/glsl/opt_flip_matrices.cpp3
-rw-r--r--dist/Mesa/src/glsl/opt_vectorize.cpp16
-rw-r--r--dist/Mesa/src/glsl/standalone_scaffolding.cpp32
-rw-r--r--dist/Mesa/src/glsl/standalone_scaffolding.h3
-rw-r--r--dist/Mesa/src/glsl/test_optpass.cpp5
-rw-r--r--dist/Mesa/src/glsl/tests/builtin_variable_test.cpp41
-rw-r--r--dist/Mesa/src/glsl/tests/copy_constant_to_storage_tests.cpp30
-rw-r--r--dist/Mesa/src/glsl/tests/general_ir_test.cpp1
-rw-r--r--dist/Mesa/src/glsl/tests/invalidate_locations_test.cpp2
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/create_test_cases.py2
-rwxr-xr-xdist/Mesa/src/glsl/tests/optimization-test8
-rw-r--r--dist/Mesa/src/glsl/tests/sampler_types_test.cpp1
-rw-r--r--dist/Mesa/src/glsl/tests/set_uniform_initializer_tests.cpp13
-rw-r--r--dist/Mesa/src/glsl/tests/uniform_initializer_utils.cpp9
-rw-r--r--dist/Mesa/src/glsl/tests/uniform_initializer_utils.h3
-rw-r--r--dist/Mesa/src/glsl/tests/varyings_test.cpp2
173 files changed, 1137 insertions, 2285 deletions
diff --git a/dist/Mesa/src/glsl/Android.mk b/dist/Mesa/src/glsl/Android.mk
index 1cbc5c6d2..7b1fa7e53 100644
--- a/dist/Mesa/src/glsl/Android.mk
+++ b/dist/Mesa/src/glsl/Android.mk
@@ -39,7 +39,6 @@ LOCAL_SRC_FILES := \
$(LIBGLSL_FILES)
LOCAL_C_INCLUDES := \
- $(MESA_TOP)/src \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa
@@ -60,11 +59,10 @@ LOCAL_SRC_FILES := \
$(GLSL_COMPILER_CXX_FILES)
LOCAL_C_INCLUDES := \
- $(MESA_TOP)/src \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa
-LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_glsl_utils libmesa_util
+LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_glsl_utils
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := glsl_compiler
diff --git a/dist/Mesa/src/glsl/Makefile.am b/dist/Mesa/src/glsl/Makefile.am
index 43d070207..fd0e837d1 100644
--- a/dist/Mesa/src/glsl/Makefile.am
+++ b/dist/Mesa/src/glsl/Makefile.am
@@ -21,7 +21,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
- -I$(top_srcdir)/src \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa/ \
-I$(top_srcdir)/src/glsl/glcpp \
@@ -33,9 +32,9 @@ AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
include Makefile.sources
TESTS = glcpp/tests/glcpp-test \
- glcpp/tests/glcpp-test-cr-lf \
tests/general-ir-test \
tests/optimization-test \
+ tests/ralloc-test \
tests/sampler-types-test \
tests/uniform-initializer-test
@@ -48,12 +47,14 @@ check_PROGRAMS = \
glcpp/glcpp \
glsl_test \
tests/general-ir-test \
+ tests/ralloc-test \
tests/sampler-types-test \
tests/uniform-initializer-test
noinst_PROGRAMS = glsl_compiler
tests_general_ir_test_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c\
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -71,6 +72,7 @@ tests_general_ir_test_LDADD = \
$(PTHREAD_LIBS)
tests_uniform_initializer_test_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c\
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -85,6 +87,14 @@ tests_uniform_initializer_test_LDADD = \
$(top_builddir)/src/glsl/libglsl.la \
$(PTHREAD_LIBS)
+tests_ralloc_test_SOURCES = \
+ tests/ralloc_test.cpp \
+ $(top_builddir)/src/glsl/ralloc.c
+tests_ralloc_test_CFLAGS = $(PTHREAD_CFLAGS)
+tests_ralloc_test_LDADD = \
+ $(top_builddir)/src/gtest/libgtest.la \
+ $(PTHREAD_LIBS)
+
tests_sampler_types_test_SOURCES = \
$(top_srcdir)/src/mesa/program/prog_hash_table.c\
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -97,8 +107,6 @@ tests_sampler_types_test_LDADD = \
$(top_builddir)/src/glsl/libglsl.la \
$(PTHREAD_LIBS)
-libglcpp_la_LIBADD = \
- $(top_builddir)/src/util/libmesautil.la
libglcpp_la_SOURCES = \
glcpp/glcpp-lex.c \
glcpp/glcpp-parse.c \
@@ -106,7 +114,6 @@ libglcpp_la_SOURCES = \
glcpp_glcpp_SOURCES = \
glcpp/glcpp.c \
- tests/common.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c
glcpp_glcpp_LDADD = \
libglcpp.la \
@@ -119,6 +126,7 @@ libglsl_la_SOURCES = \
$(LIBGLSL_FILES)
glsl_compiler_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c \
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -129,6 +137,7 @@ glsl_compiler_LDADD = \
$(PTHREAD_LIBS)
glsl_test_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c \
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -137,9 +146,7 @@ glsl_test_SOURCES = \
test.cpp \
test_optpass.cpp
-glsl_test_LDADD = \
- libglsl.la \
- $(PTHREAD_LIBS)
+glsl_test_LDADD = libglsl.la
# We write our own rules for yacc and lex below. We'd rather use automake,
# but automake makes it especially difficult for a number of reasons:
diff --git a/dist/Mesa/src/glsl/Makefile.in b/dist/Mesa/src/glsl/Makefile.in
index ddf181e48..d6c26d132 100644
--- a/dist/Mesa/src/glsl/Makefile.in
+++ b/dist/Mesa/src/glsl/Makefile.in
@@ -106,20 +106,19 @@ target_triplet = @target@
DIST_COMMON = $(srcdir)/Makefile.sources $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/bin/depcomp \
$(top_srcdir)/bin/test-driver README TODO
-TESTS = glcpp/tests/glcpp-test glcpp/tests/glcpp-test-cr-lf \
- tests/general-ir-test$(EXEEXT) tests/optimization-test \
+TESTS = glcpp/tests/glcpp-test tests/general-ir-test$(EXEEXT) \
+ tests/optimization-test tests/ralloc-test$(EXEEXT) \
tests/sampler-types-test$(EXEEXT) \
tests/uniform-initializer-test$(EXEEXT)
check_PROGRAMS = glcpp/glcpp$(EXEEXT) glsl_test$(EXEEXT) \
- tests/general-ir-test$(EXEEXT) \
+ tests/general-ir-test$(EXEEXT) tests/ralloc-test$(EXEEXT) \
tests/sampler-types-test$(EXEEXT) \
tests/uniform-initializer-test$(EXEEXT)
noinst_PROGRAMS = glsl_compiler$(EXEEXT)
subdir = src/glsl
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/ax_gcc_builtin.m4 \
- $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \
$(top_srcdir)/m4/ax_prog_bison.m4 \
$(top_srcdir)/m4/ax_prog_flex.m4 \
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -132,8 +131,8 @@ mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
-libglcpp_la_DEPENDENCIES = $(top_builddir)/src/util/libmesautil.la
-am__objects_1 = pp.lo
+libglcpp_la_LIBADD =
+am__objects_1 = ralloc.lo pp.lo
am_libglcpp_la_OBJECTS = glcpp-lex.lo glcpp-parse.lo $(am__objects_1)
libglcpp_la_OBJECTS = $(am_libglcpp_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
@@ -157,8 +156,7 @@ am__objects_2 = ast_array_index.lo ast_expr.lo ast_function.lo \
link_uniform_initializers.lo \
link_uniform_block_active_visitor.lo link_uniform_blocks.lo \
link_varyings.lo loop_analysis.lo loop_controls.lo \
- loop_unroll.lo lower_clip_distance.lo \
- lower_const_arrays_to_uniforms.lo lower_discard.lo \
+ loop_unroll.lo lower_clip_distance.lo lower_discard.lo \
lower_discard_flow.lo lower_if_to_cond_assign.lo \
lower_instructions.lo lower_jumps.lo lower_mat_op_to_vec.lo \
lower_noise.lo lower_offset_array.lo lower_packed_varyings.lo \
@@ -167,40 +165,41 @@ am__objects_2 = ast_array_index.lo ast_expr.lo ast_function.lo \
lower_variable_index_to_cond_assign.lo \
lower_vec_index_to_cond_assign.lo \
lower_vec_index_to_swizzle.lo lower_vector.lo \
- lower_vector_insert.lo lower_vertex_id.lo \
- lower_output_reads.lo lower_ubo_reference.lo opt_algebraic.lo \
- opt_array_splitting.lo opt_constant_folding.lo \
- opt_constant_propagation.lo opt_constant_variable.lo \
- opt_copy_propagation.lo opt_copy_propagation_elements.lo \
- opt_cse.lo opt_dead_builtin_variables.lo \
+ lower_vector_insert.lo lower_output_reads.lo \
+ lower_ubo_reference.lo opt_algebraic.lo opt_array_splitting.lo \
+ opt_constant_folding.lo opt_constant_propagation.lo \
+ opt_constant_variable.lo opt_copy_propagation.lo \
+ opt_copy_propagation_elements.lo opt_cse.lo \
opt_dead_builtin_varyings.lo opt_dead_code.lo \
opt_dead_code_local.lo opt_dead_functions.lo \
opt_flatten_nested_if_blocks.lo opt_flip_matrices.lo \
opt_function_inlining.lo opt_if_simplification.lo \
- opt_minmax.lo opt_noop_swizzle.lo opt_rebalance_tree.lo \
- opt_redundant_jumps.lo opt_structure_splitting.lo \
- opt_swizzle_swizzle.lo opt_tree_grafting.lo opt_vectorize.lo \
- s_expression.lo
+ opt_noop_swizzle.lo opt_redundant_jumps.lo \
+ opt_structure_splitting.lo opt_swizzle_swizzle.lo \
+ opt_tree_grafting.lo opt_vectorize.lo s_expression.lo \
+ strtod.lo
am_libglsl_la_OBJECTS = glsl_lexer.lo glsl_parser.lo $(am__objects_2)
libglsl_la_OBJECTS = $(am_libglsl_la_OBJECTS)
PROGRAMS = $(noinst_PROGRAMS)
-am_glcpp_glcpp_OBJECTS = glcpp.$(OBJEXT) common.$(OBJEXT) \
- prog_hash_table.$(OBJEXT)
+am_glcpp_glcpp_OBJECTS = glcpp.$(OBJEXT) prog_hash_table.$(OBJEXT)
glcpp_glcpp_OBJECTS = $(am_glcpp_glcpp_OBJECTS)
glcpp_glcpp_DEPENDENCIES = libglcpp.la
am__dirstamp = $(am__leading_dot)dirstamp
am__objects_3 = standalone_scaffolding.$(OBJEXT) main.$(OBJEXT)
-am_glsl_compiler_OBJECTS = imports.$(OBJEXT) prog_hash_table.$(OBJEXT) \
- symbol_table.$(OBJEXT) $(am__objects_3)
+am_glsl_compiler_OBJECTS = hash_table.$(OBJEXT) imports.$(OBJEXT) \
+ prog_hash_table.$(OBJEXT) symbol_table.$(OBJEXT) \
+ $(am__objects_3)
glsl_compiler_OBJECTS = $(am_glsl_compiler_OBJECTS)
am__DEPENDENCIES_1 =
glsl_compiler_DEPENDENCIES = libglsl.la $(am__DEPENDENCIES_1)
-am_glsl_test_OBJECTS = imports.$(OBJEXT) prog_hash_table.$(OBJEXT) \
- symbol_table.$(OBJEXT) standalone_scaffolding.$(OBJEXT) \
- common.$(OBJEXT) test.$(OBJEXT) test_optpass.$(OBJEXT)
+am_glsl_test_OBJECTS = hash_table.$(OBJEXT) imports.$(OBJEXT) \
+ prog_hash_table.$(OBJEXT) symbol_table.$(OBJEXT) \
+ standalone_scaffolding.$(OBJEXT) common.$(OBJEXT) \
+ test.$(OBJEXT) test_optpass.$(OBJEXT)
glsl_test_OBJECTS = $(am_glsl_test_OBJECTS)
-glsl_test_DEPENDENCIES = libglsl.la $(am__DEPENDENCIES_1)
+glsl_test_DEPENDENCIES = libglsl.la
am_tests_general_ir_test_OBJECTS = \
+ tests_general_ir_test-hash_table.$(OBJEXT) \
tests_general_ir_test-imports.$(OBJEXT) \
tests_general_ir_test-prog_hash_table.$(OBJEXT) \
tests_general_ir_test-symbol_table.$(OBJEXT) \
@@ -212,6 +211,11 @@ tests_general_ir_test_OBJECTS = $(am_tests_general_ir_test_OBJECTS)
tests_general_ir_test_DEPENDENCIES = \
$(top_builddir)/src/gtest/libgtest.la \
$(top_builddir)/src/glsl/libglsl.la $(am__DEPENDENCIES_1)
+am_tests_ralloc_test_OBJECTS = ralloc_test.$(OBJEXT) \
+ tests_ralloc_test-ralloc.$(OBJEXT)
+tests_ralloc_test_OBJECTS = $(am_tests_ralloc_test_OBJECTS)
+tests_ralloc_test_DEPENDENCIES = \
+ $(top_builddir)/src/gtest/libgtest.la $(am__DEPENDENCIES_1)
am_tests_sampler_types_test_OBJECTS = \
tests_sampler_types_test-prog_hash_table.$(OBJEXT) \
tests_sampler_types_test-symbol_table.$(OBJEXT) \
@@ -223,6 +227,7 @@ tests_sampler_types_test_DEPENDENCIES = \
$(top_builddir)/src/gtest/libgtest.la \
$(top_builddir)/src/glsl/libglsl.la $(am__DEPENDENCIES_1)
am_tests_uniform_initializer_test_OBJECTS = \
+ tests_uniform_initializer_test-hash_table.$(OBJEXT) \
tests_uniform_initializer_test-imports.$(OBJEXT) \
tests_uniform_initializer_test-prog_hash_table.$(OBJEXT) \
tests_uniform_initializer_test-symbol_table.$(OBJEXT) \
@@ -290,11 +295,13 @@ am__v_CXXLD_1 =
SOURCES = $(libglcpp_la_SOURCES) $(libglsl_la_SOURCES) \
$(glcpp_glcpp_SOURCES) $(glsl_compiler_SOURCES) \
$(glsl_test_SOURCES) $(tests_general_ir_test_SOURCES) \
+ $(tests_ralloc_test_SOURCES) \
$(tests_sampler_types_test_SOURCES) \
$(tests_uniform_initializer_test_SOURCES)
DIST_SOURCES = $(libglcpp_la_SOURCES) $(libglsl_la_SOURCES) \
$(glcpp_glcpp_SOURCES) $(glsl_compiler_SOURCES) \
$(glsl_test_SOURCES) $(tests_general_ir_test_SOURCES) \
+ $(tests_ralloc_test_SOURCES) \
$(tests_sampler_types_test_SOURCES) \
$(tests_uniform_initializer_test_SOURCES)
am__can_run_installinfo = \
@@ -534,7 +541,6 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
-BSYMBOLIC = @BSYMBOLIC@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
@@ -550,7 +556,6 @@ CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
-D3D_DRIVER_INSTALL_DIR = @D3D_DRIVER_INSTALL_DIR@
DEFINES = @DEFINES@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@@ -573,6 +578,7 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGL_CFLAGS = @EGL_CFLAGS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
+EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
EGL_LIB_DEPS = @EGL_LIB_DEPS@
EGL_NATIVE_PLATFORM = @EGL_NATIVE_PLATFORM@
EGREP = @EGREP@
@@ -645,14 +651,11 @@ LLVM_LIBS = @LLVM_LIBS@
LLVM_VERSION = @LLVM_VERSION@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MESA_LLVM = @MESA_LLVM@
MKDIR_P = @MKDIR_P@
-NINE_MAJOR = @NINE_MAJOR@
-NINE_MINOR = @NINE_MINOR@
-NINE_TINY = @NINE_TINY@
-NINE_VERSION = @NINE_VERSION@
NM = @NM@
NMEDIT = @NMEDIT@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
@@ -663,8 +666,10 @@ OMX_CFLAGS = @OMX_CFLAGS@
OMX_LIBS = @OMX_LIBS@
OMX_LIB_INSTALL_DIR = @OMX_LIB_INSTALL_DIR@
OPENCL_LIBNAME = @OPENCL_LIBNAME@
+OPENCL_LIB_INSTALL_DIR = @OPENCL_LIB_INSTALL_DIR@
OSMESA_LIB = @OSMESA_LIB@
OSMESA_LIB_DEPS = @OSMESA_LIB_DEPS@
+OSMESA_MESA_DEPS = @OSMESA_MESA_DEPS@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
OSMESA_PC_REQ = @OSMESA_PC_REQ@
OSMESA_VERSION = @OSMESA_VERSION@
@@ -678,6 +683,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@@ -696,13 +702,7 @@ SELINUX_CFLAGS = @SELINUX_CFLAGS@
SELINUX_LIBS = @SELINUX_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-SSE41_CFLAGS = @SSE41_CFLAGS@
STRIP = @STRIP@
-VA_CFLAGS = @VA_CFLAGS@
-VA_LIBS = @VA_LIBS@
-VA_LIB_INSTALL_DIR = @VA_LIB_INSTALL_DIR@
-VA_MAJOR = @VA_MAJOR@
-VA_MINOR = @VA_MINOR@
VDPAU_CFLAGS = @VDPAU_CFLAGS@
VDPAU_LIBS = @VDPAU_LIBS@
VDPAU_LIB_INSTALL_DIR = @VDPAU_LIB_INSTALL_DIR@
@@ -766,7 +766,6 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-ifGNUmake = @ifGNUmake@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -795,7 +794,6 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
- -I$(top_srcdir)/src \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa/ \
-I$(top_srcdir)/src/glsl/glcpp \
@@ -809,6 +807,7 @@ GLSL_BUILDDIR = $(top_builddir)/src/glsl
# libglcpp
LIBGLCPP_FILES = \
+ $(GLSL_SRCDIR)/ralloc.c \
$(GLSL_SRCDIR)/glcpp/pp.c
LIBGLCPP_GENERATED_FILES = \
@@ -862,7 +861,6 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/loop_controls.cpp \
$(GLSL_SRCDIR)/loop_unroll.cpp \
$(GLSL_SRCDIR)/lower_clip_distance.cpp \
- $(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp \
$(GLSL_SRCDIR)/lower_discard.cpp \
$(GLSL_SRCDIR)/lower_discard_flow.cpp \
$(GLSL_SRCDIR)/lower_if_to_cond_assign.cpp \
@@ -880,7 +878,6 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/lower_vec_index_to_swizzle.cpp \
$(GLSL_SRCDIR)/lower_vector.cpp \
$(GLSL_SRCDIR)/lower_vector_insert.cpp \
- $(GLSL_SRCDIR)/lower_vertex_id.cpp \
$(GLSL_SRCDIR)/lower_output_reads.cpp \
$(GLSL_SRCDIR)/lower_ubo_reference.cpp \
$(GLSL_SRCDIR)/opt_algebraic.cpp \
@@ -891,7 +888,6 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/opt_copy_propagation.cpp \
$(GLSL_SRCDIR)/opt_copy_propagation_elements.cpp \
$(GLSL_SRCDIR)/opt_cse.cpp \
- $(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp \
$(GLSL_SRCDIR)/opt_dead_builtin_varyings.cpp \
$(GLSL_SRCDIR)/opt_dead_code.cpp \
$(GLSL_SRCDIR)/opt_dead_code_local.cpp \
@@ -900,15 +896,14 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/opt_flip_matrices.cpp \
$(GLSL_SRCDIR)/opt_function_inlining.cpp \
$(GLSL_SRCDIR)/opt_if_simplification.cpp \
- $(GLSL_SRCDIR)/opt_minmax.cpp \
$(GLSL_SRCDIR)/opt_noop_swizzle.cpp \
- $(GLSL_SRCDIR)/opt_rebalance_tree.cpp \
$(GLSL_SRCDIR)/opt_redundant_jumps.cpp \
$(GLSL_SRCDIR)/opt_structure_splitting.cpp \
$(GLSL_SRCDIR)/opt_swizzle_swizzle.cpp \
$(GLSL_SRCDIR)/opt_tree_grafting.cpp \
$(GLSL_SRCDIR)/opt_vectorize.cpp \
- $(GLSL_SRCDIR)/s_expression.cpp
+ $(GLSL_SRCDIR)/s_expression.cpp \
+ $(GLSL_SRCDIR)/strtod.c
# glsl_compiler
@@ -928,6 +923,7 @@ TESTS_ENVIRONMENT = \
noinst_LTLIBRARIES = libglsl.la libglcpp.la
tests_general_ir_test_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c\
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -947,6 +943,7 @@ tests_general_ir_test_LDADD = \
$(PTHREAD_LIBS)
tests_uniform_initializer_test_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c\
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -963,6 +960,15 @@ tests_uniform_initializer_test_LDADD = \
$(top_builddir)/src/glsl/libglsl.la \
$(PTHREAD_LIBS)
+tests_ralloc_test_SOURCES = \
+ tests/ralloc_test.cpp \
+ $(top_builddir)/src/glsl/ralloc.c
+
+tests_ralloc_test_CFLAGS = $(PTHREAD_CFLAGS)
+tests_ralloc_test_LDADD = \
+ $(top_builddir)/src/gtest/libgtest.la \
+ $(PTHREAD_LIBS)
+
tests_sampler_types_test_SOURCES = \
$(top_srcdir)/src/mesa/program/prog_hash_table.c\
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -977,9 +983,6 @@ tests_sampler_types_test_LDADD = \
$(top_builddir)/src/glsl/libglsl.la \
$(PTHREAD_LIBS)
-libglcpp_la_LIBADD = \
- $(top_builddir)/src/util/libmesautil.la
-
libglcpp_la_SOURCES = \
glcpp/glcpp-lex.c \
glcpp/glcpp-parse.c \
@@ -987,7 +990,6 @@ libglcpp_la_SOURCES = \
glcpp_glcpp_SOURCES = \
glcpp/glcpp.c \
- tests/common.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c
glcpp_glcpp_LDADD = \
@@ -1001,6 +1003,7 @@ libglsl_la_SOURCES = \
$(LIBGLSL_FILES)
glsl_compiler_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c \
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -1011,6 +1014,7 @@ glsl_compiler_LDADD = \
$(PTHREAD_LIBS)
glsl_test_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c \
$(top_srcdir)/src/mesa/program/symbol_table.c \
@@ -1019,10 +1023,7 @@ glsl_test_SOURCES = \
test.cpp \
test_optpass.cpp
-glsl_test_LDADD = \
- libglsl.la \
- $(PTHREAD_LIBS)
-
+glsl_test_LDADD = libglsl.la
# We write our own rules for yacc and lex below. We'd rather use automake,
# but automake makes it especially difficult for a number of reasons:
@@ -1163,6 +1164,10 @@ tests/general-ir-test$(EXEEXT): $(tests_general_ir_test_OBJECTS) $(tests_general
@rm -f tests/general-ir-test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(tests_general_ir_test_OBJECTS) $(tests_general_ir_test_LDADD) $(LIBS)
+tests/ralloc-test$(EXEEXT): $(tests_ralloc_test_OBJECTS) $(tests_ralloc_test_DEPENDENCIES) $(EXTRA_tests_ralloc_test_DEPENDENCIES) tests/$(am__dirstamp)
+ @rm -f tests/ralloc-test$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tests_ralloc_test_OBJECTS) $(tests_ralloc_test_LDADD) $(LIBS)
+
tests/sampler-types-test$(EXEEXT): $(tests_sampler_types_test_OBJECTS) $(tests_sampler_types_test_DEPENDENCIES) $(EXTRA_tests_sampler_types_test_DEPENDENCIES) tests/$(am__dirstamp)
@rm -f tests/sampler-types-test$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(tests_sampler_types_test_OBJECTS) $(tests_sampler_types_test_LDADD) $(LIBS)
@@ -1197,6 +1202,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glsl_parser_extras.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glsl_symbol_table.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glsl_types.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hir_field_selection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imports.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/invalidate_locations_test.Po@am__quote@
@@ -1232,7 +1238,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loop_controls.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loop_unroll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_clip_distance.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_const_arrays_to_uniforms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_discard.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_discard_flow.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_if_to_cond_assign.Plo@am__quote@
@@ -1252,7 +1257,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_vec_index_to_swizzle.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_vector.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_vector_insert.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lower_vertex_id.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_algebraic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_array_splitting.Plo@am__quote@
@@ -1262,7 +1266,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_copy_propagation.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_copy_propagation_elements.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_cse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_dead_builtin_variables.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_dead_builtin_varyings.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_dead_code.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_dead_code_local.Plo@am__quote@
@@ -1271,9 +1274,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_flip_matrices.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_function_inlining.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_if_simplification.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_minmax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_noop_swizzle.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_rebalance_tree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_redundant_jumps.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_structure_splitting.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_swizzle_swizzle.Plo@am__quote@
@@ -1281,21 +1282,27 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_vectorize.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prog_hash_table.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ralloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ralloc_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_expression.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sampler_types_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_uniform_initializer_tests.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/standalone_scaffolding.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtod.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_optpass.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_general_ir_test-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_general_ir_test-hash_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_general_ir_test-imports.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_general_ir_test-prog_hash_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_general_ir_test-symbol_table.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_ralloc_test-ralloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_sampler_types_test-common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_sampler_types_test-prog_hash_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_sampler_types_test-symbol_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_uniform_initializer_test-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_uniform_initializer_test-hash_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_uniform_initializer_test-imports.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_uniform_initializer_test-prog_hash_table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_uniform_initializer_test-symbol_table.Po@am__quote@
@@ -1337,6 +1344,13 @@ glcpp-parse.lo: glcpp/glcpp-parse.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o glcpp-parse.lo `test -f 'glcpp/glcpp-parse.c' || echo '$(srcdir)/'`glcpp/glcpp-parse.c
+ralloc.lo: $(GLSL_SRCDIR)/ralloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ralloc.lo -MD -MP -MF $(DEPDIR)/ralloc.Tpo -c -o ralloc.lo `test -f '$(GLSL_SRCDIR)/ralloc.c' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/ralloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ralloc.Tpo $(DEPDIR)/ralloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(GLSL_SRCDIR)/ralloc.c' object='ralloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ralloc.lo `test -f '$(GLSL_SRCDIR)/ralloc.c' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/ralloc.c
+
pp.lo: $(GLSL_SRCDIR)/glcpp/pp.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pp.lo -MD -MP -MF $(DEPDIR)/pp.Tpo -c -o pp.lo `test -f '$(GLSL_SRCDIR)/glcpp/pp.c' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/glcpp/pp.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pp.Tpo $(DEPDIR)/pp.Plo
@@ -1344,6 +1358,13 @@ pp.lo: $(GLSL_SRCDIR)/glcpp/pp.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pp.lo `test -f '$(GLSL_SRCDIR)/glcpp/pp.c' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/glcpp/pp.c
+strtod.lo: $(GLSL_SRCDIR)/strtod.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strtod.lo -MD -MP -MF $(DEPDIR)/strtod.Tpo -c -o strtod.lo `test -f '$(GLSL_SRCDIR)/strtod.c' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/strtod.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strtod.Tpo $(DEPDIR)/strtod.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(GLSL_SRCDIR)/strtod.c' object='strtod.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strtod.lo `test -f '$(GLSL_SRCDIR)/strtod.c' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/strtod.c
+
glcpp.o: glcpp/glcpp.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT glcpp.o -MD -MP -MF $(DEPDIR)/glcpp.Tpo -c -o glcpp.o `test -f 'glcpp/glcpp.c' || echo '$(srcdir)/'`glcpp/glcpp.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/glcpp.Tpo $(DEPDIR)/glcpp.Po
@@ -1358,20 +1379,6 @@ glcpp.obj: glcpp/glcpp.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o glcpp.obj `if test -f 'glcpp/glcpp.c'; then $(CYGPATH_W) 'glcpp/glcpp.c'; else $(CYGPATH_W) '$(srcdir)/glcpp/glcpp.c'; fi`
-common.o: tests/common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common.o -MD -MP -MF $(DEPDIR)/common.Tpo -c -o common.o `test -f 'tests/common.c' || echo '$(srcdir)/'`tests/common.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/common.Tpo $(DEPDIR)/common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/common.c' object='common.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common.o `test -f 'tests/common.c' || echo '$(srcdir)/'`tests/common.c
-
-common.obj: tests/common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common.obj -MD -MP -MF $(DEPDIR)/common.Tpo -c -o common.obj `if test -f 'tests/common.c'; then $(CYGPATH_W) 'tests/common.c'; else $(CYGPATH_W) '$(srcdir)/tests/common.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/common.Tpo $(DEPDIR)/common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/common.c' object='common.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common.obj `if test -f 'tests/common.c'; then $(CYGPATH_W) 'tests/common.c'; else $(CYGPATH_W) '$(srcdir)/tests/common.c'; fi`
-
prog_hash_table.o: $(top_srcdir)/src/mesa/program/prog_hash_table.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT prog_hash_table.o -MD -MP -MF $(DEPDIR)/prog_hash_table.Tpo -c -o prog_hash_table.o `test -f '$(top_srcdir)/src/mesa/program/prog_hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/program/prog_hash_table.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/prog_hash_table.Tpo $(DEPDIR)/prog_hash_table.Po
@@ -1386,6 +1393,20 @@ prog_hash_table.obj: $(top_srcdir)/src/mesa/program/prog_hash_table.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o prog_hash_table.obj `if test -f '$(top_srcdir)/src/mesa/program/prog_hash_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/program/prog_hash_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/program/prog_hash_table.c'; fi`
+hash_table.o: $(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hash_table.o -MD -MP -MF $(DEPDIR)/hash_table.Tpo -c -o hash_table.o `test -f '$(top_srcdir)/src/mesa/main/hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hash_table.Tpo $(DEPDIR)/hash_table.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/src/mesa/main/hash_table.c' object='hash_table.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hash_table.o `test -f '$(top_srcdir)/src/mesa/main/hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/hash_table.c
+
+hash_table.obj: $(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hash_table.obj -MD -MP -MF $(DEPDIR)/hash_table.Tpo -c -o hash_table.obj `if test -f '$(top_srcdir)/src/mesa/main/hash_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/main/hash_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/main/hash_table.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hash_table.Tpo $(DEPDIR)/hash_table.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/src/mesa/main/hash_table.c' object='hash_table.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hash_table.obj `if test -f '$(top_srcdir)/src/mesa/main/hash_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/main/hash_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/main/hash_table.c'; fi`
+
imports.o: $(top_srcdir)/src/mesa/main/imports.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imports.o -MD -MP -MF $(DEPDIR)/imports.Tpo -c -o imports.o `test -f '$(top_srcdir)/src/mesa/main/imports.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/imports.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imports.Tpo $(DEPDIR)/imports.Po
@@ -1414,6 +1435,34 @@ symbol_table.obj: $(top_srcdir)/src/mesa/program/symbol_table.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o symbol_table.obj `if test -f '$(top_srcdir)/src/mesa/program/symbol_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/program/symbol_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/program/symbol_table.c'; fi`
+common.o: tests/common.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common.o -MD -MP -MF $(DEPDIR)/common.Tpo -c -o common.o `test -f 'tests/common.c' || echo '$(srcdir)/'`tests/common.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/common.Tpo $(DEPDIR)/common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/common.c' object='common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common.o `test -f 'tests/common.c' || echo '$(srcdir)/'`tests/common.c
+
+common.obj: tests/common.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common.obj -MD -MP -MF $(DEPDIR)/common.Tpo -c -o common.obj `if test -f 'tests/common.c'; then $(CYGPATH_W) 'tests/common.c'; else $(CYGPATH_W) '$(srcdir)/tests/common.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/common.Tpo $(DEPDIR)/common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/common.c' object='common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common.obj `if test -f 'tests/common.c'; then $(CYGPATH_W) 'tests/common.c'; else $(CYGPATH_W) '$(srcdir)/tests/common.c'; fi`
+
+tests_general_ir_test-hash_table.o: $(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_general_ir_test_CFLAGS) $(CFLAGS) -MT tests_general_ir_test-hash_table.o -MD -MP -MF $(DEPDIR)/tests_general_ir_test-hash_table.Tpo -c -o tests_general_ir_test-hash_table.o `test -f '$(top_srcdir)/src/mesa/main/hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_general_ir_test-hash_table.Tpo $(DEPDIR)/tests_general_ir_test-hash_table.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/src/mesa/main/hash_table.c' object='tests_general_ir_test-hash_table.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_general_ir_test_CFLAGS) $(CFLAGS) -c -o tests_general_ir_test-hash_table.o `test -f '$(top_srcdir)/src/mesa/main/hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/hash_table.c
+
+tests_general_ir_test-hash_table.obj: $(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_general_ir_test_CFLAGS) $(CFLAGS) -MT tests_general_ir_test-hash_table.obj -MD -MP -MF $(DEPDIR)/tests_general_ir_test-hash_table.Tpo -c -o tests_general_ir_test-hash_table.obj `if test -f '$(top_srcdir)/src/mesa/main/hash_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/main/hash_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/main/hash_table.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_general_ir_test-hash_table.Tpo $(DEPDIR)/tests_general_ir_test-hash_table.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/src/mesa/main/hash_table.c' object='tests_general_ir_test-hash_table.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_general_ir_test_CFLAGS) $(CFLAGS) -c -o tests_general_ir_test-hash_table.obj `if test -f '$(top_srcdir)/src/mesa/main/hash_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/main/hash_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/main/hash_table.c'; fi`
+
tests_general_ir_test-imports.o: $(top_srcdir)/src/mesa/main/imports.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_general_ir_test_CFLAGS) $(CFLAGS) -MT tests_general_ir_test-imports.o -MD -MP -MF $(DEPDIR)/tests_general_ir_test-imports.Tpo -c -o tests_general_ir_test-imports.o `test -f '$(top_srcdir)/src/mesa/main/imports.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/imports.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_general_ir_test-imports.Tpo $(DEPDIR)/tests_general_ir_test-imports.Po
@@ -1470,6 +1519,20 @@ tests_general_ir_test-common.obj: tests/common.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_general_ir_test_CFLAGS) $(CFLAGS) -c -o tests_general_ir_test-common.obj `if test -f 'tests/common.c'; then $(CYGPATH_W) 'tests/common.c'; else $(CYGPATH_W) '$(srcdir)/tests/common.c'; fi`
+tests_ralloc_test-ralloc.o: $(top_builddir)/src/glsl/ralloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_ralloc_test_CFLAGS) $(CFLAGS) -MT tests_ralloc_test-ralloc.o -MD -MP -MF $(DEPDIR)/tests_ralloc_test-ralloc.Tpo -c -o tests_ralloc_test-ralloc.o `test -f '$(top_builddir)/src/glsl/ralloc.c' || echo '$(srcdir)/'`$(top_builddir)/src/glsl/ralloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_ralloc_test-ralloc.Tpo $(DEPDIR)/tests_ralloc_test-ralloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/src/glsl/ralloc.c' object='tests_ralloc_test-ralloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_ralloc_test_CFLAGS) $(CFLAGS) -c -o tests_ralloc_test-ralloc.o `test -f '$(top_builddir)/src/glsl/ralloc.c' || echo '$(srcdir)/'`$(top_builddir)/src/glsl/ralloc.c
+
+tests_ralloc_test-ralloc.obj: $(top_builddir)/src/glsl/ralloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_ralloc_test_CFLAGS) $(CFLAGS) -MT tests_ralloc_test-ralloc.obj -MD -MP -MF $(DEPDIR)/tests_ralloc_test-ralloc.Tpo -c -o tests_ralloc_test-ralloc.obj `if test -f '$(top_builddir)/src/glsl/ralloc.c'; then $(CYGPATH_W) '$(top_builddir)/src/glsl/ralloc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/glsl/ralloc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_ralloc_test-ralloc.Tpo $(DEPDIR)/tests_ralloc_test-ralloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/src/glsl/ralloc.c' object='tests_ralloc_test-ralloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_ralloc_test_CFLAGS) $(CFLAGS) -c -o tests_ralloc_test-ralloc.obj `if test -f '$(top_builddir)/src/glsl/ralloc.c'; then $(CYGPATH_W) '$(top_builddir)/src/glsl/ralloc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/glsl/ralloc.c'; fi`
+
tests_sampler_types_test-prog_hash_table.o: $(top_srcdir)/src/mesa/program/prog_hash_table.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_sampler_types_test_CFLAGS) $(CFLAGS) -MT tests_sampler_types_test-prog_hash_table.o -MD -MP -MF $(DEPDIR)/tests_sampler_types_test-prog_hash_table.Tpo -c -o tests_sampler_types_test-prog_hash_table.o `test -f '$(top_srcdir)/src/mesa/program/prog_hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/program/prog_hash_table.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_sampler_types_test-prog_hash_table.Tpo $(DEPDIR)/tests_sampler_types_test-prog_hash_table.Po
@@ -1512,6 +1575,20 @@ tests_sampler_types_test-common.obj: tests/common.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_sampler_types_test_CFLAGS) $(CFLAGS) -c -o tests_sampler_types_test-common.obj `if test -f 'tests/common.c'; then $(CYGPATH_W) 'tests/common.c'; else $(CYGPATH_W) '$(srcdir)/tests/common.c'; fi`
+tests_uniform_initializer_test-hash_table.o: $(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_uniform_initializer_test_CFLAGS) $(CFLAGS) -MT tests_uniform_initializer_test-hash_table.o -MD -MP -MF $(DEPDIR)/tests_uniform_initializer_test-hash_table.Tpo -c -o tests_uniform_initializer_test-hash_table.o `test -f '$(top_srcdir)/src/mesa/main/hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_uniform_initializer_test-hash_table.Tpo $(DEPDIR)/tests_uniform_initializer_test-hash_table.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/src/mesa/main/hash_table.c' object='tests_uniform_initializer_test-hash_table.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_uniform_initializer_test_CFLAGS) $(CFLAGS) -c -o tests_uniform_initializer_test-hash_table.o `test -f '$(top_srcdir)/src/mesa/main/hash_table.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/hash_table.c
+
+tests_uniform_initializer_test-hash_table.obj: $(top_srcdir)/src/mesa/main/hash_table.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_uniform_initializer_test_CFLAGS) $(CFLAGS) -MT tests_uniform_initializer_test-hash_table.obj -MD -MP -MF $(DEPDIR)/tests_uniform_initializer_test-hash_table.Tpo -c -o tests_uniform_initializer_test-hash_table.obj `if test -f '$(top_srcdir)/src/mesa/main/hash_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/main/hash_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/main/hash_table.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_uniform_initializer_test-hash_table.Tpo $(DEPDIR)/tests_uniform_initializer_test-hash_table.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/src/mesa/main/hash_table.c' object='tests_uniform_initializer_test-hash_table.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_uniform_initializer_test_CFLAGS) $(CFLAGS) -c -o tests_uniform_initializer_test-hash_table.obj `if test -f '$(top_srcdir)/src/mesa/main/hash_table.c'; then $(CYGPATH_W) '$(top_srcdir)/src/mesa/main/hash_table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/mesa/main/hash_table.c'; fi`
+
tests_uniform_initializer_test-imports.o: $(top_srcdir)/src/mesa/main/imports.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_uniform_initializer_test_CFLAGS) $(CFLAGS) -MT tests_uniform_initializer_test-imports.o -MD -MP -MF $(DEPDIR)/tests_uniform_initializer_test-imports.Tpo -c -o tests_uniform_initializer_test-imports.o `test -f '$(top_srcdir)/src/mesa/main/imports.c' || echo '$(srcdir)/'`$(top_srcdir)/src/mesa/main/imports.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_uniform_initializer_test-imports.Tpo $(DEPDIR)/tests_uniform_initializer_test-imports.Po
@@ -1897,13 +1974,6 @@ lower_clip_distance.lo: $(GLSL_SRCDIR)/lower_clip_distance.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lower_clip_distance.lo `test -f '$(GLSL_SRCDIR)/lower_clip_distance.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_clip_distance.cpp
-lower_const_arrays_to_uniforms.lo: $(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lower_const_arrays_to_uniforms.lo -MD -MP -MF $(DEPDIR)/lower_const_arrays_to_uniforms.Tpo -c -o lower_const_arrays_to_uniforms.lo `test -f '$(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lower_const_arrays_to_uniforms.Tpo $(DEPDIR)/lower_const_arrays_to_uniforms.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp' object='lower_const_arrays_to_uniforms.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lower_const_arrays_to_uniforms.lo `test -f '$(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp
-
lower_discard.lo: $(GLSL_SRCDIR)/lower_discard.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lower_discard.lo -MD -MP -MF $(DEPDIR)/lower_discard.Tpo -c -o lower_discard.lo `test -f '$(GLSL_SRCDIR)/lower_discard.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_discard.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lower_discard.Tpo $(DEPDIR)/lower_discard.Plo
@@ -2023,13 +2093,6 @@ lower_vector_insert.lo: $(GLSL_SRCDIR)/lower_vector_insert.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lower_vector_insert.lo `test -f '$(GLSL_SRCDIR)/lower_vector_insert.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_vector_insert.cpp
-lower_vertex_id.lo: $(GLSL_SRCDIR)/lower_vertex_id.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lower_vertex_id.lo -MD -MP -MF $(DEPDIR)/lower_vertex_id.Tpo -c -o lower_vertex_id.lo `test -f '$(GLSL_SRCDIR)/lower_vertex_id.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_vertex_id.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lower_vertex_id.Tpo $(DEPDIR)/lower_vertex_id.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(GLSL_SRCDIR)/lower_vertex_id.cpp' object='lower_vertex_id.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lower_vertex_id.lo `test -f '$(GLSL_SRCDIR)/lower_vertex_id.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_vertex_id.cpp
-
lower_output_reads.lo: $(GLSL_SRCDIR)/lower_output_reads.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lower_output_reads.lo -MD -MP -MF $(DEPDIR)/lower_output_reads.Tpo -c -o lower_output_reads.lo `test -f '$(GLSL_SRCDIR)/lower_output_reads.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/lower_output_reads.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lower_output_reads.Tpo $(DEPDIR)/lower_output_reads.Plo
@@ -2100,13 +2163,6 @@ opt_cse.lo: $(GLSL_SRCDIR)/opt_cse.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o opt_cse.lo `test -f '$(GLSL_SRCDIR)/opt_cse.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_cse.cpp
-opt_dead_builtin_variables.lo: $(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT opt_dead_builtin_variables.lo -MD -MP -MF $(DEPDIR)/opt_dead_builtin_variables.Tpo -c -o opt_dead_builtin_variables.lo `test -f '$(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/opt_dead_builtin_variables.Tpo $(DEPDIR)/opt_dead_builtin_variables.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp' object='opt_dead_builtin_variables.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o opt_dead_builtin_variables.lo `test -f '$(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp
-
opt_dead_builtin_varyings.lo: $(GLSL_SRCDIR)/opt_dead_builtin_varyings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT opt_dead_builtin_varyings.lo -MD -MP -MF $(DEPDIR)/opt_dead_builtin_varyings.Tpo -c -o opt_dead_builtin_varyings.lo `test -f '$(GLSL_SRCDIR)/opt_dead_builtin_varyings.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_dead_builtin_varyings.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/opt_dead_builtin_varyings.Tpo $(DEPDIR)/opt_dead_builtin_varyings.Plo
@@ -2163,13 +2219,6 @@ opt_if_simplification.lo: $(GLSL_SRCDIR)/opt_if_simplification.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o opt_if_simplification.lo `test -f '$(GLSL_SRCDIR)/opt_if_simplification.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_if_simplification.cpp
-opt_minmax.lo: $(GLSL_SRCDIR)/opt_minmax.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT opt_minmax.lo -MD -MP -MF $(DEPDIR)/opt_minmax.Tpo -c -o opt_minmax.lo `test -f '$(GLSL_SRCDIR)/opt_minmax.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_minmax.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/opt_minmax.Tpo $(DEPDIR)/opt_minmax.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(GLSL_SRCDIR)/opt_minmax.cpp' object='opt_minmax.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o opt_minmax.lo `test -f '$(GLSL_SRCDIR)/opt_minmax.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_minmax.cpp
-
opt_noop_swizzle.lo: $(GLSL_SRCDIR)/opt_noop_swizzle.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT opt_noop_swizzle.lo -MD -MP -MF $(DEPDIR)/opt_noop_swizzle.Tpo -c -o opt_noop_swizzle.lo `test -f '$(GLSL_SRCDIR)/opt_noop_swizzle.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_noop_swizzle.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/opt_noop_swizzle.Tpo $(DEPDIR)/opt_noop_swizzle.Plo
@@ -2177,13 +2226,6 @@ opt_noop_swizzle.lo: $(GLSL_SRCDIR)/opt_noop_swizzle.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o opt_noop_swizzle.lo `test -f '$(GLSL_SRCDIR)/opt_noop_swizzle.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_noop_swizzle.cpp
-opt_rebalance_tree.lo: $(GLSL_SRCDIR)/opt_rebalance_tree.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT opt_rebalance_tree.lo -MD -MP -MF $(DEPDIR)/opt_rebalance_tree.Tpo -c -o opt_rebalance_tree.lo `test -f '$(GLSL_SRCDIR)/opt_rebalance_tree.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_rebalance_tree.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/opt_rebalance_tree.Tpo $(DEPDIR)/opt_rebalance_tree.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(GLSL_SRCDIR)/opt_rebalance_tree.cpp' object='opt_rebalance_tree.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o opt_rebalance_tree.lo `test -f '$(GLSL_SRCDIR)/opt_rebalance_tree.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_rebalance_tree.cpp
-
opt_redundant_jumps.lo: $(GLSL_SRCDIR)/opt_redundant_jumps.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT opt_redundant_jumps.lo -MD -MP -MF $(DEPDIR)/opt_redundant_jumps.Tpo -c -o opt_redundant_jumps.lo `test -f '$(GLSL_SRCDIR)/opt_redundant_jumps.cpp' || echo '$(srcdir)/'`$(GLSL_SRCDIR)/opt_redundant_jumps.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/opt_redundant_jumps.Tpo $(DEPDIR)/opt_redundant_jumps.Plo
@@ -2310,6 +2352,20 @@ varyings_test.obj: tests/varyings_test.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o varyings_test.obj `if test -f 'tests/varyings_test.cpp'; then $(CYGPATH_W) 'tests/varyings_test.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/varyings_test.cpp'; fi`
+ralloc_test.o: tests/ralloc_test.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ralloc_test.o -MD -MP -MF $(DEPDIR)/ralloc_test.Tpo -c -o ralloc_test.o `test -f 'tests/ralloc_test.cpp' || echo '$(srcdir)/'`tests/ralloc_test.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ralloc_test.Tpo $(DEPDIR)/ralloc_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/ralloc_test.cpp' object='ralloc_test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ralloc_test.o `test -f 'tests/ralloc_test.cpp' || echo '$(srcdir)/'`tests/ralloc_test.cpp
+
+ralloc_test.obj: tests/ralloc_test.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ralloc_test.obj -MD -MP -MF $(DEPDIR)/ralloc_test.Tpo -c -o ralloc_test.obj `if test -f 'tests/ralloc_test.cpp'; then $(CYGPATH_W) 'tests/ralloc_test.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/ralloc_test.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ralloc_test.Tpo $(DEPDIR)/ralloc_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/ralloc_test.cpp' object='ralloc_test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ralloc_test.obj `if test -f 'tests/ralloc_test.cpp'; then $(CYGPATH_W) 'tests/ralloc_test.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/ralloc_test.cpp'; fi`
+
sampler_types_test.o: tests/sampler_types_test.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sampler_types_test.o -MD -MP -MF $(DEPDIR)/sampler_types_test.Tpo -c -o sampler_types_test.o `test -f 'tests/sampler_types_test.cpp' || echo '$(srcdir)/'`tests/sampler_types_test.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sampler_types_test.Tpo $(DEPDIR)/sampler_types_test.Po
@@ -2574,13 +2630,6 @@ glcpp/tests/glcpp-test.log: glcpp/tests/glcpp-test
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-glcpp/tests/glcpp-test-cr-lf.log: glcpp/tests/glcpp-test-cr-lf
- @p='glcpp/tests/glcpp-test-cr-lf'; \
- b='glcpp/tests/glcpp-test-cr-lf'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
tests/general-ir-test.log: tests/general-ir-test$(EXEEXT)
@p='tests/general-ir-test$(EXEEXT)'; \
b='tests/general-ir-test'; \
@@ -2595,6 +2644,13 @@ tests/optimization-test.log: tests/optimization-test
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+tests/ralloc-test.log: tests/ralloc-test$(EXEEXT)
+ @p='tests/ralloc-test$(EXEEXT)'; \
+ b='tests/ralloc-test'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
tests/sampler-types-test.log: tests/sampler-types-test$(EXEEXT)
@p='tests/sampler-types-test$(EXEEXT)'; \
b='tests/sampler-types-test'; \
diff --git a/dist/Mesa/src/glsl/Makefile.sources b/dist/Mesa/src/glsl/Makefile.sources
index 676fa0d7a..5945590a5 100644
--- a/dist/Mesa/src/glsl/Makefile.sources
+++ b/dist/Mesa/src/glsl/Makefile.sources
@@ -6,6 +6,7 @@ GLSL_BUILDDIR = $(top_builddir)/src/glsl
# libglcpp
LIBGLCPP_FILES = \
+ $(GLSL_SRCDIR)/ralloc.c \
$(GLSL_SRCDIR)/glcpp/pp.c
LIBGLCPP_GENERATED_FILES = \
@@ -59,7 +60,6 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/loop_controls.cpp \
$(GLSL_SRCDIR)/loop_unroll.cpp \
$(GLSL_SRCDIR)/lower_clip_distance.cpp \
- $(GLSL_SRCDIR)/lower_const_arrays_to_uniforms.cpp \
$(GLSL_SRCDIR)/lower_discard.cpp \
$(GLSL_SRCDIR)/lower_discard_flow.cpp \
$(GLSL_SRCDIR)/lower_if_to_cond_assign.cpp \
@@ -77,7 +77,6 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/lower_vec_index_to_swizzle.cpp \
$(GLSL_SRCDIR)/lower_vector.cpp \
$(GLSL_SRCDIR)/lower_vector_insert.cpp \
- $(GLSL_SRCDIR)/lower_vertex_id.cpp \
$(GLSL_SRCDIR)/lower_output_reads.cpp \
$(GLSL_SRCDIR)/lower_ubo_reference.cpp \
$(GLSL_SRCDIR)/opt_algebraic.cpp \
@@ -88,7 +87,6 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/opt_copy_propagation.cpp \
$(GLSL_SRCDIR)/opt_copy_propagation_elements.cpp \
$(GLSL_SRCDIR)/opt_cse.cpp \
- $(GLSL_SRCDIR)/opt_dead_builtin_variables.cpp \
$(GLSL_SRCDIR)/opt_dead_builtin_varyings.cpp \
$(GLSL_SRCDIR)/opt_dead_code.cpp \
$(GLSL_SRCDIR)/opt_dead_code_local.cpp \
@@ -97,15 +95,14 @@ LIBGLSL_FILES = \
$(GLSL_SRCDIR)/opt_flip_matrices.cpp \
$(GLSL_SRCDIR)/opt_function_inlining.cpp \
$(GLSL_SRCDIR)/opt_if_simplification.cpp \
- $(GLSL_SRCDIR)/opt_minmax.cpp \
$(GLSL_SRCDIR)/opt_noop_swizzle.cpp \
- $(GLSL_SRCDIR)/opt_rebalance_tree.cpp \
$(GLSL_SRCDIR)/opt_redundant_jumps.cpp \
$(GLSL_SRCDIR)/opt_structure_splitting.cpp \
$(GLSL_SRCDIR)/opt_swizzle_swizzle.cpp \
$(GLSL_SRCDIR)/opt_tree_grafting.cpp \
$(GLSL_SRCDIR)/opt_vectorize.cpp \
- $(GLSL_SRCDIR)/s_expression.cpp
+ $(GLSL_SRCDIR)/s_expression.cpp \
+ $(GLSL_SRCDIR)/strtod.c
# glsl_compiler
diff --git a/dist/Mesa/src/glsl/README b/dist/Mesa/src/glsl/README
index 2f93f12ff..0a0afccdc 100644
--- a/dist/Mesa/src/glsl/README
+++ b/dist/Mesa/src/glsl/README
@@ -8,7 +8,7 @@ passed straight through. See glcpp/*
2) lex and yacc-based parser takes the preprocessed string and
generates the AST (abstract syntax tree). Almost no checking is
-performed in this stage. See glsl_lexer.ll and glsl_parser.yy.
+performed in this stage. See glsl_lexer.lpp and glsl_parser.ypp.
3) The AST is converted to "HIR". This is the intermediate
representation of the compiler. Constructors are generated, function
@@ -34,7 +34,7 @@ linked in.
7) The driver performs code generation out of the IR, taking a linked
shader program and producing a compiled program for each stage. See
-../mesa/program/ir_to_mesa.cpp for Mesa IR code generation.
+ir_to_mesa.cpp for Mesa IR code generation.
FAQ:
@@ -126,7 +126,7 @@ optimizations like CSE where one must navigate an expression tree.
Q: Why no SSA representation?
-A: Converting an IR tree to SSA form makes dead code elimination,
+A: Converting an IR tree to SSA form makes dead code elmimination,
common subexpression elimination, and many other optimizations much
easier. However, in our primarily vector-based language, there's some
major questions as to how it would work. Do we do SSA on the scalar
@@ -134,9 +134,9 @@ or vector level? If we do it at the vector level, we're going to end
up with many different versions of the variable when encountering code
like:
-(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
-(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
-(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )
+(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
+(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
+(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )
If every masked update of a component relies on the previous value of
the variable, then we're probably going to be quite limited in our
@@ -183,7 +183,7 @@ ir_validate.cpp (check users have the right types)
You may also need to update the backends if they will see the new expr type:
-../mesa/program/ir_to_mesa.cpp
+../mesa/shaders/ir_to_mesa.cpp
You can then use the new expression from builtins (if all backends
would rather see it), or scan the IR and convert to use your new
@@ -225,4 +225,4 @@ Initially, there really wasn't one. We have since adopted one:
- Files that implement a class that is used throught the code should
take the name of that class (e.g., ir_hierarchical_visitor.cpp).
- Files that contain code not fitting in one of the previous
- categories should have a sensible name (e.g., glsl_parser.yy).
+ categories should have a sensible name (e.g., glsl_parser.ypp).
diff --git a/dist/Mesa/src/glsl/ast_array_index.cpp b/dist/Mesa/src/glsl/ast_array_index.cpp
index ff0c7576d..f3b060ea6 100644
--- a/dist/Mesa/src/glsl/ast_array_index.cpp
+++ b/dist/Mesa/src/glsl/ast_array_index.cpp
@@ -49,12 +49,12 @@ ast_array_specifier::print(void) const
* loc and state to report the error.
*/
static void
-update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
+update_max_array_access(ir_rvalue *ir, unsigned idx, YYLTYPE *loc,
struct _mesa_glsl_parse_state *state)
{
if (ir_dereference_variable *deref_var = ir->as_dereference_variable()) {
ir_variable *var = deref_var->var;
- if (idx > (int)var->data.max_array_access) {
+ if (idx > var->data.max_array_access) {
var->data.max_array_access = idx;
/* Check whether this access will, as a side effect, implicitly cause
@@ -88,14 +88,8 @@ update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
unsigned field_index =
deref_record->record->type->field_index(deref_record->field);
assert(field_index < interface_type->length);
-
- unsigned *const max_ifc_array_access =
- deref_var->var->get_max_ifc_array_access();
-
- assert(max_ifc_array_access != NULL);
-
- if (idx > (int)max_ifc_array_access[field_index]) {
- max_ifc_array_access[field_index] = idx;
+ if (idx > deref_var->var->max_ifc_array_access[field_index]) {
+ deref_var->var->max_ifc_array_access[field_index] = idx;
/* Check whether this access will, as a side effect, implicitly
* cause the size of a built-in array to be too large.
@@ -187,8 +181,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
if (array->type->is_unsized_array()) {
_mesa_glsl_error(&loc, state, "unsized array index must be constant");
} else if (array->type->fields.array->is_interface()
- && array->variable_referenced()->data.mode == ir_var_uniform
- && !state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
+ && array->variable_referenced()->data.mode == ir_var_uniform) {
/* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says:
*
* "All indexes used to index a uniform block array must be
@@ -219,13 +212,6 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
* as using a loop counter as the index to an array of samplers. If the
* loop in unrolled, the code should compile correctly. Instead, emit a
* warning.
- *
- * In GLSL 4.00 / ARB_gpu_shader5, this requirement is relaxed again to allow
- * indexing with dynamically uniform expressions. Note that these are not
- * required to be uniforms or expressions based on them, but merely that the
- * values must not diverge between shader invocations run together. If the
- * values *do* diverge, then the behavior of the operation requiring a
- * dynamically uniform expression is undefined.
*/
if (array->type->element_type()->is_sampler()) {
if (!state->is_version(130, 100)) {
@@ -240,7 +226,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
"expressions will be forbidden in GLSL 1.30 "
"and later");
}
- } else if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
+ } else {
_mesa_glsl_error(&loc, state,
"sampler arrays indexed with non-constant "
"expressions is forbidden in GLSL 1.30 and "
diff --git a/dist/Mesa/src/glsl/builtin_functions.cpp b/dist/Mesa/src/glsl/builtin_functions.cpp
index bb7fbcdc1..f9f06862e 100644
--- a/dist/Mesa/src/glsl/builtin_functions.cpp
+++ b/dist/Mesa/src/glsl/builtin_functions.cpp
@@ -226,14 +226,6 @@ shader_packing_or_gpu_shader5(const _mesa_glsl_parse_state *state)
}
static bool
-fs_gpu_shader5(const _mesa_glsl_parse_state *state)
-{
- return state->stage == MESA_SHADER_FRAGMENT &&
- (state->is_version(400, 0) || state->ARB_gpu_shader5_enable);
-}
-
-
-static bool
texture_array_lod(const _mesa_glsl_parse_state *state)
{
return lod_exists_in_stage(state) &&
@@ -318,14 +310,6 @@ fs_oes_derivatives(const _mesa_glsl_parse_state *state)
}
static bool
-fs_derivative_control(const _mesa_glsl_parse_state *state)
-{
- return state->stage == MESA_SHADER_FRAGMENT &&
- (state->is_version(450, 0) ||
- state->ARB_derivative_control_enable);
-}
-
-static bool
tex1d_lod(const _mesa_glsl_parse_state *state)
{
return !state->es_shader && lod_exists_in_stage(state);
@@ -375,12 +359,6 @@ shader_image_load_store(const _mesa_glsl_parse_state *state)
state->ARB_shader_image_load_store_enable);
}
-static bool
-gs_streams(const _mesa_glsl_parse_state *state)
-{
- return gpu_shader5(state) && gs_only(state);
-}
-
/** @} */
/******************************************************************************/
@@ -442,7 +420,6 @@ private:
ir_swizzle *matrix_elt(ir_variable *var, int col, int row);
ir_expression *asin_expr(ir_variable *x);
- void do_atan(ir_factory &body, const glsl_type *type, ir_variable *res, operand y_over_x);
/**
* Call function \param f with parameters specified as the linked
@@ -617,22 +594,12 @@ private:
B0(EmitVertex)
B0(EndPrimitive)
- ir_function_signature *_EmitStreamVertex(builtin_available_predicate avail,
- const glsl_type *stream_type);
- ir_function_signature *_EndStreamPrimitive(builtin_available_predicate avail,
- const glsl_type *stream_type);
B2(textureQueryLod);
B1(textureQueryLevels);
B1(dFdx);
B1(dFdy);
B1(fwidth);
- B1(dFdxCoarse);
- B1(dFdyCoarse);
- B1(fwidthCoarse);
- B1(dFdxFine);
- B1(dFdyFine);
- B1(fwidthFine);
B1(noise1);
B1(noise2);
B1(noise3);
@@ -650,9 +617,6 @@ private:
B1(uaddCarry)
B1(usubBorrow)
B1(mulExtended)
- B1(interpolateAtCentroid)
- B1(interpolateAtOffset)
- B1(interpolateAtSample)
ir_function_signature *_atomic_intrinsic(builtin_available_predicate avail);
ir_function_signature *_atomic_op(const char *intrinsic,
@@ -721,8 +685,7 @@ builtin_builder::find(_mesa_glsl_parse_state *state,
if (f == NULL)
return NULL;
- ir_function_signature *sig =
- f->matching_signature(state, actual_parameters, true);
+ ir_function_signature *sig = f->matching_signature(state, actual_parameters);
if (sig == NULL)
return NULL;
@@ -1745,14 +1708,6 @@ builtin_builder::create_builtins()
add_function("EmitVertex", _EmitVertex(), NULL);
add_function("EndPrimitive", _EndPrimitive(), NULL);
- add_function("EmitStreamVertex",
- _EmitStreamVertex(gs_streams, glsl_type::uint_type),
- _EmitStreamVertex(gs_streams, glsl_type::int_type),
- NULL);
- add_function("EndStreamPrimitive",
- _EndStreamPrimitive(gs_streams, glsl_type::uint_type),
- _EndStreamPrimitive(gs_streams, glsl_type::int_type),
- NULL);
add_function("textureQueryLOD",
_textureQueryLod(glsl_type::sampler1D_type, glsl_type::float_type),
@@ -1883,8 +1838,8 @@ builtin_builder::create_builtins()
NULL);
add_function("texture2DProjLod",
- _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
- _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+ _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+ _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
NULL);
add_function("texture3D",
@@ -1911,7 +1866,7 @@ builtin_builder::create_builtins()
NULL);
add_function("textureCubeLod",
- _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type),
+ _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type),
NULL);
add_function("texture2DRect",
@@ -2163,12 +2118,6 @@ builtin_builder::create_builtins()
F(dFdx)
F(dFdy)
F(fwidth)
- F(dFdxCoarse)
- F(dFdyCoarse)
- F(fwidthCoarse)
- F(dFdxFine)
- F(dFdyFine)
- F(fwidthFine)
F(noise1)
F(noise2)
F(noise3)
@@ -2219,24 +2168,6 @@ builtin_builder::create_builtins()
_mulExtended(glsl_type::uvec3_type),
_mulExtended(glsl_type::uvec4_type),
NULL);
- add_function("interpolateAtCentroid",
- _interpolateAtCentroid(glsl_type::float_type),
- _interpolateAtCentroid(glsl_type::vec2_type),
- _interpolateAtCentroid(glsl_type::vec3_type),
- _interpolateAtCentroid(glsl_type::vec4_type),
- NULL);
- add_function("interpolateAtOffset",
- _interpolateAtOffset(glsl_type::float_type),
- _interpolateAtOffset(glsl_type::vec2_type),
- _interpolateAtOffset(glsl_type::vec3_type),
- _interpolateAtOffset(glsl_type::vec4_type),
- NULL);
- add_function("interpolateAtSample",
- _interpolateAtSample(glsl_type::float_type),
- _interpolateAtSample(glsl_type::vec2_type),
- _interpolateAtSample(glsl_type::vec3_type),
- _interpolateAtSample(glsl_type::vec4_type),
- NULL);
add_function("atomicCounter",
_atomic_op("__intrinsic_atomic_read",
@@ -2626,7 +2557,8 @@ builtin_builder::call(ir_function *f, ir_variable *ret, exec_list params)
{
exec_list actual_params;
- foreach_in_list(ir_variable, var, &params) {
+ foreach_list(node, &params) {
+ ir_variable *var = (ir_variable *) node;
actual_params.push_tail(var_ref(var));
}
@@ -2685,7 +2617,11 @@ builtin_builder::_atan2(const glsl_type *type)
ir_factory outer_then(&outer_if->then_instructions, mem_ctx);
/* Then...call atan(y/x) */
- do_atan(body, glsl_type::float_type, r, div(y, x));
+ ir_variable *y_over_x = outer_then.make_temp(glsl_type::float_type, "y_over_x");
+ outer_then.emit(assign(y_over_x, div(y, x)));
+ outer_then.emit(assign(r, mul(y_over_x, rsq(add(mul(y_over_x, y_over_x),
+ imm(1.0f))))));
+ outer_then.emit(assign(r, asin_expr(r)));
/* ...and fix it up: */
ir_if *inner_if = new(mem_ctx) ir_if(less(x, imm(0.0f)));
@@ -2708,65 +2644,17 @@ builtin_builder::_atan2(const glsl_type *type)
return sig;
}
-void
-builtin_builder::do_atan(ir_factory &body, const glsl_type *type, ir_variable *res, operand y_over_x)
-{
- /*
- * range-reduction, first step:
- *
- * / y_over_x if |y_over_x| <= 1.0;
- * x = <
- * \ 1.0 / y_over_x otherwise
- */
- ir_variable *x = body.make_temp(type, "atan_x");
- body.emit(assign(x, div(min2(abs(y_over_x),
- imm(1.0f)),
- max2(abs(y_over_x),
- imm(1.0f)))));
-
- /*
- * approximate atan by evaluating polynomial:
- *
- * x * 0.9999793128310355 - x^3 * 0.3326756418091246 +
- * x^5 * 0.1938924977115610 - x^7 * 0.1173503194786851 +
- * x^9 * 0.0536813784310406 - x^11 * 0.0121323213173444
- */
- ir_variable *tmp = body.make_temp(type, "atan_tmp");
- body.emit(assign(tmp, mul(x, x)));
- body.emit(assign(tmp, mul(add(mul(sub(mul(add(mul(sub(mul(add(mul(imm(-0.0121323213173444f),
- tmp),
- imm(0.0536813784310406f)),
- tmp),
- imm(0.1173503194786851f)),
- tmp),
- imm(0.1938924977115610f)),
- tmp),
- imm(0.3326756418091246f)),
- tmp),
- imm(0.9999793128310355f)),
- x)));
-
- /* range-reduction fixup */
- body.emit(assign(tmp, add(tmp,
- mul(b2f(greater(abs(y_over_x),
- imm(1.0f, type->components()))),
- add(mul(tmp,
- imm(-2.0f)),
- imm(M_PI_2f))))));
-
- /* sign fixup */
- body.emit(assign(res, mul(tmp, sign(y_over_x))));
-}
-
ir_function_signature *
builtin_builder::_atan(const glsl_type *type)
{
ir_variable *y_over_x = in_var(type, "y_over_x");
MAKE_SIG(type, always_available, 1, y_over_x);
- ir_variable *tmp = body.make_temp(type, "tmp");
- do_atan(body, type, tmp, y_over_x);
- body.emit(ret(tmp));
+ ir_variable *t = body.make_temp(type, "t");
+ body.emit(assign(t, mul(y_over_x, rsq(add(mul(y_over_x, y_over_x),
+ imm(1.0f))))));
+
+ body.emit(ret(asin_expr(t)));
return sig;
}
@@ -3984,28 +3872,7 @@ builtin_builder::_EmitVertex()
{
MAKE_SIG(glsl_type::void_type, gs_only, 0);
- ir_rvalue *stream = new(mem_ctx) ir_constant(0, 1);
- body.emit(new(mem_ctx) ir_emit_vertex(stream));
-
- return sig;
-}
-
-ir_function_signature *
-builtin_builder::_EmitStreamVertex(builtin_available_predicate avail,
- const glsl_type *stream_type)
-{
- /* Section 8.12 (Geometry Shader Functions) of the GLSL 4.0 spec says:
- *
- * "Emit the current values of output variables to the current output
- * primitive on stream stream. The argument to stream must be a constant
- * integral expression."
- */
- ir_variable *stream =
- new(mem_ctx) ir_variable(stream_type, "stream", ir_var_const_in);
-
- MAKE_SIG(glsl_type::void_type, avail, 1, stream);
-
- body.emit(new(mem_ctx) ir_emit_vertex(var_ref(stream)));
+ body.emit(new(mem_ctx) ir_emit_vertex());
return sig;
}
@@ -4015,28 +3882,7 @@ builtin_builder::_EndPrimitive()
{
MAKE_SIG(glsl_type::void_type, gs_only, 0);
- ir_rvalue *stream = new(mem_ctx) ir_constant(0, 1);
- body.emit(new(mem_ctx) ir_end_primitive(stream));
-
- return sig;
-}
-
-ir_function_signature *
-builtin_builder::_EndStreamPrimitive(builtin_available_predicate avail,
- const glsl_type *stream_type)
-{
- /* Section 8.12 (Geometry Shader Functions) of the GLSL 4.0 spec says:
- *
- * "Completes the current output primitive on stream stream and starts
- * a new one. The argument to stream must be a constant integral
- * expression."
- */
- ir_variable *stream =
- new(mem_ctx) ir_variable(stream_type, "stream", ir_var_const_in);
-
- MAKE_SIG(glsl_type::void_type, avail, 1, stream);
-
- body.emit(new(mem_ctx) ir_end_primitive(var_ref(stream)));
+ body.emit(new(mem_ctx) ir_end_primitive());
return sig;
}
@@ -4075,11 +3921,7 @@ builtin_builder::_textureQueryLevels(const glsl_type *sampler_type)
}
UNOP(dFdx, ir_unop_dFdx, fs_oes_derivatives)
-UNOP(dFdxCoarse, ir_unop_dFdx_coarse, fs_derivative_control)
-UNOP(dFdxFine, ir_unop_dFdx_fine, fs_derivative_control)
UNOP(dFdy, ir_unop_dFdy, fs_oes_derivatives)
-UNOP(dFdyCoarse, ir_unop_dFdy_coarse, fs_derivative_control)
-UNOP(dFdyFine, ir_unop_dFdy_fine, fs_derivative_control)
ir_function_signature *
builtin_builder::_fwidth(const glsl_type *type)
@@ -4093,30 +3935,6 @@ builtin_builder::_fwidth(const glsl_type *type)
}
ir_function_signature *
-builtin_builder::_fwidthCoarse(const glsl_type *type)
-{
- ir_variable *p = in_var(type, "p");
- MAKE_SIG(type, fs_derivative_control, 1, p);
-
- body.emit(ret(add(abs(expr(ir_unop_dFdx_coarse, p)),
- abs(expr(ir_unop_dFdy_coarse, p)))));
-
- return sig;
-}
-
-ir_function_signature *
-builtin_builder::_fwidthFine(const glsl_type *type)
-{
- ir_variable *p = in_var(type, "p");
- MAKE_SIG(type, fs_derivative_control, 1, p);
-
- body.emit(ret(add(abs(expr(ir_unop_dFdx_fine, p)),
- abs(expr(ir_unop_dFdy_fine, p)))));
-
- return sig;
-}
-
-ir_function_signature *
builtin_builder::_noise1(const glsl_type *type)
{
return unop(v110, ir_unop_noise, glsl_type::float_type, type);
@@ -4383,44 +4201,6 @@ builtin_builder::_mulExtended(const glsl_type *type)
}
ir_function_signature *
-builtin_builder::_interpolateAtCentroid(const glsl_type *type)
-{
- ir_variable *interpolant = in_var(type, "interpolant");
- interpolant->data.must_be_shader_input = 1;
- MAKE_SIG(type, fs_gpu_shader5, 1, interpolant);
-
- body.emit(ret(interpolate_at_centroid(interpolant)));
-
- return sig;
-}
-
-ir_function_signature *
-builtin_builder::_interpolateAtOffset(const glsl_type *type)
-{
- ir_variable *interpolant = in_var(type, "interpolant");
- interpolant->data.must_be_shader_input = 1;
- ir_variable *offset = in_var(glsl_type::vec2_type, "offset");
- MAKE_SIG(type, fs_gpu_shader5, 2, interpolant, offset);
-
- body.emit(ret(interpolate_at_offset(interpolant, offset)));
-
- return sig;
-}
-
-ir_function_signature *
-builtin_builder::_interpolateAtSample(const glsl_type *type)
-{
- ir_variable *interpolant = in_var(type, "interpolant");
- interpolant->data.must_be_shader_input = 1;
- ir_variable *sample_num = in_var(glsl_type::int_type, "sample_num");
- MAKE_SIG(type, fs_gpu_shader5, 2, interpolant, sample_num);
-
- body.emit(ret(interpolate_at_sample(interpolant, sample_num)));
-
- return sig;
-}
-
-ir_function_signature *
builtin_builder::_atomic_intrinsic(builtin_available_predicate avail)
{
ir_variable *counter = in_var(glsl_type::atomic_uint_type, "counter");
@@ -4510,11 +4290,9 @@ builtin_builder::_image_prototype(const glsl_type *image_type,
sig->parameters.push_tail(in_var(glsl_type::int_type, "sample"));
/* Data arguments. */
- for (unsigned i = 0; i < num_arguments; ++i) {
- char *arg_name = ralloc_asprintf(NULL, "arg%d", i);
- sig->parameters.push_tail(in_var(data_type, arg_name));
- ralloc_free(arg_name);
- }
+ for (unsigned i = 0; i < num_arguments; ++i)
+ sig->parameters.push_tail(in_var(data_type,
+ ralloc_asprintf(NULL, "arg%d", i)));
/* Set the maximal set of qualifiers allowed for this image
* built-in. Function calls with arguments having fewer
@@ -4523,11 +4301,11 @@ builtin_builder::_image_prototype(const glsl_type *image_type,
* accept everything that needs to be accepted, and reject cases
* like loads from write-only or stores to read-only images.
*/
- image->data.image_read_only = (flags & IMAGE_FUNCTION_READ_ONLY) != 0;
- image->data.image_write_only = (flags & IMAGE_FUNCTION_WRITE_ONLY) != 0;
- image->data.image_coherent = true;
- image->data.image_volatile = true;
- image->data.image_restrict = true;
+ image->data.image.read_only = flags & IMAGE_FUNCTION_READ_ONLY;
+ image->data.image.write_only = flags & IMAGE_FUNCTION_WRITE_ONLY;
+ image->data.image.coherent = true;
+ image->data.image._volatile = true;
+ image->data.image.restrict_flag = true;
return sig;
}
diff --git a/dist/Mesa/src/glsl/builtin_types.cpp b/dist/Mesa/src/glsl/builtin_types.cpp
index 10fac0f81..0a0fa8cd3 100644
--- a/dist/Mesa/src/glsl/builtin_types.cpp
+++ b/dist/Mesa/src/glsl/builtin_types.cpp
@@ -36,7 +36,6 @@
#include "glsl_types.h"
#include "glsl_parser_extras.h"
-#include "util/macros.h"
/**
* Declarations of type flyweights (glsl_type::_foo_type) and
@@ -49,69 +48,69 @@
#define STRUCT_TYPE(NAME) \
const glsl_type glsl_type::_struct_##NAME##_type = \
- glsl_type(NAME##_fields, ARRAY_SIZE(NAME##_fields), #NAME); \
+ glsl_type(NAME##_fields, Elements(NAME##_fields), #NAME); \
const glsl_type *const glsl_type::struct_##NAME##_type = \
&glsl_type::_struct_##NAME##_type;
static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = {
- { glsl_type::float_type, "near", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "far", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "diff", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::float_type, "near", false, -1 },
+ { glsl_type::float_type, "far", false, -1 },
+ { glsl_type::float_type, "diff", false, -1 },
};
static const struct glsl_struct_field gl_PointParameters_fields[] = {
- { glsl_type::float_type, "size", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "sizeMin", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "sizeMax", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "fadeThresholdSize", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "distanceConstantAttenuation", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "distanceLinearAttenuation", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "distanceQuadraticAttenuation", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::float_type, "size", false, -1 },
+ { glsl_type::float_type, "sizeMin", false, -1 },
+ { glsl_type::float_type, "sizeMax", false, -1 },
+ { glsl_type::float_type, "fadeThresholdSize", false, -1 },
+ { glsl_type::float_type, "distanceConstantAttenuation", false, -1 },
+ { glsl_type::float_type, "distanceLinearAttenuation", false, -1 },
+ { glsl_type::float_type, "distanceQuadraticAttenuation", false, -1 },
};
static const struct glsl_struct_field gl_MaterialParameters_fields[] = {
- { glsl_type::vec4_type, "emission", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "ambient", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "diffuse", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "specular", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "shininess", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::vec4_type, "emission", false, -1 },
+ { glsl_type::vec4_type, "ambient", false, -1 },
+ { glsl_type::vec4_type, "diffuse", false, -1 },
+ { glsl_type::vec4_type, "specular", false, -1 },
+ { glsl_type::float_type, "shininess", false, -1 },
};
static const struct glsl_struct_field gl_LightSourceParameters_fields[] = {
- { glsl_type::vec4_type, "ambient", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "diffuse", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "specular", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "position", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "halfVector", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec3_type, "spotDirection", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "spotExponent", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "spotCutoff", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "spotCosCutoff", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "constantAttenuation", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "linearAttenuation", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "quadraticAttenuation", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::vec4_type, "ambient", false, -1 },
+ { glsl_type::vec4_type, "diffuse", false, -1 },
+ { glsl_type::vec4_type, "specular", false, -1 },
+ { glsl_type::vec4_type, "position", false, -1 },
+ { glsl_type::vec4_type, "halfVector", false, -1 },
+ { glsl_type::vec3_type, "spotDirection", false, -1 },
+ { glsl_type::float_type, "spotExponent", false, -1 },
+ { glsl_type::float_type, "spotCutoff", false, -1 },
+ { glsl_type::float_type, "spotCosCutoff", false, -1 },
+ { glsl_type::float_type, "constantAttenuation", false, -1 },
+ { glsl_type::float_type, "linearAttenuation", false, -1 },
+ { glsl_type::float_type, "quadraticAttenuation", false, -1 },
};
static const struct glsl_struct_field gl_LightModelParameters_fields[] = {
- { glsl_type::vec4_type, "ambient", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::vec4_type, "ambient", false, -1 },
};
static const struct glsl_struct_field gl_LightModelProducts_fields[] = {
- { glsl_type::vec4_type, "sceneColor", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::vec4_type, "sceneColor", false, -1 },
};
static const struct glsl_struct_field gl_LightProducts_fields[] = {
- { glsl_type::vec4_type, "ambient", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "diffuse", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::vec4_type, "specular", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::vec4_type, "ambient", false, -1 },
+ { glsl_type::vec4_type, "diffuse", false, -1 },
+ { glsl_type::vec4_type, "specular", false, -1 },
};
static const struct glsl_struct_field gl_FogParameters_fields[] = {
- { glsl_type::vec4_type, "color", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "density", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "start", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "end", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
- { glsl_type::float_type, "scale", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 },
+ { glsl_type::vec4_type, "color", false, -1 },
+ { glsl_type::float_type, "density", false, -1 },
+ { glsl_type::float_type, "start", false, -1 },
+ { glsl_type::float_type, "end", false, -1 },
+ { glsl_type::float_type, "scale", false, -1 },
};
#include "builtin_type_macros.h"
@@ -266,7 +265,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
{
struct glsl_symbol_table *symbols = state->symbols;
- for (unsigned i = 0; i < ARRAY_SIZE(builtin_type_versions); i++) {
+ for (unsigned i = 0; i < Elements(builtin_type_versions); i++) {
const struct builtin_type_versions *const t = &builtin_type_versions[i];
if (state->is_version(t->min_gl, t->min_es)) {
add_type(symbols, t->type);
@@ -277,7 +276,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
* they're still present. We've removed them in 1.40+ (OpenGL 3.1+).
*/
if (!state->es_shader && state->language_version < 140) {
- for (unsigned i = 0; i < ARRAY_SIZE(deprecated_types); i++) {
+ for (unsigned i = 0; i < Elements(deprecated_types); i++) {
add_type(symbols, deprecated_types[i]);
}
}
diff --git a/dist/Mesa/src/glsl/builtin_variables.cpp b/dist/Mesa/src/glsl/builtin_variables.cpp
index 65e32ad73..9b35850ee 100644
--- a/dist/Mesa/src/glsl/builtin_variables.cpp
+++ b/dist/Mesa/src/glsl/builtin_variables.cpp
@@ -26,6 +26,7 @@
#include "glsl_symbol_table.h"
#include "main/core.h"
#include "main/uniforms.h"
+#include "program/prog_parameter.h"
#include "program/prog_statevars.h"
#include "program/prog_instruction.h"
@@ -160,6 +161,14 @@ static const struct gl_builtin_uniform_element gl_NormalScale_elements[] = {
{NULL, {STATE_NORMAL_SCALE}, SWIZZLE_XXXX},
};
+static const struct gl_builtin_uniform_element gl_BumpRotMatrix0MESA_elements[] = {
+ {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_0}, SWIZZLE_XYZW},
+};
+
+static const struct gl_builtin_uniform_element gl_BumpRotMatrix1MESA_elements[] = {
+ {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_1}, SWIZZLE_XYZW},
+};
+
static const struct gl_builtin_uniform_element gl_FogParamsOptimizedMESA_elements[] = {
{NULL, {STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED}, SWIZZLE_XYZW},
};
@@ -276,6 +285,8 @@ static const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = {
STATEVAR(gl_NormalMatrix),
STATEVAR(gl_NormalScale),
+ STATEVAR(gl_BumpRotMatrix0MESA),
+ STATEVAR(gl_BumpRotMatrix1MESA),
STATEVAR(gl_FogParamsOptimizedMESA),
STATEVAR(gl_CurrentAttribVertMESA),
STATEVAR(gl_CurrentAttribFragMESA),
@@ -317,7 +328,7 @@ per_vertex_accumulator::add_field(int slot, const glsl_type *type,
assert(this->num_fields < ARRAY_SIZE(this->fields));
this->fields[this->num_fields].type = type;
this->fields[this->num_fields].name = name;
- this->fields[this->num_fields].matrix_layout = GLSL_MATRIX_LAYOUT_INHERITED;
+ this->fields[this->num_fields].row_major = false;
this->fields[this->num_fields].location = slot;
this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE;
this->fields[this->num_fields].centroid = 0;
@@ -478,9 +489,12 @@ builtin_variable_generator::add_uniform(const glsl_type *type,
&_mesa_builtin_uniform_desc[i];
const unsigned array_count = type->is_array() ? type->length : 1;
+ uni->num_state_slots = array_count * statevar->num_elements;
ir_state_slot *slots =
- uni->allocate_state_slots(array_count * statevar->num_elements);
+ ralloc_array(uni, ir_state_slot, uni->num_state_slots);
+
+ uni->state_slots = slots;
for (unsigned a = 0; a < array_count; a++) {
for (unsigned j = 0; j < statevar->num_elements; j++) {
@@ -669,12 +683,6 @@ builtin_variable_generator::generate_constants()
}
if (state->is_version(430, 0) || state->ARB_compute_shader_enable) {
- add_const("gl_MaxComputeAtomicCounterBuffers", MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS);
- add_const("gl_MaxComputeAtomicCounters", MAX_COMPUTE_ATOMIC_COUNTERS);
- add_const("gl_MaxComputeImageUniforms", MAX_COMPUTE_IMAGE_UNIFORMS);
- add_const("gl_MaxComputeTextureImageUnits", MAX_COMPUTE_TEXTURE_IMAGE_UNITS);
- add_const("gl_MaxComputeUniformComponents", MAX_COMPUTE_UNIFORM_COMPONENTS);
-
add_const_ivec3("gl_MaxComputeWorkGroupCount",
state->Const.MaxComputeWorkGroupCount[0],
state->Const.MaxComputeWorkGroupCount[1],
@@ -724,10 +732,6 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxCombinedImageUniforms",
state->Const.MaxCombinedImageUniforms);
}
-
- if (state->is_version(410, 0) ||
- state->ARB_viewport_array_enable)
- add_const("gl_MaxViewports", state->Const.MaxViewports);
}
@@ -758,6 +762,8 @@ builtin_variable_generator::generate_uniforms()
add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverseTranspose");
add_uniform(float_t, "gl_NormalScale");
add_uniform(type("gl_LightModelParameters"), "gl_LightModel");
+ add_uniform(vec2_t, "gl_BumpRotMatrix0MESA");
+ add_uniform(vec2_t, "gl_BumpRotMatrix1MESA");
add_uniform(vec4_t, "gl_FogParamsOptimizedMESA");
const glsl_type *const mat4_array_type =
@@ -822,8 +828,6 @@ builtin_variable_generator::generate_vs_special_vars()
add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceID");
if (state->AMD_vertex_shader_layer_enable)
add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
- if (state->AMD_vertex_shader_viewport_index_enable)
- add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
if (compatibility) {
add_input(VERT_ATTRIB_POS, vec4_t, "gl_Vertex");
add_input(VERT_ATTRIB_NORMAL, vec3_t, "gl_Normal");
@@ -909,14 +913,14 @@ builtin_variable_generator::generate_fs_special_vars()
ir_variable *const var =
add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefARB");
if (state->ARB_shader_stencil_export_warn)
- var->enable_extension_warning("GL_ARB_shader_stencil_export");
+ var->warn_extension = "GL_ARB_shader_stencil_export";
}
if (state->AMD_shader_stencil_export_enable) {
ir_variable *const var =
add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefAMD");
if (state->AMD_shader_stencil_export_warn)
- var->enable_extension_warning("GL_AMD_shader_stencil_export");
+ var->warn_extension = "GL_AMD_shader_stencil_export";
}
if (state->ARB_sample_shading_enable) {
@@ -935,11 +939,6 @@ builtin_variable_generator::generate_fs_special_vars()
if (state->ARB_gpu_shader5_enable) {
add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn");
}
-
- if (state->ARB_fragment_layer_viewport_enable) {
- add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer");
- add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
- }
}
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp.h b/dist/Mesa/src/glsl/glcpp/glcpp.h
index 70aa14b6e..79ccb234f 100644
--- a/dist/Mesa/src/glsl/glcpp/glcpp.h
+++ b/dist/Mesa/src/glsl/glcpp/glcpp.h
@@ -29,7 +29,7 @@
#include "main/mtypes.h"
-#include "util/ralloc.h"
+#include "../ralloc.h"
#include "program/hash_table.h"
@@ -37,12 +37,6 @@
/* Some data types used for parser values. */
-typedef struct expression_value {
- intmax_t value;
- char *undefined_macro;
-} expression_value_t;
-
-
typedef struct string_node {
const char *str;
struct string_node *next;
@@ -59,7 +53,6 @@ typedef struct token_list token_list_t;
typedef union YYSTYPE
{
intmax_t ival;
- expression_value_t expression_value;
char *str;
string_list_t *string_list;
token_t *token;
@@ -175,17 +168,13 @@ struct glcpp_parser {
yyscan_t scanner;
struct hash_table *defines;
active_list_t *active;
- int lexing_directive;
+ int lexing_if;
int space_tokens;
- int last_token_was_newline;
- int last_token_was_space;
- int first_non_space_token_this_line;
int newline_as_space;
int in_control_line;
int paren_count;
int commented_newlines;
skip_node_t *skip_stack;
- int skipping;
token_list_t *lex_from_list;
token_node_t *lex_from_node;
char *output;
diff --git a/dist/Mesa/src/glsl/glcpp/pp.c b/dist/Mesa/src/glsl/glcpp/pp.c
index a54bcbe16..4a623f81e 100644
--- a/dist/Mesa/src/glsl/glcpp/pp.c
+++ b/dist/Mesa/src/glsl/glcpp/pp.c
@@ -70,42 +70,6 @@ glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
&parser->info_log_length, "\n");
}
-/* Given str, (that's expected to start with a newline terminator of some
- * sort), return a pointer to the first character in str after the newline.
- *
- * A newline terminator can be any of the following sequences:
- *
- * "\r\n"
- * "\n\r"
- * "\n"
- * "\r"
- *
- * And the longest such sequence will be skipped.
- */
-static const char *
-skip_newline (const char *str)
-{
- const char *ret = str;
-
- if (ret == NULL)
- return ret;
-
- if (*ret == '\0')
- return ret;
-
- if (*ret == '\r') {
- ret++;
- if (*ret && *ret == '\n')
- ret++;
- } else if (*ret == '\n') {
- ret++;
- if (*ret && *ret == '\r')
- ret++;
- }
-
- return ret;
-}
-
/* Remove any line continuation characters in the shader, (whether in
* preprocessing directives or in GLSL code).
*/
@@ -114,49 +78,10 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
{
char *clean = ralloc_strdup(ctx, "");
const char *backslash, *newline, *search_start;
- const char *cr, *lf;
- char newline_separator[3];
int collapsed_newlines = 0;
search_start = shader;
- /* Determine what flavor of newlines this shader is using. GLSL
- * provides for 4 different possible ways to separate lines, (using
- * one or two characters):
- *
- * "\n" (line-feed, like Linux, Unix, and new Mac OS)
- * "\r" (carriage-return, like old Mac files)
- * "\r\n" (carriage-return + line-feed, like DOS files)
- * "\n\r" (line-feed + carriage-return, like nothing, really)
- *
- * This code explicitly supports a shader that uses a mixture of
- * newline terminators and will properly handle line continuation
- * backslashes followed by any of the above.
- *
- * But, since we must also insert additional newlines in the output
- * (for any collapsed lines) we attempt to maintain consistency by
- * examining the first encountered newline terminator, and using the
- * same terminator for any newlines we insert.
- */
- cr = strchr(search_start, '\r');
- lf = strchr(search_start, '\n');
-
- newline_separator[0] = '\n';
- newline_separator[1] = '\0';
- newline_separator[2] = '\0';
-
- if (cr == NULL) {
- /* Nothing to do. */
- } else if (lf == NULL) {
- newline_separator[0] = '\r';
- } else if (lf == cr + 1) {
- newline_separator[0] = '\r';
- newline_separator[1] = '\n';
- } else if (cr == lf + 1) {
- newline_separator[0] = '\n';
- newline_separator[1] = '\r';
- }
-
while (true) {
backslash = strchr(search_start, '\\');
@@ -166,24 +91,17 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
* line numbers.
*/
if (collapsed_newlines) {
- cr = strchr (search_start, '\r');
- lf = strchr (search_start, '\n');
- if (cr && lf)
- newline = cr < lf ? cr : lf;
- else if (cr)
- newline = cr;
- else
- newline = lf;
+ newline = strchr(search_start, '\n');
if (newline &&
(backslash == NULL || newline < backslash))
{
ralloc_strncat(&clean, shader,
newline - shader + 1);
while (collapsed_newlines) {
- ralloc_strcat(&clean, newline_separator);
+ ralloc_strcat(&clean, "\n");
collapsed_newlines--;
}
- shader = skip_newline (newline);
+ shader = newline + 1;
search_start = shader;
}
}
@@ -198,11 +116,15 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
* advance the shader pointer to the character after the
* newline.
*/
- if (backslash[1] == '\r' || backslash[1] == '\n')
+ if (backslash[1] == '\n' ||
+ (backslash[1] == '\r' && backslash[2] == '\n'))
{
collapsed_newlines++;
ralloc_strncat(&clean, shader, backslash - shader);
- shader = skip_newline (backslash + 1);
+ if (backslash[1] == '\n')
+ shader = backslash + 2;
+ else
+ shader = backslash + 3;
search_start = shader;
}
}
diff --git a/dist/Mesa/src/glsl/glcpp/tests/000-content-with-spaces.c.expected b/dist/Mesa/src/glsl/glcpp/tests/000-content-with-spaces.c.expected
index 00791910e..5e17ec910 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/000-content-with-spaces.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/000-content-with-spaces.c.expected
@@ -1 +1,2 @@
- this is four tokens with spaces
+ this is four tokens with spaces
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/001-define.c.expected b/dist/Mesa/src/glsl/glcpp/tests/001-define.c.expected
index a464d9da7..878fd15d6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/001-define.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/001-define.c.expected
@@ -1,2 +1,3 @@
1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/002-define-chain.c.expected b/dist/Mesa/src/glsl/glcpp/tests/002-define-chain.c.expected
index c6c9ee38a..43d484d71 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/002-define-chain.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/002-define-chain.c.expected
@@ -1,3 +1,4 @@
1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected b/dist/Mesa/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected
index c6c9ee38a..43d484d71 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected
@@ -1,3 +1,4 @@
1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/004-define-recursive.c.expected b/dist/Mesa/src/glsl/glcpp/tests/004-define-recursive.c.expected
index 2d07687f8..4d2698b7a 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/004-define-recursive.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/004-define-recursive.c.expected
@@ -4,3 +4,4 @@
foo
bar
baz
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/005-define-composite-chain.c.expected b/dist/Mesa/src/glsl/glcpp/tests/005-define-composite-chain.c.expected
index 892975c26..c67358f4f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/005-define-composite-chain.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/005-define-composite-chain.c.expected
@@ -1,3 +1,4 @@
a 1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected b/dist/Mesa/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected
index 892975c26..c67358f4f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected
@@ -1,3 +1,4 @@
a 1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected b/dist/Mesa/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected
index 0b0b477d9..30fe4dc1f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected
@@ -4,3 +4,4 @@
a b c foo
b c a bar
c a b baz
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/008-define-empty.c.expected b/dist/Mesa/src/glsl/glcpp/tests/008-define-empty.c.expected
index d148bc8e8..c0f53d75c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/008-define-empty.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/008-define-empty.c.expected
@@ -1,2 +1,3 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/009-undef.c.expected b/dist/Mesa/src/glsl/glcpp/tests/009-undef.c.expected
index 9c0b35a45..03a7061af 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/009-undef.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/009-undef.c.expected
@@ -2,3 +2,4 @@
1
foo
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/010-undef-re-define.c.expected b/dist/Mesa/src/glsl/glcpp/tests/010-undef-re-define.c.expected
index 5970f4902..f4f7efdc2 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/010-undef-re-define.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/010-undef-re-define.c.expected
@@ -4,3 +4,4 @@
foo
2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/011-define-func-empty.c.expected b/dist/Mesa/src/glsl/glcpp/tests/011-define-func-empty.c.expected
index d148bc8e8..c0f53d75c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/011-define-func-empty.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/011-define-func-empty.c.expected
@@ -1,2 +1,3 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/012-define-func-no-args.c.expected b/dist/Mesa/src/glsl/glcpp/tests/012-define-func-no-args.c.expected
index 9f075f260..035376729 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/012-define-func-no-args.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/012-define-func-no-args.c.expected
@@ -1,2 +1,3 @@
bar
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected b/dist/Mesa/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected
index a464d9da7..878fd15d6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected
@@ -1,2 +1,3 @@
1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected b/dist/Mesa/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected
index a464d9da7..878fd15d6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected
@@ -1,2 +1,3 @@
1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected b/dist/Mesa/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected
index a70321a4c..d6f8cb9dc 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected
@@ -2,3 +2,4 @@
()1()
()2()
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected b/dist/Mesa/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected
index 6bfe04f73..7f1828a3c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected
@@ -1,2 +1,3 @@
((bar)+1)
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/017-define-func-2-args.c.expected b/dist/Mesa/src/glsl/glcpp/tests/017-define-func-2-args.c.expected
index f7a2b8c26..9f341dac0 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/017-define-func-2-args.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/017-define-func-2-args.c.expected
@@ -1,2 +1,3 @@
((bar)*(baz))
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected b/dist/Mesa/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected
index c6c9ee38a..43d484d71 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected
@@ -1,3 +1,4 @@
1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected b/dist/Mesa/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected
index 1e89b8cfd..4314fc88d 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected
@@ -1,2 +1,3 @@
(this is more than one word)
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected b/dist/Mesa/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected
index 19f59f5ec..5648e4fb9 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected
@@ -1,2 +1,3 @@
one fish,two fish,red fish,blue fish
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/021-define-func-compose.c.expected b/dist/Mesa/src/glsl/glcpp/tests/021-define-func-compose.c.expected
index 87f51f0ba..1d62105de 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/021-define-func-compose.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/021-define-func-compose.c.expected
@@ -1,3 +1,4 @@
(2*((1+(3))))
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected b/dist/Mesa/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected
index 1dfc6698b..66c165817 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected
@@ -1,2 +1,3 @@
(argument(including parens)for the win)
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected b/dist/Mesa/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected
index 9c58275d0..573829c2d 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected
@@ -6,3 +6,4 @@
2
3 4
5 6 7
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected b/dist/Mesa/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected
index 15600af54..ad955fce6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected
@@ -1,3 +1,4 @@
foo
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected b/dist/Mesa/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected
index 4a59f0520..960f44511 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected
@@ -1,2 +1,3 @@
foo bar
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected b/dist/Mesa/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected
index 5e3c70f2c..f0888f21b 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected
@@ -1,3 +1,4 @@
bar
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected b/dist/Mesa/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected
index 94c15f950..aef762e1e 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected
@@ -1,3 +1,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected b/dist/Mesa/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected
index 94c15f950..aef762e1e 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected
@@ -1,3 +1,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected b/dist/Mesa/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected
index 94c15f950..aef762e1e 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected
@@ -1,3 +1,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected b/dist/Mesa/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected
index bed826e78..729bdd15f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected
@@ -2,3 +2,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected b/dist/Mesa/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected
index bed826e78..729bdd15f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected
@@ -2,3 +2,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected b/dist/Mesa/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected
index 983f94174..541d44db7 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected
@@ -1,2 +1,3 @@
foo(2*(3))
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected b/dist/Mesa/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected
index 081836236..6ea6905d8 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected
@@ -1,2 +1,3 @@
foo(2*(foo(2*(3))))
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected b/dist/Mesa/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected
index 3f808fe66..24823b1b6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected
@@ -1,2 +1,3 @@
foo
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected b/dist/Mesa/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected
index 09dfdd64e..137a9ea2d 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected
@@ -1,2 +1,3 @@
1+foo
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected b/dist/Mesa/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected
index 580ed9599..ff6360bfe 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected
@@ -1,3 +1,4 @@
more success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected b/dist/Mesa/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected
index e804d7e4f..cbadee848 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected
@@ -1,3 +1,4 @@
expand(just once)
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected b/dist/Mesa/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected
index 6544adb3a..5a28fb3b6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected
@@ -1,2 +1,3 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c b/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
index a7c053bb4..0f7fe632b 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
+++ b/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
@@ -1,24 +1,3 @@
-/* This works. */
#define foo(a) (a)
#define bar two,words
foo(bar)
-
-/* So does this. */
-#define foo2(a,b) (a separate b)
-#define foo2_wrap(a) foo2(a)
-foo2_wrap(bar)
-
-/* But this generates an error. */
-#define foo_wrap(a) foo(a)
-foo_wrap(bar)
-
-/* Adding parentheses to foo_wrap fixes it. */
-#define foo_wrap_parens(a) foo((a))
-foo_wrap_parens(bar)
-
-/* As does adding parentheses to bar */
-#define bar_parens (two,words)
-foo_wrap(bar_parens)
-foo_wrap_parens(bar_parens)
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected b/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected
index 4cc795338..b73869d02 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected
@@ -1,26 +1,4 @@
-0:12(21): preprocessor error: Error: macro foo invoked with 2 arguments (expected 1)
-
-
(two,words)
-
-
-
-(two separate words)
-
-
-
-foo(two,words)
-
-
-
-((two,words))
-
-
-
-((two,words))
-(((two,words)))
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/040-token-pasting.c.expected b/dist/Mesa/src/glsl/glcpp/tests/040-token-pasting.c.expected
index 48e836ec3..36f669925 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/040-token-pasting.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/040-token-pasting.c.expected
@@ -1,2 +1,3 @@
onetoken
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/041-if-0.c.expected b/dist/Mesa/src/glsl/glcpp/tests/041-if-0.c.expected
index 8b506b32d..3800024c6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/041-if-0.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/041-if-0.c.expected
@@ -3,3 +3,4 @@ success_1
success_2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/042-if-1.c.expected b/dist/Mesa/src/glsl/glcpp/tests/042-if-1.c.expected
index a6ae9465a..e591044ad 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/042-if-1.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/042-if-1.c.expected
@@ -3,3 +3,4 @@ success_1
success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/043-if-0-else.c.expected b/dist/Mesa/src/glsl/glcpp/tests/043-if-0-else.c.expected
index 3d7e6be96..ee9e67709 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/043-if-0-else.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/043-if-0-else.c.expected
@@ -5,3 +5,4 @@ success_1
success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/044-if-1-else.c.expected b/dist/Mesa/src/glsl/glcpp/tests/044-if-1-else.c.expected
index 4a31e1cfa..129f5c854 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/044-if-1-else.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/044-if-1-else.c.expected
@@ -5,3 +5,4 @@ success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/045-if-0-elif.c.expected b/dist/Mesa/src/glsl/glcpp/tests/045-if-0-elif.c.expected
index a9bb1588e..97a11b447 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/045-if-0-elif.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/045-if-0-elif.c.expected
@@ -9,3 +9,4 @@ success_3
success_4
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/046-if-1-elsif.c.expected b/dist/Mesa/src/glsl/glcpp/tests/046-if-1-elsif.c.expected
index a4995713c..b928b917e 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/046-if-1-elsif.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/046-if-1-elsif.c.expected
@@ -9,3 +9,4 @@ success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/047-if-elif-else.c.expected b/dist/Mesa/src/glsl/glcpp/tests/047-if-elif-else.c.expected
index 54d308611..e5b53a3fa 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/047-if-elif-else.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/047-if-elif-else.c.expected
@@ -9,3 +9,4 @@ success_1
success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/048-if-nested.c.expected b/dist/Mesa/src/glsl/glcpp/tests/048-if-nested.c.expected
index 8beb9c32c..c61fd0b31 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/048-if-nested.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/048-if-nested.c.expected
@@ -9,3 +9,4 @@ success_1
success_2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected b/dist/Mesa/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected
index 729bdd15f..569debb0b 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected
@@ -3,3 +3,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/050-if-defined.c.expected b/dist/Mesa/src/glsl/glcpp/tests/050-if-defined.c.expected
index 737eb8d94..3f01955ee 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/050-if-defined.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/050-if-defined.c.expected
@@ -15,3 +15,4 @@ success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/051-if-relational.c.expected b/dist/Mesa/src/glsl/glcpp/tests/051-if-relational.c.expected
index 652fefdd4..d2b76f145 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/051-if-relational.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/051-if-relational.c.expected
@@ -33,3 +33,4 @@ success_5
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/052-if-bitwise.c.expected b/dist/Mesa/src/glsl/glcpp/tests/052-if-bitwise.c.expected
index 44e52b206..bb5d92e8d 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/052-if-bitwise.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/052-if-bitwise.c.expected
@@ -18,3 +18,4 @@ success_4
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected b/dist/Mesa/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected
index 7e78e0454..f97e93673 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected
@@ -13,3 +13,4 @@ success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/054-if-with-macros.c.expected b/dist/Mesa/src/glsl/glcpp/tests/054-if-with-macros.c.expected
index 70f737c90..27ea49696 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/054-if-with-macros.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/054-if-with-macros.c.expected
@@ -32,3 +32,4 @@ success_6
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected b/dist/Mesa/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected
index 94c15f950..aef762e1e 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected
@@ -1,3 +1,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected b/dist/Mesa/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected
index bed826e78..729bdd15f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected
@@ -2,3 +2,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/057-empty-arguments.c.expected b/dist/Mesa/src/glsl/glcpp/tests/057-empty-arguments.c.expected
index 7d97e15e2..4e3aad521 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/057-empty-arguments.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/057-empty-arguments.c.expected
@@ -4,3 +4,4 @@ success
success
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected b/dist/Mesa/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected
index e0967a1b9..a1c34e5c1 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected
@@ -3,3 +3,4 @@ ab
a
b
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected b/dist/Mesa/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected
index f1288aa7c..f1a2cd21c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected
@@ -2,3 +2,4 @@
12
1000
identifier2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected b/dist/Mesa/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected
index 3e5501aa6..c1f0d24a1 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected
@@ -1,3 +1,4 @@
5*2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected b/dist/Mesa/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected
index 15eb64b97..111f7d106 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected
@@ -3,3 +3,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected b/dist/Mesa/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected
index 3f2ff2d6c..6fb66a5e2 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected
@@ -3,3 +3,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/064-version.c.expected b/dist/Mesa/src/glsl/glcpp/tests/064-version.c.expected
index 4036b1ee3..3af71113c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/064-version.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/064-version.c.expected
@@ -1,2 +1,3 @@
#version 130
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/065-if-defined-parens.c.expected b/dist/Mesa/src/glsl/glcpp/tests/065-if-defined-parens.c.expected
index 737eb8d94..3f01955ee 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/065-if-defined-parens.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/065-if-defined-parens.c.expected
@@ -15,3 +15,4 @@ success_2
success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected b/dist/Mesa/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected
index 5a28fb3b6..0e84a7cda 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected
@@ -1,3 +1,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected b/dist/Mesa/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected
index 9a5ed2eb2..3340daaa1 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected
@@ -38,3 +38,4 @@ success
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/068-accidental-pasting.c.expected b/dist/Mesa/src/glsl/glcpp/tests/068-accidental-pasting.c.expected
index 27582cda5..ce41cd6e5 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/068-accidental-pasting.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/068-accidental-pasting.c.expected
@@ -9,3 +9,4 @@
| |
+ +
- -
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/069-repeated-argument.c.expected b/dist/Mesa/src/glsl/glcpp/tests/069-repeated-argument.c.expected
index 8b4b095e4..755c4d4b5 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/069-repeated-argument.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/069-repeated-argument.c.expected
@@ -1,2 +1,3 @@
1 1
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected b/dist/Mesa/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected
index 44b93a434..d5a845255 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected
@@ -3,3 +3,4 @@
Success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/071-punctuator.c.expected b/dist/Mesa/src/glsl/glcpp/tests/071-punctuator.c.expected
index 959d68259..fee253b74 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/071-punctuator.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/071-punctuator.c.expected
@@ -1 +1,2 @@
a = b
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected b/dist/Mesa/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected
index 7b80af7e4..c780b43d7 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected
@@ -1,2 +1,3 @@
success_1 success_2 success_3
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected b/dist/Mesa/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected
index fd40910d9..3f2ff2d6c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected
@@ -2,3 +2,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/074-elif-undef.c.expected b/dist/Mesa/src/glsl/glcpp/tests/074-elif-undef.c.expected
index b28b04f64..fd40910d9 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/074-elif-undef.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/074-elif-undef.c.expected
@@ -1,3 +1,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected b/dist/Mesa/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected
index fd40910d9..3f2ff2d6c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected
@@ -2,3 +2,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected b/dist/Mesa/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected
index 3f2ff2d6c..6fb66a5e2 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected
@@ -3,3 +3,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/077-else-without-if.c.expected b/dist/Mesa/src/glsl/glcpp/tests/077-else-without-if.c.expected
index 69f340470..d289b3635 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/077-else-without-if.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/077-else-without-if.c.expected
@@ -1,3 +1,4 @@
-0:1(1): preprocessor error: #else without #if
+0:1(2): preprocessor error: else without #if
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/078-elif-without-if.c.expected b/dist/Mesa/src/glsl/glcpp/tests/078-elif-without-if.c.expected
index b8e40ecc0..7d41f0ac7 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/078-elif-without-if.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/078-elif-without-if.c.expected
@@ -1,3 +1,4 @@
-0:1(1): preprocessor error: #elif without #if
+0:1(2): preprocessor error: elif without #if
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/079-endif-without-if.c.expected b/dist/Mesa/src/glsl/glcpp/tests/079-endif-without-if.c.expected
index 7ae579dd2..08dd33546 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/079-endif-without-if.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/079-endif-without-if.c.expected
@@ -1,3 +1,4 @@
-0:1(1): preprocessor error: #endif without #if
+0:1(2): preprocessor error: #endif without #if
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/080-if-without-expression.c.expected b/dist/Mesa/src/glsl/glcpp/tests/080-if-without-expression.c.expected
index 2e4cd7323..768ba0f47 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/080-if-without-expression.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/080-if-without-expression.c.expected
@@ -3,3 +3,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/081-elif-without-expression.c.expected b/dist/Mesa/src/glsl/glcpp/tests/081-elif-without-expression.c.expected
index b607b8490..974f0f550 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/081-elif-without-expression.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/081-elif-without-expression.c.expected
@@ -2,3 +2,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/082-invalid-paste.c.expected b/dist/Mesa/src/glsl/glcpp/tests/082-invalid-paste.c.expected
index b48a2d6d2..2dd21c063 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/082-invalid-paste.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/082-invalid-paste.c.expected
@@ -17,3 +17,4 @@ Pasting "4" and "+" does not give a valid preprocessing token.
2
34
45.2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/083-unterminated-if.c.expected b/dist/Mesa/src/glsl/glcpp/tests/083-unterminated-if.c.expected
index 4659ab6fe..a69f8bab5 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/083-unterminated-if.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/083-unterminated-if.c.expected
@@ -1,4 +1,5 @@
-0:1(6): preprocessor error: Unterminated #if
+0:1(7): preprocessor error: Unterminated #if
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected b/dist/Mesa/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected
index d23845bfd..1df30cbb5 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected
@@ -9,3 +9,4 @@ MULT()
MULT(1)
MULT(1,2,3)
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/087-if-comments.c.expected b/dist/Mesa/src/glsl/glcpp/tests/087-if-comments.c.expected
index 2783a9c14..827e548fe 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/087-if-comments.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/087-if-comments.c.expected
@@ -3,3 +3,4 @@
win
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c b/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c
index 422c65464..0e0666b8b 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c
+++ b/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c
@@ -1,5 +1,5 @@
#define abc 123
#define abc 123
+#define foo(x) (x)+23
#define foo(x) ( x ) + 23
-#define foo(x) ( x ) + 23
diff --git a/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected b/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected
index 3f2ff2d6c..6fb66a5e2 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected
@@ -3,3 +3,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected b/dist/Mesa/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected
index a94516149..6209ead55 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected
@@ -27,3 +27,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/090-hash-error.c.expected b/dist/Mesa/src/glsl/glcpp/tests/090-hash-error.c.expected
index 876a6ea9c..f2f1fbeaf 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/090-hash-error.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/090-hash-error.c.expected
@@ -1 +1,3 @@
-0:1(1): preprocessor error: #error human error
+0:1(2): preprocessor error: #error human error
+
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/091-hash-line.c.expected b/dist/Mesa/src/glsl/glcpp/tests/091-hash-line.c.expected
index ac9ab252f..48af0b296 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/091-hash-line.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/091-hash-line.c.expected
@@ -3,12 +3,17 @@
1:0(1): preprocessor error: #error source 1, line 0 error
2:30(1): preprocessor error: #error source 2, line 30 error
#line 0
+
#line 25
+
#line 0 1
+
#line 30 2
+
#line 45 2
#line 90 2
#line 180 2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/096-paste-twice.c.expected b/dist/Mesa/src/glsl/glcpp/tests/096-paste-twice.c.expected
index 96c57d2a6..e40194112 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/096-paste-twice.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/096-paste-twice.c.expected
@@ -1,3 +1,4 @@
justonetoken
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/099-c99-example.c.expected b/dist/Mesa/src/glsl/glcpp/tests/099-c99-example.c.expected
index 352bbff48..19be75055 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/099-c99-example.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/099-c99-example.c.expected
@@ -14,3 +14,4 @@
f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
int i[] = { 1, 23, 4, 5, };
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/100-macro-with-colon.c.expected b/dist/Mesa/src/glsl/glcpp/tests/100-macro-with-colon.c.expected
index 09f1f417b..36f98aa3e 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/100-macro-with-colon.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/100-macro-with-colon.c.expected
@@ -2,6 +2,7 @@
switch (1) {
- case 1 + 2:
- break;
+ case 1 + 2:
+ break;
}
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/101-macros-used-twice.c.expected b/dist/Mesa/src/glsl/glcpp/tests/101-macros-used-twice.c.expected
index 1e0b30696..1a4bf1536 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/101-macros-used-twice.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/101-macros-used-twice.c.expected
@@ -14,3 +14,4 @@ once
once again
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/104-hash-line-followed-by-code.c.expected b/dist/Mesa/src/glsl/glcpp/tests/104-hash-line-followed-by-code.c.expected
index 3fbeec48e..e89a2926f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/104-hash-line-followed-by-code.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/104-hash-line-followed-by-code.c.expected
@@ -1,2 +1,3 @@
#line 2
int foo();
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/105-multiline-hash-line.c.expected b/dist/Mesa/src/glsl/glcpp/tests/105-multiline-hash-line.c.expected
index 814cef1b8..fb8e1504c 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/105-multiline-hash-line.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/105-multiline-hash-line.c.expected
@@ -3,3 +3,4 @@
#line 2
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/106-multiline-hash-if.c.expected b/dist/Mesa/src/glsl/glcpp/tests/106-multiline-hash-if.c.expected
index 1c0cbc970..6f5ff2e32 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/106-multiline-hash-if.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/106-multiline-hash-if.c.expected
@@ -4,3 +4,4 @@
int foo();
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/107-multiline-hash-elif.c.expected b/dist/Mesa/src/glsl/glcpp/tests/107-multiline-hash-elif.c.expected
index b0601d7ee..68d489b07 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/107-multiline-hash-elif.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/107-multiline-hash-elif.c.expected
@@ -5,3 +5,4 @@
int foo();
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/108-no-space-after-hash-version.c.expected b/dist/Mesa/src/glsl/glcpp/tests/108-no-space-after-hash-version.c.expected
index 4f4243f94..da4544a55 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/108-no-space-after-hash-version.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/108-no-space-after-hash-version.c.expected
@@ -1 +1,2 @@
-0:1(1): preprocessor error: Illegal non-directive after #
+0:1(3): preprocessor error: Invalid tokens after #
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/109-no-space-after-hash-line.c.expected b/dist/Mesa/src/glsl/glcpp/tests/109-no-space-after-hash-line.c.expected
index 4f4243f94..da4544a55 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/109-no-space-after-hash-line.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/109-no-space-after-hash-line.c.expected
@@ -1 +1,2 @@
-0:1(1): preprocessor error: Illegal non-directive after #
+0:1(3): preprocessor error: Invalid tokens after #
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c.expected b/dist/Mesa/src/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c.expected
index 4d93de41d..6d5e9d1a5 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c.expected
@@ -1,3 +1,4 @@
-0:2(1): preprocessor error: Illegal non-directive after #
+0:2(2): preprocessor error: Invalid tokens after #
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c.expected b/dist/Mesa/src/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c.expected
index 5c005c393..e083008cd 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c.expected
@@ -17,3 +17,4 @@ success
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c.expected b/dist/Mesa/src/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c.expected
index 86b37036b..3b5479a2b 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c.expected
@@ -22,3 +22,4 @@ success
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected b/dist/Mesa/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected
index 55bc788ff..3562fb9ea 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected
@@ -5,3 +5,4 @@
5. Hexadecimal for 20560: 5 0 5 0
6: Zip code for Nortonville, KS: 6 6 0 6 0
7. James Bond, as a number: 0 0 7
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected b/dist/Mesa/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected
index aa9711034..a3ad7da59 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected
@@ -5,3 +5,4 @@
5. Hexadecimal for 20560: 5050
6: Zip code for Nortonville, KS: 66060
7. James Bond, as a number: 007
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/115-line-continuations.c.expected b/dist/Mesa/src/glsl/glcpp/tests/115-line-continuations.c.expected
index 428b5e822..f67ba1cf7 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/115-line-continuations.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/115-line-continuations.c.expected
@@ -7,3 +7,4 @@
success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected b/dist/Mesa/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected
index 5ca78928a..9b9a8c5b6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected
@@ -11,3 +11,4 @@ success
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c.expected b/dist/Mesa/src/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c.expected
index 8aaa04d28..292d6516f 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c.expected
@@ -10,3 +10,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/118-comment-becomes-space.c.expected b/dist/Mesa/src/glsl/glcpp/tests/118-comment-becomes-space.c.expected
index 1fa8135cb..2adf5d1ba 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/118-comment-becomes-space.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/118-comment-becomes-space.c.expected
@@ -2,3 +2,4 @@
first second
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/119-elif-after-else.c.expected b/dist/Mesa/src/glsl/glcpp/tests/119-elif-after-else.c.expected
index 636956799..33f051361 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/119-elif-after-else.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/119-elif-after-else.c.expected
@@ -5,3 +5,4 @@ int foo;
int bar;
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/121-comment-bug-72686.c.expected b/dist/Mesa/src/glsl/glcpp/tests/121-comment-bug-72686.c.expected
index 8cb7cb989..402a76381 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/121-comment-bug-72686.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/121-comment-bug-72686.c.expected
@@ -1,2 +1,3 @@
-
+
+
diff --git a/dist/Mesa/src/glsl/glsl_symbol_table.h b/dist/Mesa/src/glsl/glsl_symbol_table.h
index e32b88b86..f323fc305 100644
--- a/dist/Mesa/src/glsl/glsl_symbol_table.h
+++ b/dist/Mesa/src/glsl/glsl_symbol_table.h
@@ -32,9 +32,9 @@ extern "C" {
#include "program/symbol_table.h"
}
#include "ir.h"
+#include "glsl_types.h"
class symbol_table_entry;
-struct glsl_type;
/**
* Facade class for _mesa_symbol_table
@@ -43,8 +43,37 @@ struct glsl_type;
* type safe and some symbol table invariants.
*/
struct glsl_symbol_table {
- DECLARE_RALLOC_CXX_OPERATORS(glsl_symbol_table)
-
+private:
+ static void
+ _glsl_symbol_table_destructor (glsl_symbol_table *table)
+ {
+ table->~glsl_symbol_table();
+ }
+
+public:
+ /* Callers of this ralloc-based new need not call delete. It's
+ * easier to just ralloc_free 'ctx' (or any of its ancestors). */
+ static void* operator new(size_t size, void *ctx)
+ {
+ void *table;
+
+ table = ralloc_size(ctx, size);
+ assert(table != NULL);
+
+ ralloc_set_destructor(table, (void (*)(void*)) _glsl_symbol_table_destructor);
+
+ return table;
+ }
+
+ /* If the user *does* call delete, that's OK, we will just
+ * ralloc_free in that case. Here, C++ will have already called the
+ * destructor so tell ralloc not to do that again. */
+ static void operator delete(void *table)
+ {
+ ralloc_set_destructor(table, NULL);
+ ralloc_free(table);
+ }
+
glsl_symbol_table();
~glsl_symbol_table();
diff --git a/dist/Mesa/src/glsl/hir_field_selection.cpp b/dist/Mesa/src/glsl/hir_field_selection.cpp
index 0fa976811..1e92c89ae 100644
--- a/dist/Mesa/src/glsl/hir_field_selection.cpp
+++ b/dist/Mesa/src/glsl/hir_field_selection.cpp
@@ -22,6 +22,7 @@
*/
#include "ir.h"
+#include "program/symbol_table.h"
#include "glsl_parser_extras.h"
#include "ast.h"
#include "glsl_types.h"
diff --git a/dist/Mesa/src/glsl/ir_basic_block.cpp b/dist/Mesa/src/glsl/ir_basic_block.cpp
index 15481aa47..426fda2f2 100644
--- a/dist/Mesa/src/glsl/ir_basic_block.cpp
+++ b/dist/Mesa/src/glsl/ir_basic_block.cpp
@@ -28,7 +28,9 @@
*/
#include "ir.h"
+#include "ir_visitor.h"
#include "ir_basic_block.h"
+#include "glsl_types.h"
/**
* Calls a user function for every basic block in the instruction stream.
@@ -56,7 +58,8 @@ void call_for_basic_blocks(exec_list *instructions,
ir_instruction *leader = NULL;
ir_instruction *last = NULL;
- foreach_in_list(ir_instruction, ir, instructions) {
+ foreach_list(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
ir_if *ir_if;
ir_loop *ir_loop;
ir_function *ir_function;
@@ -87,7 +90,9 @@ void call_for_basic_blocks(exec_list *instructions,
* and the body of main(). Perhaps those instructions ought
* to live inside of main().
*/
- foreach_in_list(ir_function_signature, ir_sig, &ir_function->signatures) {
+ foreach_list(func_node, &ir_function->signatures) {
+ ir_function_signature *ir_sig = (ir_function_signature *) func_node;
+
call_for_basic_blocks(&ir_sig->body, callback, data);
}
}
diff --git a/dist/Mesa/src/glsl/ir_builder.cpp b/dist/Mesa/src/glsl/ir_builder.cpp
index a2f6f2967..f4a1c6efa 100644
--- a/dist/Mesa/src/glsl/ir_builder.cpp
+++ b/dist/Mesa/src/glsl/ir_builder.cpp
@@ -271,7 +271,11 @@ clamp(operand a, operand b, operand c)
ir_expression *
saturate(operand a)
{
- return expr(ir_unop_saturate, a);
+ void *mem_ctx = ralloc_parent(a.val);
+
+ return expr(ir_binop_max,
+ expr(ir_binop_min, a, new(mem_ctx) ir_constant(1.0f)),
+ new(mem_ctx) ir_constant(0.0f));
}
ir_expression *
@@ -497,24 +501,6 @@ b2f(operand a)
}
ir_expression *
-interpolate_at_centroid(operand a)
-{
- return expr(ir_unop_interpolate_at_centroid, a);
-}
-
-ir_expression *
-interpolate_at_offset(operand a, operand b)
-{
- return expr(ir_binop_interpolate_at_offset, a, b);
-}
-
-ir_expression *
-interpolate_at_sample(operand a, operand b)
-{
- return expr(ir_binop_interpolate_at_sample, a, b);
-}
-
-ir_expression *
fma(operand a, operand b, operand c)
{
return expr(ir_triop_fma, a, b, c);
diff --git a/dist/Mesa/src/glsl/ir_builder.h b/dist/Mesa/src/glsl/ir_builder.h
index 573596cf1..108b53a5e 100644
--- a/dist/Mesa/src/glsl/ir_builder.h
+++ b/dist/Mesa/src/glsl/ir_builder.h
@@ -186,10 +186,6 @@ ir_expression *b2f(operand a);
ir_expression *min2(operand a, operand b);
ir_expression *max2(operand a, operand b);
-ir_expression *interpolate_at_centroid(operand a);
-ir_expression *interpolate_at_offset(operand a, operand b);
-ir_expression *interpolate_at_sample(operand a, operand b);
-
ir_expression *fma(operand a, operand b, operand c);
ir_expression *lrp(operand x, operand y, operand a);
ir_expression *csel(operand a, operand b, operand c);
diff --git a/dist/Mesa/src/glsl/ir_expression_flattening.cpp b/dist/Mesa/src/glsl/ir_expression_flattening.cpp
index c13ae811d..c1cadb122 100644
--- a/dist/Mesa/src/glsl/ir_expression_flattening.cpp
+++ b/dist/Mesa/src/glsl/ir_expression_flattening.cpp
@@ -32,8 +32,10 @@
*/
#include "ir.h"
+#include "ir_visitor.h"
#include "ir_rvalue_visitor.h"
#include "ir_expression_flattening.h"
+#include "glsl_types.h"
class ir_expression_flattening_visitor : public ir_rvalue_visitor {
public:
@@ -57,7 +59,9 @@ do_expression_flattening(exec_list *instructions,
{
ir_expression_flattening_visitor v(predicate);
- foreach_in_list(ir_instruction, ir, instructions) {
+ foreach_list(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
+
ir->accept(&v);
}
}
diff --git a/dist/Mesa/src/glsl/ir_hierarchical_visitor.cpp b/dist/Mesa/src/glsl/ir_hierarchical_visitor.cpp
index adb629414..2e606dda4 100644
--- a/dist/Mesa/src/glsl/ir_hierarchical_visitor.cpp
+++ b/dist/Mesa/src/glsl/ir_hierarchical_visitor.cpp
@@ -27,18 +27,16 @@
ir_hierarchical_visitor::ir_hierarchical_visitor()
{
this->base_ir = NULL;
- this->callback_enter = NULL;
- this->callback_leave = NULL;
- this->data_enter = NULL;
- this->data_leave = NULL;
+ this->callback = NULL;
+ this->data = NULL;
this->in_assignee = false;
}
ir_visitor_status
ir_hierarchical_visitor::visit(ir_rvalue *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -46,8 +44,8 @@ ir_hierarchical_visitor::visit(ir_rvalue *ir)
ir_visitor_status
ir_hierarchical_visitor::visit(ir_variable *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -55,8 +53,8 @@ ir_hierarchical_visitor::visit(ir_variable *ir)
ir_visitor_status
ir_hierarchical_visitor::visit(ir_constant *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -64,8 +62,26 @@ ir_hierarchical_visitor::visit(ir_constant *ir)
ir_visitor_status
ir_hierarchical_visitor::visit(ir_loop_jump *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_hierarchical_visitor::visit(ir_emit_vertex *ir)
+{
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_hierarchical_visitor::visit(ir_end_primitive *ir)
+{
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -73,8 +89,8 @@ ir_hierarchical_visitor::visit(ir_loop_jump *ir)
ir_visitor_status
ir_hierarchical_visitor::visit(ir_dereference_variable *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -82,8 +98,8 @@ ir_hierarchical_visitor::visit(ir_dereference_variable *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_loop *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -91,17 +107,15 @@ ir_hierarchical_visitor::visit_enter(ir_loop *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_loop *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_function_signature *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -109,17 +123,15 @@ ir_hierarchical_visitor::visit_enter(ir_function_signature *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_function_signature *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_function *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -127,17 +139,15 @@ ir_hierarchical_visitor::visit_enter(ir_function *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_function *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_expression *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -145,17 +155,15 @@ ir_hierarchical_visitor::visit_enter(ir_expression *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_expression *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_texture *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -163,17 +171,15 @@ ir_hierarchical_visitor::visit_enter(ir_texture *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_texture *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_swizzle *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -181,17 +187,15 @@ ir_hierarchical_visitor::visit_enter(ir_swizzle *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_swizzle *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_dereference_array *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -199,17 +203,15 @@ ir_hierarchical_visitor::visit_enter(ir_dereference_array *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_dereference_array *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_dereference_record *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -217,17 +219,15 @@ ir_hierarchical_visitor::visit_enter(ir_dereference_record *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_dereference_record *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_assignment *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -235,17 +235,15 @@ ir_hierarchical_visitor::visit_enter(ir_assignment *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_assignment *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_call *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -253,17 +251,15 @@ ir_hierarchical_visitor::visit_enter(ir_call *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_call *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_return *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -271,17 +267,15 @@ ir_hierarchical_visitor::visit_enter(ir_return *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_return *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_discard *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -289,17 +283,15 @@ ir_hierarchical_visitor::visit_enter(ir_discard *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_discard *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
ir_visitor_status
ir_hierarchical_visitor::visit_enter(ir_if *ir)
{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
+ if (this->callback != NULL)
+ this->callback(ir, this->data);
return visit_continue;
}
@@ -307,45 +299,7 @@ ir_hierarchical_visitor::visit_enter(ir_if *ir)
ir_visitor_status
ir_hierarchical_visitor::visit_leave(ir_if *ir)
{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_hierarchical_visitor::visit_enter(ir_emit_vertex *ir)
-{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_hierarchical_visitor::visit_leave(ir_emit_vertex *ir)
-{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_hierarchical_visitor::visit_enter(ir_end_primitive *ir)
-{
- if (this->callback_enter != NULL)
- this->callback_enter(ir, this->data_enter);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_hierarchical_visitor::visit_leave(ir_end_primitive *ir)
-{
- if (this->callback_leave != NULL)
- this->callback_leave(ir, this->data_leave);
-
+ (void) ir;
return visit_continue;
}
@@ -358,17 +312,13 @@ ir_hierarchical_visitor::run(exec_list *instructions)
void
visit_tree(ir_instruction *ir,
- void (*callback_enter)(class ir_instruction *ir, void *data),
- void *data_enter,
- void (*callback_leave)(class ir_instruction *ir, void *data),
- void *data_leave)
+ void (*callback)(class ir_instruction *ir, void *data),
+ void *data)
{
ir_hierarchical_visitor v;
- v.callback_enter = callback_enter;
- v.callback_leave = callback_leave;
- v.data_enter = data_enter;
- v.data_leave = data_leave;
+ v.callback = callback;
+ v.data = data;
ir->accept(&v);
}
diff --git a/dist/Mesa/src/glsl/ir_rvalue_visitor.h b/dist/Mesa/src/glsl/ir_rvalue_visitor.h
index 04ec0fa39..2179fa5a8 100644
--- a/dist/Mesa/src/glsl/ir_rvalue_visitor.h
+++ b/dist/Mesa/src/glsl/ir_rvalue_visitor.h
@@ -41,8 +41,6 @@ public:
ir_visitor_status rvalue_visit(ir_return *);
ir_visitor_status rvalue_visit(ir_swizzle *);
ir_visitor_status rvalue_visit(ir_texture *);
- ir_visitor_status rvalue_visit(ir_emit_vertex *);
- ir_visitor_status rvalue_visit(ir_end_primitive *);
virtual void handle_rvalue(ir_rvalue **rvalue) = 0;
};
@@ -59,8 +57,6 @@ public:
virtual ir_visitor_status visit_leave(ir_return *);
virtual ir_visitor_status visit_leave(ir_swizzle *);
virtual ir_visitor_status visit_leave(ir_texture *);
- virtual ir_visitor_status visit_leave(ir_emit_vertex *);
- virtual ir_visitor_status visit_leave(ir_end_primitive *);
};
class ir_rvalue_enter_visitor : public ir_rvalue_base_visitor {
@@ -75,6 +71,4 @@ public:
virtual ir_visitor_status visit_enter(ir_return *);
virtual ir_visitor_status visit_enter(ir_swizzle *);
virtual ir_visitor_status visit_enter(ir_texture *);
- virtual ir_visitor_status visit_enter(ir_emit_vertex *);
- virtual ir_visitor_status visit_enter(ir_end_primitive *);
};
diff --git a/dist/Mesa/src/glsl/ir_uniform.h b/dist/Mesa/src/glsl/ir_uniform.h
index 21b5d05c1..3508509d4 100644
--- a/dist/Mesa/src/glsl/ir_uniform.h
+++ b/dist/Mesa/src/glsl/ir_uniform.h
@@ -32,19 +32,25 @@
#include "program/prog_parameter.h" /* For union gl_constant_value. */
-/**
- * Used by GL_ARB_explicit_uniform_location extension code in the linker
- * and glUniform* functions to identify inactive explicit uniform locations.
- */
-#define INACTIVE_UNIFORM_EXPLICIT_LOCATION ((gl_uniform_storage *) -1)
#ifdef __cplusplus
extern "C" {
#endif
-enum PACKED gl_uniform_driver_format {
+enum gl_uniform_driver_format {
uniform_native = 0, /**< Store data in the native format. */
uniform_int_float, /**< Store integer data as floats. */
+ uniform_bool_float, /**< Store boolean data as floats. */
+
+ /**
+ * Store boolean data as integer using 1 for \c true.
+ */
+ uniform_bool_int_0_1,
+
+ /**
+ * Store boolean data as integer using ~0 for \c true.
+ */
+ uniform_bool_int_0_not0
};
struct gl_uniform_driver_storage {
@@ -60,8 +66,11 @@ struct gl_uniform_driver_storage {
/**
* Base format of the stored data.
+ *
+ * This field must have a value from \c GLSL_TYPE_UINT through \c
+ * GLSL_TYPE_SAMPLER.
*/
- enum gl_uniform_driver_format format;
+ uint8_t format;
/**
* Pointer to the base of the data.
@@ -175,12 +184,6 @@ struct gl_uniform_storage {
* arrays this is the first element in the array.
*/
unsigned remap_location;
-
- /**
- * This is a compiler-generated uniform that should not be advertised
- * via the API.
- */
- bool hidden;
};
#ifdef __cplusplus
diff --git a/dist/Mesa/src/glsl/ir_variable_refcount.cpp b/dist/Mesa/src/glsl/ir_variable_refcount.cpp
index f67fe6784..923eb1a82 100644
--- a/dist/Mesa/src/glsl/ir_variable_refcount.cpp
+++ b/dist/Mesa/src/glsl/ir_variable_refcount.cpp
@@ -33,7 +33,7 @@
#include "ir_visitor.h"
#include "ir_variable_refcount.h"
#include "glsl_types.h"
-#include "util/hash_table.h"
+#include "main/hash_table.h"
ir_variable_refcount_visitor::ir_variable_refcount_visitor()
{
diff --git a/dist/Mesa/src/glsl/link_atomics.cpp b/dist/Mesa/src/glsl/link_atomics.cpp
index 603873a5d..d92cdb117 100644
--- a/dist/Mesa/src/glsl/link_atomics.cpp
+++ b/dist/Mesa/src/glsl/link_atomics.cpp
@@ -54,18 +54,9 @@ namespace {
void push_back(unsigned id, ir_variable *var)
{
- active_atomic_counter *new_counters;
+ counters = (active_atomic_counter *)
+ realloc(counters, sizeof(active_atomic_counter) * (num_counters + 1));
- new_counters = (active_atomic_counter *)
- realloc(counters, sizeof(active_atomic_counter) *
- (num_counters + 1));
-
- if (new_counters == NULL) {
- _mesa_error_no_memory(__func__);
- return;
- }
-
- counters = new_counters;
counters[num_counters].id = id;
counters[num_counters].var = var;
num_counters++;
@@ -110,8 +101,8 @@ namespace {
if (sh == NULL)
continue;
- foreach_in_list(ir_instruction, node, sh->ir) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, sh->ir) {
+ ir_variable *var = ((ir_instruction *)node)->as_variable();
if (var && var->type->contains_atomic()) {
unsigned id = 0;
@@ -201,9 +192,7 @@ link_assign_atomic_counter_resources(struct gl_context *ctx,
gl_uniform_storage *const storage = &prog->UniformStorage[id];
mab.Uniforms[j] = id;
- if (!var->data.explicit_binding)
- var->data.binding = i;
-
+ var->data.atomic.buffer_index = i;
storage->atomic_buffer_index = i;
storage->offset = var->data.atomic.offset;
storage->array_stride = (var->type->is_array() ?
diff --git a/dist/Mesa/src/glsl/link_interface_blocks.cpp b/dist/Mesa/src/glsl/link_interface_blocks.cpp
index 0ce502d4f..52552cc68 100644
--- a/dist/Mesa/src/glsl/link_interface_blocks.cpp
+++ b/dist/Mesa/src/glsl/link_interface_blocks.cpp
@@ -259,8 +259,8 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog,
if (shader_list[i] == NULL)
continue;
- foreach_in_list(ir_instruction, node, shader_list[i]->ir) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, shader_list[i]->ir) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var)
continue;
@@ -316,8 +316,8 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog,
const bool extra_array_level = consumer->Stage == MESA_SHADER_GEOMETRY;
/* Add input interfaces from the consumer to the symbol table. */
- foreach_in_list(ir_instruction, node, consumer->ir) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, consumer->ir) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_in)
continue;
@@ -325,8 +325,8 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog,
}
/* Verify that the producer's output interfaces match. */
- foreach_in_list(ir_instruction, node, producer->ir) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, producer->ir) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_out)
continue;
@@ -359,8 +359,8 @@ validate_interstage_uniform_blocks(struct gl_shader_program *prog,
continue;
const gl_shader *stage = stages[i];
- foreach_in_list(ir_instruction, node, stage->ir) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, stage->ir) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var || !var->get_interface_type() || var->data.mode != ir_var_uniform)
continue;
diff --git a/dist/Mesa/src/glsl/link_uniform_block_active_visitor.cpp b/dist/Mesa/src/glsl/link_uniform_block_active_visitor.cpp
index 9da6a4bba..d19ce20c7 100644
--- a/dist/Mesa/src/glsl/link_uniform_block_active_visitor.cpp
+++ b/dist/Mesa/src/glsl/link_uniform_block_active_visitor.cpp
@@ -73,45 +73,6 @@ process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var)
}
ir_visitor_status
-link_uniform_block_active_visitor::visit(ir_variable *var)
-{
- if (!var->is_in_uniform_block())
- return visit_continue;
-
- const glsl_type *const block_type = var->is_interface_instance()
- ? var->type : var->get_interface_type();
-
- /* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec says:
- *
- * "All members of a named uniform block declared with a shared or
- * std140 layout qualifier are considered active, even if they are not
- * referenced in any shader in the program. The uniform block itself is
- * also considered active, even if no member of the block is
- * referenced."
- */
- if (block_type->interface_packing == GLSL_INTERFACE_PACKING_PACKED)
- return visit_continue;
-
- /* Process the block. Bail if there was an error.
- */
- link_uniform_block_active *const b =
- process_block(this->mem_ctx, this->ht, var);
- if (b == NULL) {
- linker_error(this->prog,
- "uniform block `%s' has mismatching definitions",
- var->get_interface_type()->name);
- this->success = false;
- return visit_stop;
- }
-
- assert(b->num_array_elements == 0);
- assert(b->array_elements == NULL);
- assert(b->type != NULL);
-
- return visit_continue;
-}
-
-ir_visitor_status
link_uniform_block_active_visitor::visit_enter(ir_dereference_array *ir)
{
ir_dereference_variable *const d = ir->array->as_dereference_variable();
@@ -148,44 +109,32 @@ link_uniform_block_active_visitor::visit_enter(ir_dereference_array *ir)
assert((b->num_array_elements == 0) == (b->array_elements == NULL));
assert(b->type != NULL);
+ /* Determine whether or not this array index has already been added to the
+ * list of active array indices. At this point all constant folding must
+ * have occured, and the array index must be a constant.
+ */
ir_constant *c = ir->array_index->as_constant();
+ assert(c != NULL);
- if (c) {
- /* Index is a constant, so mark just that element used, if not already */
- const unsigned idx = c->get_uint_component(0);
+ const unsigned idx = c->get_uint_component(0);
- unsigned i;
- for (i = 0; i < b->num_array_elements; i++) {
- if (b->array_elements[i] == idx)
- break;
- }
+ unsigned i;
+ for (i = 0; i < b->num_array_elements; i++) {
+ if (b->array_elements[i] == idx)
+ break;
+ }
- assert(i <= b->num_array_elements);
+ assert(i <= b->num_array_elements);
- if (i == b->num_array_elements) {
- b->array_elements = reralloc(this->mem_ctx,
- b->array_elements,
- unsigned,
- b->num_array_elements + 1);
+ if (i == b->num_array_elements) {
+ b->array_elements = reralloc(this->mem_ctx,
+ b->array_elements,
+ unsigned,
+ b->num_array_elements + 1);
- b->array_elements[b->num_array_elements] = idx;
+ b->array_elements[b->num_array_elements] = idx;
- b->num_array_elements++;
- }
- } else {
- /* The array index is not a constant, so mark the entire array used. */
- assert(b->type->is_array());
- if (b->num_array_elements < b->type->length) {
- b->num_array_elements = b->type->length;
- b->array_elements = reralloc(this->mem_ctx,
- b->array_elements,
- unsigned,
- b->num_array_elements);
-
- for (unsigned i = 0; i < b->num_array_elements; i++) {
- b->array_elements[i] = i;
- }
- }
+ b->num_array_elements++;
}
return visit_continue_with_parent;
diff --git a/dist/Mesa/src/glsl/link_uniform_block_active_visitor.h b/dist/Mesa/src/glsl/link_uniform_block_active_visitor.h
index e5ea50155..d76dbcaf1 100644
--- a/dist/Mesa/src/glsl/link_uniform_block_active_visitor.h
+++ b/dist/Mesa/src/glsl/link_uniform_block_active_visitor.h
@@ -26,7 +26,9 @@
#define LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H
#include "ir.h"
-#include "util/hash_table.h"
+#include "ir_visitor.h"
+#include "glsl_types.h"
+#include "main/hash_table.h"
struct link_uniform_block_active {
const glsl_type *type;
@@ -51,7 +53,6 @@ public:
virtual ir_visitor_status visit_enter(ir_dereference_array *);
virtual ir_visitor_status visit(ir_dereference_variable *);
- virtual ir_visitor_status visit(ir_variable *);
bool success;
diff --git a/dist/Mesa/src/glsl/link_uniform_blocks.cpp b/dist/Mesa/src/glsl/link_uniform_blocks.cpp
index 536fcd458..1a0e64318 100644
--- a/dist/Mesa/src/glsl/link_uniform_blocks.cpp
+++ b/dist/Mesa/src/glsl/link_uniform_blocks.cpp
@@ -26,7 +26,7 @@
#include "linker.h"
#include "ir_uniform.h"
#include "link_uniform_block_active_visitor.h"
-#include "util/hash_table.h"
+#include "main/hash_table.h"
#include "program.h"
namespace {
@@ -68,8 +68,7 @@ private:
}
virtual void visit_field(const glsl_type *type, const char *name,
- bool row_major, const glsl_type *record_type,
- bool last_field)
+ bool row_major, const glsl_type *record_type)
{
assert(this->index < this->num_variables);
@@ -77,7 +76,7 @@ private:
v->Name = ralloc_strdup(mem_ctx, name);
v->Type = type;
- v->RowMajor = type->without_array()->is_matrix() && row_major;
+ v->RowMajor = row_major;
if (this->is_array_instance) {
v->IndexName = ralloc_strdup(mem_ctx, name);
@@ -93,31 +92,18 @@ private:
unsigned len = strlen(close_bracket + 1) + 1;
memmove(open_bracket, close_bracket + 1, len);
- } else {
+ } else {
v->IndexName = v->Name;
}
const unsigned alignment = record_type
- ? record_type->std140_base_alignment(v->RowMajor)
- : type->std140_base_alignment(v->RowMajor);
+ ? record_type->std140_base_alignment(v->RowMajor)
+ : type->std140_base_alignment(v->RowMajor);
unsigned size = type->std140_size(v->RowMajor);
this->offset = glsl_align(this->offset, alignment);
v->Offset = this->offset;
-
- /* If this is the last field of a structure, apply rule #9. The
- * GL_ARB_uniform_buffer_object spec says:
- *
- * "The structure may have padding at the end; the base offset of
- * the member following the sub-structure is rounded up to the next
- * multiple of the base alignment of the structure."
- *
- * last_field won't be set if this is the last field of a UBO that is
- * not a named instance.
- */
this->offset += size;
- if (last_field)
- this->offset = glsl_align(this->offset, 16);
/* From the GL_ARB_uniform_buffer_object spec:
*
@@ -184,12 +170,6 @@ link_uniform_blocks(void *mem_ctx,
struct hash_table *block_hash =
_mesa_hash_table_create(mem_ctx, _mesa_key_string_equal);
- if (block_hash == NULL) {
- _mesa_error_no_memory(__func__);
- linker_error(prog, "out of memory\n");
- return 0;
- }
-
/* Determine which uniform blocks are active.
*/
link_uniform_block_active_visitor v(mem_ctx, block_hash, prog);
diff --git a/dist/Mesa/src/glsl/link_uniform_initializers.cpp b/dist/Mesa/src/glsl/link_uniform_initializers.cpp
index f6a60bce9..2100e0517 100644
--- a/dist/Mesa/src/glsl/link_uniform_initializers.cpp
+++ b/dist/Mesa/src/glsl/link_uniform_initializers.cpp
@@ -25,6 +25,8 @@
#include "ir.h"
#include "linker.h"
#include "ir_uniform.h"
+#include "glsl_symbol_table.h"
+#include "program/hash_table.h"
/* These functions are put in a "private" namespace instead of being marked
* static so that the unit tests can access them. See
@@ -60,8 +62,7 @@ void
copy_constant_to_storage(union gl_constant_value *storage,
const ir_constant *val,
const enum glsl_base_type base_type,
- const unsigned int elements,
- unsigned int boolean_true)
+ const unsigned int elements)
{
for (unsigned int i = 0; i < elements; i++) {
switch (base_type) {
@@ -76,7 +77,7 @@ copy_constant_to_storage(union gl_constant_value *storage,
storage[i].f = val->value.f[i];
break;
case GLSL_TYPE_BOOL:
- storage[i].b = val->value.b[i] ? boolean_true : 0;
+ storage[i].b = int(val->value.b[i]);
break;
case GLSL_TYPE_ARRAY:
case GLSL_TYPE_STRUCT:
@@ -157,7 +158,7 @@ set_block_binding(gl_shader_program *prog, const char *block_name, int binding)
void
set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
const char *name, const glsl_type *type,
- ir_constant *val, unsigned int boolean_true)
+ ir_constant *val)
{
if (type->is_record()) {
ir_constant *field_constant;
@@ -169,7 +170,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name,
type->fields.structure[i].name);
set_uniform_initializer(mem_ctx, prog, field_name,
- field_type, field_constant, boolean_true);
+ field_type, field_constant);
field_constant = (ir_constant *)field_constant->next;
}
return;
@@ -180,8 +181,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
set_uniform_initializer(mem_ctx, prog, element_name,
- element_type, val->array_elements[i],
- boolean_true);
+ element_type, val->array_elements[i]);
}
return;
}
@@ -206,8 +206,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
copy_constant_to_storage(& storage->storage[idx],
val->array_elements[i],
base_type,
- elements,
- boolean_true);
+ elements);
idx += elements;
}
@@ -215,8 +214,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
copy_constant_to_storage(storage->storage,
val,
val->type->base_type,
- val->type->components(),
- boolean_true);
+ val->type->components());
if (storage->type->is_sampler()) {
for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) {
@@ -236,8 +234,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
}
void
-link_set_uniform_initializers(struct gl_shader_program *prog,
- unsigned int boolean_true)
+link_set_uniform_initializers(struct gl_shader_program *prog)
{
void *mem_ctx = NULL;
@@ -247,8 +244,8 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
if (shader == NULL)
continue;
- foreach_in_list(ir_instruction, node, shader->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, shader->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (!var || var->data.mode != ir_var_uniform)
continue;
@@ -259,7 +256,8 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
if (var->data.explicit_binding) {
const glsl_type *const type = var->type;
- if (type->without_array()->is_sampler()) {
+ if (type->is_sampler()
+ || (type->is_array() && type->fields.array->is_sampler())) {
linker::set_sampler_binding(prog, var->name, var->data.binding);
} else if (var->is_in_uniform_block()) {
const glsl_type *const iface_type = var->get_interface_type();
@@ -305,8 +303,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
}
} else if (var->constant_value) {
linker::set_uniform_initializer(mem_ctx, prog, var->name,
- var->type, var->constant_value,
- boolean_true);
+ var->type, var->constant_value);
}
}
}
diff --git a/dist/Mesa/src/glsl/link_uniforms.cpp b/dist/Mesa/src/glsl/link_uniforms.cpp
index de2f6c9ac..29dc0b196 100644
--- a/dist/Mesa/src/glsl/link_uniforms.cpp
+++ b/dist/Mesa/src/glsl/link_uniforms.cpp
@@ -37,11 +37,6 @@
*/
/**
- * Used by linker to indicate uniforms that have no location set.
- */
-#define UNMAPPED_UNIFORM_LOC ~0u
-
-/**
* Count the backing storage requirements for a type
*/
static unsigned
@@ -59,11 +54,13 @@ values_for_type(const glsl_type *type)
void
program_resource_visitor::process(const glsl_type *type, const char *name)
{
- assert(type->without_array()->is_record()
- || type->without_array()->is_interface());
+ assert(type->is_record()
+ || (type->is_array() && type->fields.array->is_record())
+ || type->is_interface()
+ || (type->is_array() && type->fields.array->is_interface()));
char *name_copy = ralloc_strdup(NULL, name);
- recursion(type, &name_copy, strlen(name), false, NULL, false);
+ recursion(type, &name_copy, strlen(name), false, NULL);
ralloc_free(name_copy);
}
@@ -71,8 +68,6 @@ void
program_resource_visitor::process(ir_variable *var)
{
const glsl_type *t = var->type;
- const bool row_major =
- var->data.matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR;
/* false is always passed for the row_major parameter to the other
* processing functions because no information is available to do
@@ -110,7 +105,7 @@ program_resource_visitor::process(ir_variable *var)
* lowering is only applied to non-uniform interface blocks, so we
* can safely pass false for row_major.
*/
- recursion(var->type, &name, new_length, row_major, NULL, false);
+ recursion(var->type, &name, new_length, false, NULL);
}
ralloc_free(name);
} else if (var->data.from_named_ifc_block_nonarray) {
@@ -134,30 +129,29 @@ program_resource_visitor::process(ir_variable *var)
* is only applied to non-uniform interface blocks, so we can safely
* pass false for row_major.
*/
- recursion(var->type, &name, strlen(name), row_major, NULL, false);
+ recursion(var->type, &name, strlen(name), false, NULL);
ralloc_free(name);
- } else if (t->without_array()->is_record()) {
+ } else if (t->is_record() || (t->is_array() && t->fields.array->is_record())) {
char *name = ralloc_strdup(NULL, var->name);
- recursion(var->type, &name, strlen(name), row_major, NULL, false);
+ recursion(var->type, &name, strlen(name), false, NULL);
ralloc_free(name);
} else if (t->is_interface()) {
char *name = ralloc_strdup(NULL, var->type->name);
- recursion(var->type, &name, strlen(name), row_major, NULL, false);
+ recursion(var->type, &name, strlen(name), false, NULL);
ralloc_free(name);
} else if (t->is_array() && t->fields.array->is_interface()) {
char *name = ralloc_strdup(NULL, var->type->fields.array->name);
- recursion(var->type, &name, strlen(name), row_major, NULL, false);
+ recursion(var->type, &name, strlen(name), false, NULL);
ralloc_free(name);
} else {
- this->visit_field(t, var->name, row_major, NULL, false);
+ this->visit_field(t, var->name, false, NULL);
}
}
void
program_resource_visitor::recursion(const glsl_type *t, char **name,
size_t name_length, bool row_major,
- const glsl_type *record_type,
- bool last_field)
+ const glsl_type *record_type)
{
/* Records need to have each field processed individually.
*
@@ -183,25 +177,8 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
ralloc_asprintf_rewrite_tail(name, &new_length, ".%s", field);
}
- /* The layout of structures at the top level of the block is set
- * during parsing. For matrices contained in multiple levels of
- * structures in the block, the inner structures have no layout.
- * These cases must potentially inherit the layout from the outer
- * levels.
- */
- bool field_row_major = row_major;
- const enum glsl_matrix_layout matrix_layout =
- glsl_matrix_layout(t->fields.structure[i].matrix_layout);
- if (matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR) {
- field_row_major = true;
- } else if (matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR) {
- field_row_major = false;
- }
-
recursion(t->fields.structure[i].type, name, new_length,
- field_row_major,
- record_type,
- (i + 1) == t->length);
+ t->fields.structure[i].row_major, record_type);
/* Only the first leaf-field of the record gets called with the
* record type pointer.
@@ -220,8 +197,7 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i);
recursion(t->fields.array, name, new_length, row_major,
- record_type,
- (i + 1) == t->length);
+ record_type);
/* Only the first leaf-field of the record gets called with the
* record type pointer.
@@ -229,15 +205,14 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
record_type = NULL;
}
} else {
- this->visit_field(t, *name, row_major, record_type, last_field);
+ this->visit_field(t, *name, row_major, record_type);
}
}
void
program_resource_visitor::visit_field(const glsl_type *type, const char *name,
bool row_major,
- const glsl_type *,
- bool /* last_field */)
+ const glsl_type *)
{
visit_field(type, name, row_major);
}
@@ -319,8 +294,10 @@ private:
virtual void visit_field(const glsl_type *type, const char *name,
bool row_major)
{
- assert(!type->without_array()->is_record());
- assert(!type->without_array()->is_interface());
+ assert(!type->is_record());
+ assert(!(type->is_array() && type->fields.array->is_record()));
+ assert(!type->is_interface());
+ assert(!(type->is_array() && type->fields.array->is_interface()));
(void) row_major;
@@ -331,7 +308,8 @@ private:
*/
const unsigned values = values_for_type(type);
if (type->contains_sampler()) {
- this->num_shader_samplers += values;
+ this->num_shader_samplers +=
+ type->is_array() ? type->array_size() : 1;
} else if (type->contains_image()) {
this->num_shader_images += values;
@@ -409,9 +387,6 @@ public:
void set_and_process(struct gl_shader_program *prog,
ir_variable *var)
{
- current_var = var;
- field_counter = 0;
-
ubo_block_index = -1;
if (var->is_in_uniform_block()) {
if (var->is_interface_instance() && var->type->is_array()) {
@@ -445,6 +420,7 @@ public:
*/
if (var->is_interface_instance()) {
ubo_byte_offset = 0;
+ ubo_row_major = false;
} else {
const struct gl_uniform_block *const block =
&prog->UniformBlocks[ubo_block_index];
@@ -454,6 +430,7 @@ public:
const struct gl_uniform_buffer_variable *const ubo_var =
&block->Uniforms[var->data.location];
+ ubo_row_major = ubo_var->RowMajor;
ubo_byte_offset = ubo_var->Offset;
}
@@ -468,6 +445,7 @@ public:
int ubo_block_index;
int ubo_byte_offset;
+ bool ubo_row_major;
gl_shader_stage shader_type;
private:
@@ -527,11 +505,14 @@ private:
}
virtual void visit_field(const glsl_type *type, const char *name,
- bool row_major, const glsl_type *record_type,
- bool last_field)
+ bool row_major, const glsl_type *record_type)
{
- assert(!type->without_array()->is_record());
- assert(!type->without_array()->is_interface());
+ assert(!type->is_record());
+ assert(!(type->is_array() && type->fields.array->is_record()));
+ assert(!type->is_interface());
+ assert(!(type->is_array() && type->fields.array->is_interface()));
+
+ (void) row_major;
unsigned id;
bool found = this->map->get(id, name);
@@ -562,22 +543,6 @@ private:
return;
}
- /* Assign explicit locations. */
- if (current_var->data.explicit_location) {
- /* Set sequential locations for struct fields. */
- if (record_type != NULL) {
- const unsigned entries = MAX2(1, this->uniforms[id].array_elements);
- this->uniforms[id].remap_location =
- current_var->data.location + field_counter;
- field_counter += entries;
- } else {
- this->uniforms[id].remap_location = current_var->data.location;
- }
- } else {
- /* Initialize to to indicate that no location is set */
- this->uniforms[id].remap_location = UNMAPPED_UNIFORM_LOC;
- }
-
this->uniforms[id].name = ralloc_strdup(this->uniforms, name);
this->uniforms[id].type = base_type;
this->uniforms[id].initialized = 0;
@@ -585,31 +550,27 @@ private:
this->uniforms[id].driver_storage = NULL;
this->uniforms[id].storage = this->values;
this->uniforms[id].atomic_buffer_index = -1;
- this->uniforms[id].hidden =
- current_var->data.how_declared == ir_var_hidden;
if (this->ubo_block_index != -1) {
this->uniforms[id].block_index = this->ubo_block_index;
const unsigned alignment = record_type
- ? record_type->std140_base_alignment(row_major)
- : type->std140_base_alignment(row_major);
+ ? record_type->std140_base_alignment(ubo_row_major)
+ : type->std140_base_alignment(ubo_row_major);
this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, alignment);
this->uniforms[id].offset = this->ubo_byte_offset;
- this->ubo_byte_offset += type->std140_size(row_major);
-
- if (last_field)
- this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, 16);
+ this->ubo_byte_offset += type->std140_size(ubo_row_major);
if (type->is_array()) {
this->uniforms[id].array_stride =
- glsl_align(type->fields.array->std140_size(row_major), 16);
+ glsl_align(type->fields.array->std140_size(ubo_row_major), 16);
} else {
this->uniforms[id].array_stride = 0;
}
- if (type->without_array()->is_matrix()) {
+ if (type->is_matrix() ||
+ (type->is_array() && type->fields.array->is_matrix())) {
this->uniforms[id].matrix_stride = 16;
- this->uniforms[id].row_major = row_major;
+ this->uniforms[id].row_major = ubo_row_major;
} else {
this->uniforms[id].matrix_stride = 0;
this->uniforms[id].row_major = false;
@@ -637,17 +598,6 @@ public:
gl_texture_index targets[MAX_SAMPLERS];
/**
- * Current variable being processed.
- */
- ir_variable *current_var;
-
- /**
- * Field counter is used to take care that uniform structures
- * with explicit locations get sequential locations.
- */
- unsigned field_counter;
-
- /**
* Mask of samplers used by the current shader stage.
*/
unsigned shader_samplers_used;
@@ -718,8 +668,8 @@ link_cross_validate_uniform_block(void *mem_ctx,
static void
link_update_uniform_buffer_variables(struct gl_shader *shader)
{
- foreach_in_list(ir_instruction, node, shader->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, shader->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || !var->is_in_uniform_block())
continue;
@@ -751,7 +701,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader)
if (end == NULL)
continue;
- if ((ptrdiff_t) l != (end - begin))
+ if (l != (end - begin))
continue;
if (strncmp(var->name, begin, l) == 0) {
@@ -773,6 +723,40 @@ link_update_uniform_buffer_variables(struct gl_shader *shader)
}
}
+void
+link_assign_uniform_block_offsets(struct gl_shader *shader)
+{
+ for (unsigned b = 0; b < shader->NumUniformBlocks; b++) {
+ struct gl_uniform_block *block = &shader->UniformBlocks[b];
+
+ unsigned offset = 0;
+ for (unsigned int i = 0; i < block->NumUniforms; i++) {
+ struct gl_uniform_buffer_variable *ubo_var = &block->Uniforms[i];
+ const struct glsl_type *type = ubo_var->Type;
+
+ unsigned alignment = type->std140_base_alignment(ubo_var->RowMajor);
+ unsigned size = type->std140_size(ubo_var->RowMajor);
+
+ offset = glsl_align(offset, alignment);
+ ubo_var->Offset = offset;
+ offset += size;
+ }
+
+ /* From the GL_ARB_uniform_buffer_object spec:
+ *
+ * "For uniform blocks laid out according to [std140] rules,
+ * the minimum buffer object size returned by the
+ * UNIFORM_BLOCK_DATA_SIZE query is derived by taking the
+ * offset of the last basic machine unit consumed by the
+ * last uniform of the uniform block (including any
+ * end-of-array or end-of-structure padding), adding one,
+ * and rounding up to the next multiple of the base
+ * alignment required for a vec4."
+ */
+ block->UniformBufferSize = glsl_align(offset, 16);
+ }
+}
+
/**
* Scan the program for image uniforms and store image unit access
* information into the gl_shader data structure.
@@ -786,8 +770,8 @@ link_set_image_access_qualifiers(struct gl_shader_program *prog)
if (sh == NULL)
continue;
- foreach_in_list(ir_instruction, node, sh->ir) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, sh->ir) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (var && var->data.mode == ir_var_uniform &&
var->type->contains_image()) {
@@ -797,8 +781,8 @@ link_set_image_access_qualifiers(struct gl_shader_program *prog)
(void) found;
const gl_uniform_storage *storage = &prog->UniformStorage[id];
const unsigned index = storage->image[i].index;
- const GLenum access = (var->data.image_read_only ? GL_READ_ONLY :
- var->data.image_write_only ? GL_WRITE_ONLY :
+ const GLenum access = (var->data.image.read_only ? GL_READ_ONLY :
+ var->data.image.write_only ? GL_WRITE_ONLY :
GL_READ_WRITE);
for (unsigned j = 0; j < MAX2(1, storage->array_elements); ++j)
@@ -808,58 +792,17 @@ link_set_image_access_qualifiers(struct gl_shader_program *prog)
}
}
-/**
- * Sort the array of uniform storage so that the non-hidden uniforms are first
- *
- * This function sorts the list "in place." This is important because some of
- * the storage accessible from \c uniforms has \c uniforms as its \c ralloc
- * context. If \c uniforms is freed, some other storage will also be freed.
- */
-static unsigned
-move_hidden_uniforms_to_end(struct gl_shader_program *prog,
- struct gl_uniform_storage *uniforms,
- unsigned num_elements)
-{
- struct gl_uniform_storage *sorted_uniforms =
- ralloc_array(prog, struct gl_uniform_storage, num_elements);
- unsigned hidden_uniforms = 0;
- unsigned j = 0;
-
- /* Add the non-hidden uniforms. */
- for (unsigned i = 0; i < num_elements; i++) {
- if (!uniforms[i].hidden)
- sorted_uniforms[j++] = uniforms[i];
- }
-
- /* Add and count the hidden uniforms. */
- for (unsigned i = 0; i < num_elements; i++) {
- if (uniforms[i].hidden) {
- sorted_uniforms[j++] = uniforms[i];
- hidden_uniforms++;
- }
- }
-
- assert(prog->UniformHash != NULL);
- prog->UniformHash->clear();
- for (unsigned i = 0; i < num_elements; i++) {
- if (sorted_uniforms[i].name != NULL)
- prog->UniformHash->put(i, sorted_uniforms[i].name);
- }
-
- memcpy(uniforms, sorted_uniforms, sizeof(uniforms[0]) * num_elements);
- ralloc_free(sorted_uniforms);
-
- return hidden_uniforms;
-}
-
void
-link_assign_uniform_locations(struct gl_shader_program *prog,
- unsigned int boolean_true)
+link_assign_uniform_locations(struct gl_shader_program *prog)
{
ralloc_free(prog->UniformStorage);
prog->UniformStorage = NULL;
prog->NumUserUniformStorage = 0;
+ ralloc_free(prog->UniformRemapTable);
+ prog->UniformRemapTable = NULL;
+ prog->NumUniformRemapTable = 0;
+
if (prog->UniformHash != NULL) {
prog->UniformHash->clear();
} else {
@@ -898,15 +841,15 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
*/
uniform_size.start_shader();
- foreach_in_list(ir_instruction, node, sh->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, sh->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->data.mode != ir_var_uniform))
continue;
/* FINISHME: Update code to process built-in uniforms!
*/
- if (is_gl_identifier(var->name)) {
+ if (strncmp("gl_", var->name, 3) == 0) {
uniform_size.num_shader_uniform_components +=
var->type->component_slots();
continue;
@@ -950,15 +893,15 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
parcel.start_shader((gl_shader_stage)i);
- foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, prog->_LinkedShaders[i]->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->data.mode != ir_var_uniform))
continue;
/* FINISHME: Update code to process built-in uniforms!
*/
- if (is_gl_identifier(var->name))
+ if (strncmp("gl_", var->name, 3) == 0)
continue;
parcel.set_and_process(prog, var);
@@ -972,32 +915,9 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
sizeof(prog->_LinkedShaders[i]->SamplerTargets));
}
- const unsigned hidden_uniforms =
- move_hidden_uniforms_to_end(prog, uniforms, num_user_uniforms);
-
- /* Reserve all the explicit locations of the active uniforms. */
- for (unsigned i = 0; i < num_user_uniforms; i++) {
- if (uniforms[i].remap_location != UNMAPPED_UNIFORM_LOC) {
- /* How many new entries for this uniform? */
- const unsigned entries = MAX2(1, uniforms[i].array_elements);
-
- /* Set remap table entries point to correct gl_uniform_storage. */
- for (unsigned j = 0; j < entries; j++) {
- unsigned element_loc = uniforms[i].remap_location + j;
- assert(prog->UniformRemapTable[element_loc] ==
- INACTIVE_UNIFORM_EXPLICIT_LOCATION);
- prog->UniformRemapTable[element_loc] = &uniforms[i];
- }
- }
- }
-
- /* Reserve locations for rest of the uniforms. */
+ /* Build the uniform remap table that is used to set/get uniform locations */
for (unsigned i = 0; i < num_user_uniforms; i++) {
- /* Explicit ones have been set already. */
- if (uniforms[i].remap_location != UNMAPPED_UNIFORM_LOC)
- continue;
-
/* how many new entries for this uniform? */
const unsigned entries = MAX2(1, uniforms[i].array_elements);
@@ -1027,11 +947,10 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
#endif
prog->NumUserUniformStorage = num_user_uniforms;
- prog->NumHiddenUniforms = hidden_uniforms;
prog->UniformStorage = uniforms;
link_set_image_access_qualifiers(prog);
- link_set_uniform_initializers(prog, boolean_true);
+ link_set_uniform_initializers(prog);
return;
}
diff --git a/dist/Mesa/src/glsl/link_varyings.cpp b/dist/Mesa/src/glsl/link_varyings.cpp
index 43da2c677..ac38a2f31 100644
--- a/dist/Mesa/src/glsl/link_varyings.cpp
+++ b/dist/Mesa/src/glsl/link_varyings.cpp
@@ -77,7 +77,8 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
* correspondence between the vertex language and the
* fragment language."
*/
- if (!output->type->is_array() || !is_gl_identifier(output->name)) {
+ if (!output->type->is_array()
+ || (strncmp("gl_", output->name, 3) != 0)) {
linker_error(prog,
"%s shader output `%s' declared as type `%s', "
"but %s shader input declared as type `%s'\n",
@@ -175,8 +176,8 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
/* Find all shader outputs in the "producer" stage.
*/
- foreach_in_list(ir_instruction, node, producer->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, producer->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->data.mode != ir_var_shader_out))
continue;
@@ -212,8 +213,8 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
* should be arrays and the type of the array element should match the type
* of the corresponding producer output.
*/
- foreach_in_list(ir_instruction, node, consumer->ir) {
- ir_variable *const input = node->as_variable();
+ foreach_list(node, consumer->ir) {
+ ir_variable *const input = ((ir_instruction *) node)->as_variable();
if ((input == NULL) || (input->data.mode != ir_var_shader_in))
continue;
@@ -291,7 +292,6 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx,
this->skip_components = 0;
this->next_buffer_separator = false;
this->matched_candidate = NULL;
- this->stream_id = 0;
if (ctx->Extensions.ARB_transform_feedback3) {
/* Parse gl_NextBuffer. */
@@ -318,11 +318,6 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx,
const char *base_name_end;
long subscript = parse_program_resource_name(input, &base_name_end);
this->var_name = ralloc_strndup(mem_ctx, input, base_name_end - input);
- if (this->var_name == NULL) {
- _mesa_error_no_memory(__func__);
- return;
- }
-
if (subscript >= 0) {
this->array_subscript = subscript;
this->is_subscripted = true;
@@ -334,7 +329,7 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx,
* class must behave specially to account for the fact that gl_ClipDistance
* is converted from a float[8] to a vec4[2].
*/
- if (ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance &&
+ if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance &&
strcmp(this->var_name, "gl_ClipDistance") == 0) {
this->is_clip_distance_mesa = true;
}
@@ -361,8 +356,8 @@ tfeedback_decl::is_same(const tfeedback_decl &x, const tfeedback_decl &y)
/**
- * Assign a location and stream ID for this tfeedback_decl object based on the
- * transform feedback candidate found by find_candidate.
+ * Assign a location for this tfeedback_decl object based on the transform
+ * feedback candidate found by find_candidate.
*
* If an error occurs, the error is reported through linker_error() and false
* is returned.
@@ -443,11 +438,6 @@ tfeedback_decl::assign_location(struct gl_context *ctx,
return false;
}
- /* Only transform feedback varyings can be assigned to non-zero streams,
- * so assign the stream id here.
- */
- this->stream_id = this->matched_candidate->toplevel_var->data.stream;
-
return true;
}
@@ -506,7 +496,6 @@ tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog,
info->Outputs[info->NumOutputs].ComponentOffset = location_frac;
info->Outputs[info->NumOutputs].OutputRegister = location;
info->Outputs[info->NumOutputs].NumComponents = output_size;
- info->Outputs[info->NumOutputs].StreamId = stream_id;
info->Outputs[info->NumOutputs].OutputBuffer = buffer;
info->Outputs[info->NumOutputs].DstOffset = info->BufferStride[buffer];
++info->NumOutputs;
@@ -640,27 +629,10 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog,
}
else {
/* GL_INVERLEAVED_ATTRIBS */
- int buffer_stream_id = -1;
for (unsigned i = 0; i < num_tfeedback_decls; ++i) {
if (tfeedback_decls[i].is_next_buffer_separator()) {
num_buffers++;
- buffer_stream_id = -1;
continue;
- } else if (buffer_stream_id == -1) {
- /* First varying writing to this buffer: remember its stream */
- buffer_stream_id = (int) tfeedback_decls[i].get_stream_id();
- } else if (buffer_stream_id !=
- (int) tfeedback_decls[i].get_stream_id()) {
- /* Varying writes to the same buffer from a different stream */
- linker_error(prog,
- "Transform feedback can't capture varyings belonging "
- "to different vertex streams in a single buffer. "
- "Varying %s writes to buffer from stream %u, other "
- "varyings in the same buffer write from stream %u.",
- tfeedback_decls[i].name(),
- tfeedback_decls[i].get_stream_id(),
- buffer_stream_id);
- return false;
}
if (!tfeedback_decls[i].store(ctx, prog,
@@ -835,11 +807,9 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
* regardless of where they appear. We can trivially satisfy that
* requirement by changing the interpolation type to flat here.
*/
- if (producer_var) {
- producer_var->data.centroid = false;
- producer_var->data.sample = false;
- producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
- }
+ producer_var->data.centroid = false;
+ producer_var->data.sample = false;
+ producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
if (consumer_var) {
consumer_var->data.centroid = false;
@@ -1022,7 +992,7 @@ varying_matches::match_comparator(const void *x_generic, const void *y_generic)
* varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord.
*/
static bool
-var_counts_against_varying_limit(gl_shader_stage stage, const ir_variable *var)
+is_varying_var(gl_shader_stage stage, const ir_variable *var)
{
/* Only fragment shaders will take a varying variable as an input */
if (stage == MESA_SHADER_FRAGMENT &&
@@ -1075,8 +1045,10 @@ private:
virtual void visit_field(const glsl_type *type, const char *name,
bool row_major)
{
- assert(!type->without_array()->is_record());
- assert(!type->without_array()->is_interface());
+ assert(!type->is_record());
+ assert(!(type->is_array() && type->fields.array->is_record()));
+ assert(!type->is_interface());
+ assert(!(type->is_array() && type->fields.array->is_interface()));
(void) row_major;
@@ -1126,8 +1098,8 @@ populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
0,
sizeof(consumer_inputs_with_locations[0]) * VARYING_SLOT_MAX);
- foreach_in_list(ir_instruction, node, ir) {
- ir_variable *const input_var = node->as_variable();
+ foreach_list(node, ir) {
+ ir_variable *const input_var = ((ir_instruction *) node)->as_variable();
if ((input_var != NULL) && (input_var->data.mode == ir_var_shader_in)) {
if (input_var->type->is_interface())
@@ -1232,8 +1204,8 @@ canonicalize_shader_io(exec_list *ir, enum ir_variable_mode io_mode)
ir_variable *var_table[MAX_PROGRAM_OUTPUTS * 4];
unsigned num_variables = 0;
- foreach_in_list(ir_instruction, node, ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var == NULL || var->data.mode != io_mode)
continue;
@@ -1344,18 +1316,14 @@ assign_varying_locations(struct gl_context *ctx,
}
if (producer) {
- foreach_in_list(ir_instruction, node, producer->ir) {
- ir_variable *const output_var = node->as_variable();
+ foreach_list(node, producer->ir) {
+ ir_variable *const output_var =
+ ((ir_instruction *) node)->as_variable();
if ((output_var == NULL) ||
(output_var->data.mode != ir_var_shader_out))
continue;
- /* Only geometry shaders can use non-zero streams */
- assert(output_var->data.stream == 0 ||
- (output_var->data.stream < MAX_VERTEX_STREAMS &&
- producer->Stage == MESA_SHADER_GEOMETRY));
-
tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates);
g.process(output_var);
@@ -1371,14 +1339,6 @@ assign_varying_locations(struct gl_context *ctx,
if (input_var || (prog->SeparateShader && consumer == NULL)) {
matches.record(output_var, input_var);
}
-
- /* Only stream 0 outputs can be consumed in the next stage */
- if (input_var && output_var->data.stream != 0) {
- linker_error(prog, "output %s is assigned to stream=%d but "
- "is linked to an input, which requires stream=0",
- output_var->name, output_var->data.stream);
- return false;
- }
}
} else {
/* If there's no producer stage, then this must be a separable program.
@@ -1387,8 +1347,9 @@ assign_varying_locations(struct gl_context *ctx,
* geometry) shader program. This means that locations must be assigned
* for all the inputs.
*/
- foreach_in_list(ir_instruction, node, consumer->ir) {
- ir_variable *const input_var = node->as_variable();
+ foreach_list(node, consumer->ir) {
+ ir_variable *const input_var =
+ ((ir_instruction *) node)->as_variable();
if ((input_var == NULL) ||
(input_var->data.mode != ir_var_shader_in))
@@ -1453,27 +1414,12 @@ assign_varying_locations(struct gl_context *ctx,
}
if (consumer && producer) {
- foreach_in_list(ir_instruction, node, consumer->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, consumer->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var && var->data.mode == ir_var_shader_in &&
var->data.is_unmatched_generic_inout) {
- if (prog->IsES) {
- /*
- * On Page 91 (Page 97 of the PDF) of the GLSL ES 1.0 spec:
- *
- * If the vertex shader declares but doesn't write to a
- * varying and the fragment shader declares and reads it,
- * is this an error?
- *
- * RESOLUTION: No.
- */
- linker_warning(prog, "%s shader varying %s not written "
- "by %s shader\n.",
- _mesa_shader_stage_to_string(consumer->Stage),
- var->name,
- _mesa_shader_stage_to_string(producer->Stage));
- } else if (prog->Version <= 120) {
+ if (prog->Version <= 120) {
/* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec:
*
* Only those varying variables used (i.e. read) in
@@ -1486,6 +1432,7 @@ assign_varying_locations(struct gl_context *ctx,
* write the variable for the FS to read it. See
* "glsl1-varying read but not written" in piglit.
*/
+
linker_error(prog, "%s shader varying %s not written "
"by %s shader\n.",
_mesa_shader_stage_to_string(consumer->Stage),
@@ -1511,11 +1458,11 @@ check_against_output_limit(struct gl_context *ctx,
{
unsigned output_vectors = 0;
- foreach_in_list(ir_instruction, node, producer->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, producer->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var && var->data.mode == ir_var_shader_out &&
- var_counts_against_varying_limit(producer->Stage, var)) {
+ is_varying_var(producer->Stage, var)) {
output_vectors += var->type->count_attribute_slots();
}
}
@@ -1550,11 +1497,11 @@ check_against_input_limit(struct gl_context *ctx,
{
unsigned input_vectors = 0;
- foreach_in_list(ir_instruction, node, consumer->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, consumer->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var && var->data.mode == ir_var_shader_in &&
- var_counts_against_varying_limit(consumer->Stage, var)) {
+ is_varying_var(consumer->Stage, var)) {
input_vectors += var->type->count_attribute_slots();
}
}
diff --git a/dist/Mesa/src/glsl/link_varyings.h b/dist/Mesa/src/glsl/link_varyings.h
index afc16a8ba..6fa268176 100644
--- a/dist/Mesa/src/glsl/link_varyings.h
+++ b/dist/Mesa/src/glsl/link_varyings.h
@@ -112,16 +112,6 @@ public:
return !this->next_buffer_separator && !this->skip_components;
}
- const char *name() const
- {
- return this->orig_name;
- }
-
- unsigned get_stream_id() const
- {
- return this->stream_id;
- }
-
/**
* The total number of varying components taken up by this variable. Only
* valid if assign_location() has been called.
@@ -220,13 +210,6 @@ private:
* data structure that was found. Otherwise NULL.
*/
const tfeedback_candidate *matched_candidate;
-
- /**
- * StreamId assigned to this varying (defaults to 0). Can only be set to
- * values other than 0 in geometry shaders that use the stream layout
- * modifier. Accepted values must be in the range [0, MAX_VERTEX_STREAMS-1].
- */
- unsigned stream_id;
};
diff --git a/dist/Mesa/src/glsl/list.h b/dist/Mesa/src/glsl/list.h
index 995c666ea..694b686b0 100644
--- a/dist/Mesa/src/glsl/list.h
+++ b/dist/Mesa/src/glsl/list.h
@@ -69,7 +69,7 @@
#endif
#include <assert.h>
-#include "util/ralloc.h"
+#include "ralloc.h"
struct exec_node {
struct exec_node *next;
@@ -83,29 +83,67 @@ struct exec_node {
/* empty */
}
- const exec_node *get_next() const;
- exec_node *get_next();
+ const exec_node *get_next() const
+ {
+ return next;
+ }
- const exec_node *get_prev() const;
- exec_node *get_prev();
+ exec_node *get_next()
+ {
+ return next;
+ }
- void remove();
+ const exec_node *get_prev() const
+ {
+ return prev;
+ }
+
+ exec_node *get_prev()
+ {
+ return prev;
+ }
+
+ void remove()
+ {
+ next->prev = prev;
+ prev->next = next;
+ next = NULL;
+ prev = NULL;
+ }
/**
* Link a node with itself
*
* This creates a sort of degenerate list that is occasionally useful.
*/
- void self_link();
+ void self_link()
+ {
+ next = this;
+ prev = this;
+ }
/**
* Insert a node in the list after the current node
*/
- void insert_after(exec_node *after);
+ void insert_after(exec_node *after)
+ {
+ after->next = this->next;
+ after->prev = this;
+
+ this->next->prev = after;
+ this->next = after;
+ }
/**
* Insert a node in the list before the current node
*/
- void insert_before(exec_node *before);
+ void insert_before(exec_node *before)
+ {
+ before->next = this;
+ before->prev = this->prev;
+
+ this->prev->next = before;
+ this->prev = before;
+ }
/**
* Insert another list in the list before the current node
@@ -115,165 +153,33 @@ struct exec_node {
/**
* Replace the current node with the given node.
*/
- void replace_with(exec_node *replacement);
+ void replace_with(exec_node *replacement)
+ {
+ replacement->prev = this->prev;
+ replacement->next = this->next;
+
+ this->prev->next = replacement;
+ this->next->prev = replacement;
+ }
/**
* Is this the sentinel at the tail of the list?
*/
- bool is_tail_sentinel() const;
+ bool is_tail_sentinel() const
+ {
+ return this->next == NULL;
+ }
/**
* Is this the sentinel at the head of the list?
*/
- bool is_head_sentinel() const;
+ bool is_head_sentinel() const
+ {
+ return this->prev == NULL;
+ }
#endif
};
-static inline void
-exec_node_init(struct exec_node *n)
-{
- n->next = NULL;
- n->prev = NULL;
-}
-
-static inline const struct exec_node *
-exec_node_get_next_const(const struct exec_node *n)
-{
- return n->next;
-}
-
-static inline struct exec_node *
-exec_node_get_next(struct exec_node *n)
-{
- return n->next;
-}
-
-static inline const struct exec_node *
-exec_node_get_prev_const(const struct exec_node *n)
-{
- return n->prev;
-}
-
-static inline struct exec_node *
-exec_node_get_prev(struct exec_node *n)
-{
- return n->prev;
-}
-
-static inline void
-exec_node_remove(struct exec_node *n)
-{
- n->next->prev = n->prev;
- n->prev->next = n->next;
- n->next = NULL;
- n->prev = NULL;
-}
-
-static inline void
-exec_node_self_link(struct exec_node *n)
-{
- n->next = n;
- n->prev = n;
-}
-
-static inline void
-exec_node_insert_after(struct exec_node *n, struct exec_node *after)
-{
- after->next = n->next;
- after->prev = n;
-
- n->next->prev = after;
- n->next = after;
-}
-
-static inline void
-exec_node_insert_node_before(struct exec_node *n, struct exec_node *before)
-{
- before->next = n;
- before->prev = n->prev;
-
- n->prev->next = before;
- n->prev = before;
-}
-
-static inline void
-exec_node_replace_with(struct exec_node *n, struct exec_node *replacement)
-{
- replacement->prev = n->prev;
- replacement->next = n->next;
-
- n->prev->next = replacement;
- n->next->prev = replacement;
-}
-
-static inline bool
-exec_node_is_tail_sentinel(const struct exec_node *n)
-{
- return n->next == NULL;
-}
-
-static inline bool
-exec_node_is_head_sentinel(const struct exec_node *n)
-{
- return n->prev == NULL;
-}
-
-#ifdef __cplusplus
-inline const exec_node *exec_node::get_next() const
-{
- return exec_node_get_next_const(this);
-}
-
-inline exec_node *exec_node::get_next()
-{
- return exec_node_get_next(this);
-}
-
-inline const exec_node *exec_node::get_prev() const
-{
- return exec_node_get_prev_const(this);
-}
-
-inline exec_node *exec_node::get_prev()
-{
- return exec_node_get_prev(this);
-}
-
-inline void exec_node::remove()
-{
- exec_node_remove(this);
-}
-
-inline void exec_node::self_link()
-{
- exec_node_self_link(this);
-}
-
-inline void exec_node::insert_after(exec_node *after)
-{
- exec_node_insert_after(this, after);
-}
-
-inline void exec_node::insert_before(exec_node *before)
-{
- exec_node_insert_node_before(this, before);
-}
-
-inline void exec_node::replace_with(exec_node *replacement)
-{
- exec_node_replace_with(this, replacement);
-}
-
-inline bool exec_node::is_tail_sentinel() const
-{
- return exec_node_is_tail_sentinel(this);
-}
-
-inline bool exec_node::is_head_sentinel() const
-{
- return exec_node_is_head_sentinel(this);
-}
-#endif
#ifdef __cplusplus
/* This macro will not work correctly if `t' uses virtual inheritance. If you
@@ -315,21 +221,75 @@ struct exec_list {
make_empty();
}
- void make_empty();
+ void make_empty()
+ {
+ head = (exec_node *) & tail;
+ tail = NULL;
+ tail_pred = (exec_node *) & head;
+ }
+
+ bool is_empty() const
+ {
+ /* There are three ways to test whether a list is empty or not.
+ *
+ * - Check to see if the \c head points to the \c tail.
+ * - Check to see if the \c tail_pred points to the \c head.
+ * - Check to see if the \c head is the sentinel node by test whether its
+ * \c next pointer is \c NULL.
+ *
+ * The first two methods tend to generate better code on modern systems
+ * because they save a pointer dereference.
+ */
+ return head == (exec_node *) &tail;
+ }
+
+ const exec_node *get_head() const
+ {
+ return !is_empty() ? head : NULL;
+ }
+
+ exec_node *get_head()
+ {
+ return !is_empty() ? head : NULL;
+ }
+
+ const exec_node *get_tail() const
+ {
+ return !is_empty() ? tail_pred : NULL;
+ }
+
+ exec_node *get_tail()
+ {
+ return !is_empty() ? tail_pred : NULL;
+ }
+
+ void push_head(exec_node *n)
+ {
+ n->next = head;
+ n->prev = (exec_node *) &head;
- bool is_empty() const;
+ n->next->prev = n;
+ head = n;
+ }
- const exec_node *get_head() const;
- exec_node *get_head();
+ void push_tail(exec_node *n)
+ {
+ n->next = (exec_node *) &tail;
+ n->prev = tail_pred;
- const exec_node *get_tail() const;
- exec_node *get_tail();
+ n->prev->next = n;
+ tail_pred = n;
+ }
- unsigned length() const;
+ void push_degenerate_list_at_head(exec_node *n)
+ {
+ assert(n->prev->next == n);
- void push_head(exec_node *n);
- void push_tail(exec_node *n);
- void push_degenerate_list_at_head(exec_node *n);
+ n->prev->next = head;
+ head->prev = n->prev;
+ n->prev = (exec_node *) &head;
+ head = n;
+ }
/**
* Remove the first node from a list and return it
@@ -339,339 +299,121 @@ struct exec_list {
*
* \sa exec_list::get_head
*/
- exec_node *pop_head();
+ exec_node *pop_head()
+ {
+ exec_node *const n = this->get_head();
+ if (n != NULL)
+ n->remove();
- /**
- * Move all of the nodes from this list to the target list
- */
- void move_nodes_to(exec_list *target);
+ return n;
+ }
/**
- * Append all nodes from the source list to the end of the target list
+ * Move all of the nodes from this list to the target list
*/
- void append_list(exec_list *source);
+ void move_nodes_to(exec_list *target)
+ {
+ if (is_empty()) {
+ target->make_empty();
+ } else {
+ target->head = head;
+ target->tail = NULL;
+ target->tail_pred = tail_pred;
+
+ target->head->prev = (exec_node *) &target->head;
+ target->tail_pred->next = (exec_node *) &target->tail;
+
+ make_empty();
+ }
+ }
/**
- * Prepend all nodes from the source list to the beginning of the target
- * list
+ * Append all nodes from the source list to the target list
*/
- void prepend_list(exec_list *source);
+ void
+ append_list(exec_list *source)
+ {
+ if (source->is_empty())
+ return;
+
+ /* Link the first node of the source with the last node of the target list.
+ */
+ this->tail_pred->next = source->head;
+ source->head->prev = this->tail_pred;
+
+ /* Make the tail of the source list be the tail of the target list.
+ */
+ this->tail_pred = source->tail_pred;
+ this->tail_pred->next = (exec_node *) &this->tail;
+
+ /* Make the source list empty for good measure.
+ */
+ source->make_empty();
+ }
#endif
};
-static inline void
-exec_list_make_empty(struct exec_list *list)
-{
- list->head = (struct exec_node *) & list->tail;
- list->tail = NULL;
- list->tail_pred = (struct exec_node *) & list->head;
-}
-
-static inline bool
-exec_list_is_empty(const struct exec_list *list)
-{
- /* There are three ways to test whether a list is empty or not.
- *
- * - Check to see if the \c head points to the \c tail.
- * - Check to see if the \c tail_pred points to the \c head.
- * - Check to see if the \c head is the sentinel node by test whether its
- * \c next pointer is \c NULL.
- *
- * The first two methods tend to generate better code on modern systems
- * because they save a pointer dereference.
- */
- return list->head == (struct exec_node *) &list->tail;
-}
-
-static inline const struct exec_node *
-exec_list_get_head_const(const struct exec_list *list)
-{
- return !exec_list_is_empty(list) ? list->head : NULL;
-}
-
-static inline struct exec_node *
-exec_list_get_head(struct exec_list *list)
-{
- return !exec_list_is_empty(list) ? list->head : NULL;
-}
-
-static inline const struct exec_node *
-exec_list_get_tail_const(const struct exec_list *list)
-{
- return !exec_list_is_empty(list) ? list->tail_pred : NULL;
-}
-
-static inline struct exec_node *
-exec_list_get_tail(struct exec_list *list)
-{
- return !exec_list_is_empty(list) ? list->tail_pred : NULL;
-}
-
-static inline unsigned
-exec_list_length(const struct exec_list *list)
-{
- unsigned size = 0;
- struct exec_node *node;
-
- for (node = list->head; node->next != NULL; node = node->next) {
- size++;
- }
-
- return size;
-}
-
-static inline void
-exec_list_push_head(struct exec_list *list, struct exec_node *n)
-{
- n->next = list->head;
- n->prev = (struct exec_node *) &list->head;
-
- n->next->prev = n;
- list->head = n;
-}
-
-static inline void
-exec_list_push_tail(struct exec_list *list, struct exec_node *n)
-{
- n->next = (struct exec_node *) &list->tail;
- n->prev = list->tail_pred;
-
- n->prev->next = n;
- list->tail_pred = n;
-}
-
-static inline void
-exec_list_push_degenerate_list_at_head(struct exec_list *list, struct exec_node *n)
-{
- assert(n->prev->next == n);
-
- n->prev->next = list->head;
- list->head->prev = n->prev;
- n->prev = (struct exec_node *) &list->head;
- list->head = n;
-}
-
-static inline struct exec_node *
-exec_list_pop_head(struct exec_list *list)
-{
- struct exec_node *const n = exec_list_get_head(list);
- if (n != NULL)
- exec_node_remove(n);
-
- return n;
-}
-
-static inline void
-exec_list_move_nodes_to(struct exec_list *list, struct exec_list *target)
-{
- if (exec_list_is_empty(list)) {
- exec_list_make_empty(target);
- } else {
- target->head = list->head;
- target->tail = NULL;
- target->tail_pred = list->tail_pred;
-
- target->head->prev = (struct exec_node *) &target->head;
- target->tail_pred->next = (struct exec_node *) &target->tail;
-
- exec_list_make_empty(list);
- }
-}
-
-static inline void
-exec_list_append(struct exec_list *list, struct exec_list *source)
-{
- if (exec_list_is_empty(source))
- return;
-
- /* Link the first node of the source with the last node of the target list.
- */
- list->tail_pred->next = source->head;
- source->head->prev = list->tail_pred;
-
- /* Make the tail of the source list be the tail of the target list.
- */
- list->tail_pred = source->tail_pred;
- list->tail_pred->next = (struct exec_node *) &list->tail;
-
- /* Make the source list empty for good measure.
- */
- exec_list_make_empty(source);
-}
-
-static inline void
-exec_list_prepend(struct exec_list *list, struct exec_list *source)
-{
- exec_list_append(source, list);
- exec_list_move_nodes_to(source, list);
-}
-
-static inline void
-exec_node_insert_list_before(struct exec_node *n, struct exec_list *before)
-{
- if (exec_list_is_empty(before))
- return;
-
- before->tail_pred->next = n;
- before->head->prev = n->prev;
-
- n->prev->next = before->head;
- n->prev = before->tail_pred;
-
- exec_list_make_empty(before);
-}
-
-static inline void
-exec_list_validate(const struct exec_list *list)
-{
- const struct exec_node *node;
-
- assert(list->head->prev == (const struct exec_node *) &list->head);
- assert(list->tail == NULL);
- assert(list->tail_pred->next == (const struct exec_node *) &list->tail);
-
- /* We could try to use one of the interators below for this but they all
- * either require C++ or assume the exec_node is embedded in a structure
- * which is not the case for this function.
- */
- for (node = exec_list_get_head_const(list);
- !exec_node_is_tail_sentinel(node);
- node = exec_node_get_next_const(node)) {
- assert(node->next->prev == node);
- assert(node->prev->next == node);
- }
-}
#ifdef __cplusplus
-inline void exec_list::make_empty()
-{
- exec_list_make_empty(this);
-}
-
-inline bool exec_list::is_empty() const
-{
- return exec_list_is_empty(this);
-}
-
-inline const exec_node *exec_list::get_head() const
-{
- return exec_list_get_head_const(this);
-}
-
-inline exec_node *exec_list::get_head()
-{
- return exec_list_get_head(this);
-}
-
-inline const exec_node *exec_list::get_tail() const
-{
- return exec_list_get_tail_const(this);
-}
-
-inline exec_node *exec_list::get_tail()
-{
- return exec_list_get_tail(this);
-}
-
-inline unsigned exec_list::length() const
-{
- return exec_list_length(this);
-}
-
-inline void exec_list::push_head(exec_node *n)
-{
- exec_list_push_head(this, n);
-}
-
-inline void exec_list::push_tail(exec_node *n)
-{
- exec_list_push_tail(this, n);
-}
-
-inline void exec_list::push_degenerate_list_at_head(exec_node *n)
-{
- exec_list_push_degenerate_list_at_head(this, n);
-}
-
-inline exec_node *exec_list::pop_head()
-{
- return exec_list_pop_head(this);
-}
-
-inline void exec_list::move_nodes_to(exec_list *target)
+inline void exec_node::insert_before(exec_list *before)
{
- exec_list_move_nodes_to(this, target);
-}
+ if (before->is_empty())
+ return;
-inline void exec_list::append_list(exec_list *source)
-{
- exec_list_append(this, source);
-}
+ before->tail_pred->next = this;
+ before->head->prev = this->prev;
-inline void exec_list::prepend_list(exec_list *source)
-{
- exec_list_prepend(this, source);
-}
+ this->prev->next = before->head;
+ this->prev = before->tail_pred;
-inline void exec_node::insert_before(exec_list *before)
-{
- exec_node_insert_list_before(this, before);
+ before->make_empty();
}
#endif
-#define foreach_in_list(__type, __inst, __list) \
- for (__type *(__inst) = (__type *)(__list)->head; \
- !(__inst)->is_tail_sentinel(); \
- (__inst) = (__type *)(__inst)->next)
-
-#define foreach_in_list_reverse(__type, __inst, __list) \
- for (__type *(__inst) = (__type *)(__list)->tail_pred; \
- !(__inst)->is_head_sentinel(); \
- (__inst) = (__type *)(__inst)->prev)
-
/**
* This version is safe even if the current node is removed.
*/
-#define foreach_in_list_safe(__type, __node, __list) \
- for (__type *__node = (__type *)(__list)->head, \
- *__next = (__type *)__node->next; \
- __next != NULL; \
- __node = __next, __next = (__type *)__next->next)
-
-#define foreach_in_list_use_after(__type, __inst, __list) \
- __type *(__inst); \
- for ((__inst) = (__type *)(__list)->head; \
- !(__inst)->is_tail_sentinel(); \
- (__inst) = (__type *)(__inst)->next)
+#define foreach_list_safe(__node, __list) \
+ for (exec_node * __node = (__list)->head, * __next = __node->next \
+ ; __next != NULL \
+ ; __node = __next, __next = __next->next)
+
+#define foreach_list(__node, __list) \
+ for (exec_node * __node = (__list)->head \
+ ; (__node)->next != NULL \
+ ; (__node) = (__node)->next)
+
/**
* Iterate through two lists at once. Stops at the end of the shorter list.
*
* This is safe against either current node being removed or replaced.
*/
#define foreach_two_lists(__node1, __list1, __node2, __list2) \
- for (struct exec_node * __node1 = (__list1)->head, \
- * __node2 = (__list2)->head, \
- * __next1 = __node1->next, \
- * __next2 = __node2->next \
+ for (exec_node * __node1 = (__list1)->head, \
+ * __node2 = (__list2)->head, \
+ * __next1 = __node1->next, \
+ * __next2 = __node2->next \
; __next1 != NULL && __next2 != NULL \
; __node1 = __next1, \
__node2 = __next2, \
__next1 = __next1->next, \
__next2 = __next2->next)
+#define foreach_list_const(__node, __list) \
+ for (const exec_node * __node = (__list)->head \
+ ; (__node)->next != NULL \
+ ; (__node) = (__node)->next)
+
#define foreach_list_typed(__type, __node, __field, __list) \
for (__type * __node = \
exec_node_data(__type, (__list)->head, __field); \
(__node)->__field.next != NULL; \
(__node) = exec_node_data(__type, (__node)->__field.next, __field))
-#define foreach_list_typed_safe(__type, __node, __field, __list) \
- for (__type * __node = \
- exec_node_data(__type, (__list)->head, __field), \
- * __next = \
- exec_node_data(__type, (__node)->__field.next, __field); \
- __next != NULL; \
- __node = __next, __next = \
- exec_node_data(__type, (__next)->__field.next, __field))
+#define foreach_list_typed_const(__type, __node, __field, __list) \
+ for (const __type * __node = \
+ exec_node_data(__type, (__list)->head, __field); \
+ (__node)->__field.next != NULL; \
+ (__node) = exec_node_data(__type, (__node)->__field.next, __field))
#endif /* LIST_CONTAINER_H */
diff --git a/dist/Mesa/src/glsl/loop_controls.cpp b/dist/Mesa/src/glsl/loop_controls.cpp
index 1c1d34fef..3db06ad18 100644
--- a/dist/Mesa/src/glsl/loop_controls.cpp
+++ b/dist/Mesa/src/glsl/loop_controls.cpp
@@ -123,20 +123,9 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
bool valid_loop = false;
for (unsigned i = 0; i < Elements(bias); i++) {
- /* Increment may be of type int, uint or float. */
- switch (increment->type->base_type) {
- case GLSL_TYPE_INT:
- iter = new(mem_ctx) ir_constant(iter_value + bias[i]);
- break;
- case GLSL_TYPE_UINT:
- iter = new(mem_ctx) ir_constant(unsigned(iter_value + bias[i]));
- break;
- case GLSL_TYPE_FLOAT:
- iter = new(mem_ctx) ir_constant(float(iter_value + bias[i]));
- break;
- default:
- unreachable(!"Unsupported type for loop iterator.");
- }
+ iter = (increment->type->is_integer())
+ ? new(mem_ctx) ir_constant(iter_value + bias[i])
+ : new(mem_ctx) ir_constant(float(iter_value + bias[i]));
ir_expression *const mul =
new(mem_ctx) ir_expression(ir_binop_mul, increment->type, iter,
@@ -213,7 +202,9 @@ loop_control_visitor::visit_leave(ir_loop *ir)
* bound, then that terminates the loop, so we don't even need the limiting
* terminator.
*/
- foreach_in_list(loop_terminator, t, &ls->terminators) {
+ foreach_list(node, &ls->terminators) {
+ loop_terminator *t = (loop_terminator *) node;
+
if (t->iterations < 0)
continue;
diff --git a/dist/Mesa/src/glsl/loop_unroll.cpp b/dist/Mesa/src/glsl/loop_unroll.cpp
index 635e1dd99..da532804a 100644
--- a/dist/Mesa/src/glsl/loop_unroll.cpp
+++ b/dist/Mesa/src/glsl/loop_unroll.cpp
@@ -64,7 +64,6 @@ class loop_unroll_count : public ir_hierarchical_visitor {
public:
int nodes;
bool unsupported_variable_indexing;
- bool array_indexed_by_induction_var_with_exact_iterations;
/* If there are nested loops, the node count will be inaccurate. */
bool nested_loop;
@@ -75,7 +74,6 @@ public:
nodes = 0;
nested_loop = false;
unsupported_variable_indexing = false;
- array_indexed_by_induction_var_with_exact_iterations = false;
run(list);
}
@@ -114,14 +112,6 @@ public:
ir_variable *array = ir->array->variable_referenced();
loop_variable *lv = ls->get(ir->array_index->variable_referenced());
if (array && lv && lv->is_induction_var()) {
- /* If an array is indexed by a loop induction variable, and the
- * array size is exactly the number of loop iterations, this is
- * probably a simple for-loop trying to access each element in
- * turn; the application may expect it to be unrolled.
- */
- if (int(array->type->length) == ls->limiting_terminator->iterations)
- array_indexed_by_induction_var_with_exact_iterations = true;
-
switch (array->data.mode) {
case ir_var_auto:
case ir_var_temporary:
@@ -324,8 +314,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
bool loop_too_large =
count.nested_loop || count.nodes * iterations > max_iterations * 5;
- if (loop_too_large && !count.unsupported_variable_indexing &&
- !count.array_indexed_by_induction_var_with_exact_iterations)
+ if (loop_too_large && !count.unsupported_variable_indexing)
return visit_continue;
/* Note: the limiting terminator contributes 1 to ls->num_loop_jumps.
@@ -358,8 +347,10 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
return visit_continue;
}
- /* recognize loops in the form produced by ir_lower_jumps */
- foreach_in_list(ir_instruction, cur_ir, &ir->body_instructions) {
+ foreach_list(node, &ir->body_instructions) {
+ /* recognize loops in the form produced by ir_lower_jumps */
+ ir_instruction *cur_ir = (ir_instruction *) node;
+
/* Skip the limiting terminator, since it will go away when we
* unroll.
*/
diff --git a/dist/Mesa/src/glsl/lower_discard.cpp b/dist/Mesa/src/glsl/lower_discard.cpp
index b44d2a6d2..f2757d120 100644
--- a/dist/Mesa/src/glsl/lower_discard.cpp
+++ b/dist/Mesa/src/glsl/lower_discard.cpp
@@ -138,8 +138,8 @@ lower_discard(exec_list *instructions)
static ir_discard *
find_discard(exec_list &instructions)
{
- foreach_in_list(ir_instruction, node, &instructions) {
- ir_discard *ir = node->as_discard();
+ foreach_list(n, &instructions) {
+ ir_discard *ir = ((ir_instruction *) n)->as_discard();
if (ir != NULL)
return ir;
}
diff --git a/dist/Mesa/src/glsl/lower_named_interface_blocks.cpp b/dist/Mesa/src/glsl/lower_named_interface_blocks.cpp
index 7304c5139..04e0d36e6 100644
--- a/dist/Mesa/src/glsl/lower_named_interface_blocks.cpp
+++ b/dist/Mesa/src/glsl/lower_named_interface_blocks.cpp
@@ -99,8 +99,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions)
* The interface block variables are stored in the interface_namespace
* hash table so they can be used in the second pass.
*/
- foreach_in_list_safe(ir_instruction, node, instructions) {
- ir_variable *var = node->as_variable();
+ foreach_list_safe(node, instructions) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (!var || !var->is_interface_instance())
continue;
diff --git a/dist/Mesa/src/glsl/lower_offset_array.cpp b/dist/Mesa/src/glsl/lower_offset_array.cpp
index c30f80143..0c235eda3 100644
--- a/dist/Mesa/src/glsl/lower_offset_array.cpp
+++ b/dist/Mesa/src/glsl/lower_offset_array.cpp
@@ -22,7 +22,7 @@
*/
/**
- * \file lower_offset_array.cpp
+ * \file brw_lower_offset_array.cpp
*
* IR lower pass to decompose ir_texture ir_tg4 with an array of offsets
* into four ir_tg4s with a single ivec2 offset, select the .w component of each,
@@ -39,9 +39,9 @@
using namespace ir_builder;
-class lower_offset_array_visitor : public ir_rvalue_visitor {
+class brw_lower_offset_array_visitor : public ir_rvalue_visitor {
public:
- lower_offset_array_visitor()
+ brw_lower_offset_array_visitor()
{
progress = false;
}
@@ -52,7 +52,7 @@ public:
};
void
-lower_offset_array_visitor::handle_rvalue(ir_rvalue **rv)
+brw_lower_offset_array_visitor::handle_rvalue(ir_rvalue **rv)
{
if (*rv == NULL || (*rv)->ir_type != ir_type_texture)
return;
@@ -63,8 +63,7 @@ lower_offset_array_visitor::handle_rvalue(ir_rvalue **rv)
void *mem_ctx = ralloc_parent(ir);
- ir_variable *var =
- new (mem_ctx) ir_variable(ir->type, "result", ir_var_temporary);
+ ir_variable *var = new (mem_ctx) ir_variable(ir->type, "result", ir_var_auto);
base_ir->insert_before(var);
for (int i = 0; i < 4; i++) {
@@ -83,7 +82,7 @@ lower_offset_array_visitor::handle_rvalue(ir_rvalue **rv)
bool
lower_offset_arrays(exec_list *instructions)
{
- lower_offset_array_visitor v;
+ brw_lower_offset_array_visitor v;
visit_list_elements(&v, instructions);
diff --git a/dist/Mesa/src/glsl/lower_output_reads.cpp b/dist/Mesa/src/glsl/lower_output_reads.cpp
index 1ee815d5e..afe17766b 100644
--- a/dist/Mesa/src/glsl/lower_output_reads.cpp
+++ b/dist/Mesa/src/glsl/lower_output_reads.cpp
@@ -52,7 +52,7 @@ public:
output_read_remover();
~output_read_remover();
virtual ir_visitor_status visit(class ir_dereference_variable *);
- virtual ir_visitor_status visit_leave(class ir_emit_vertex *);
+ virtual ir_visitor_status visit(class ir_emit_vertex *);
virtual ir_visitor_status visit_leave(class ir_return *);
virtual ir_visitor_status visit_leave(class ir_function_signature *);
};
@@ -148,7 +148,7 @@ output_read_remover::visit_leave(ir_return *ir)
}
ir_visitor_status
-output_read_remover::visit_leave(ir_emit_vertex *ir)
+output_read_remover::visit(ir_emit_vertex *ir)
{
hash_table_call_foreach(replacements, emit_return_copy, ir);
hash_table_clear(replacements);
diff --git a/dist/Mesa/src/glsl/lower_packed_varyings.cpp b/dist/Mesa/src/glsl/lower_packed_varyings.cpp
index 5e844c792..e8654748f 100644
--- a/dist/Mesa/src/glsl/lower_packed_varyings.cpp
+++ b/dist/Mesa/src/glsl/lower_packed_varyings.cpp
@@ -242,8 +242,8 @@ lower_packed_varyings_visitor::lower_packed_varyings_visitor(
void
lower_packed_varyings_visitor::run(exec_list *instructions)
{
- foreach_in_list(ir_instruction, node, instructions) {
- ir_variable *var = node->as_variable();
+ foreach_list (node, instructions) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (var == NULL)
continue;
@@ -261,7 +261,6 @@ lower_packed_varyings_visitor::run(exec_list *instructions)
!var->type->contains_integer());
/* Change the old varying into an ordinary global. */
- assert(var->data.mode != ir_var_temporary);
var->data.mode = ir_var_auto;
/* Create a reference to the old varying. */
@@ -614,7 +613,7 @@ public:
explicit lower_packed_varyings_gs_splicer(void *mem_ctx,
const exec_list *instructions);
- virtual ir_visitor_status visit_leave(ir_emit_vertex *ev);
+ virtual ir_visitor_status visit(ir_emit_vertex *ev);
private:
/**
@@ -638,9 +637,10 @@ lower_packed_varyings_gs_splicer::lower_packed_varyings_gs_splicer(
ir_visitor_status
-lower_packed_varyings_gs_splicer::visit_leave(ir_emit_vertex *ev)
+lower_packed_varyings_gs_splicer::visit(ir_emit_vertex *ev)
{
- foreach_in_list(ir_instruction, ir, this->instructions) {
+ foreach_list(node, this->instructions) {
+ ir_instruction *ir = (ir_instruction *) node;
ev->insert_before(ir->clone(this->mem_ctx, NULL));
}
return visit_continue;
@@ -656,7 +656,7 @@ lower_packed_varyings(void *mem_ctx, unsigned locations_used,
ir_function *main_func = shader->symbols->get_function("main");
exec_list void_parameters;
ir_function_signature *main_func_sig
- = main_func->matching_signature(NULL, &void_parameters, false);
+ = main_func->matching_signature(NULL, &void_parameters);
exec_list new_instructions;
lower_packed_varyings_visitor visitor(mem_ctx, locations_used, mode,
gs_input_vertices, &new_instructions);
diff --git a/dist/Mesa/src/glsl/lower_texture_projection.cpp b/dist/Mesa/src/glsl/lower_texture_projection.cpp
index 95df106d9..16d637680 100644
--- a/dist/Mesa/src/glsl/lower_texture_projection.cpp
+++ b/dist/Mesa/src/glsl/lower_texture_projection.cpp
@@ -62,7 +62,7 @@ lower_texture_projection_visitor::visit_leave(ir_texture *ir)
void *mem_ctx = ralloc_parent(ir);
ir_variable *var = new(mem_ctx) ir_variable(ir->projector->type,
- "projector", ir_var_temporary);
+ "projector", ir_var_auto);
base_ir->insert_before(var);
ir_dereference *deref = new(mem_ctx) ir_dereference_variable(var);
ir_expression *expr = new(mem_ctx) ir_expression(ir_unop_rcp,
diff --git a/dist/Mesa/src/glsl/lower_ubo_reference.cpp b/dist/Mesa/src/glsl/lower_ubo_reference.cpp
index 43dd067fa..90e65bd0e 100644
--- a/dist/Mesa/src/glsl/lower_ubo_reference.cpp
+++ b/dist/Mesa/src/glsl/lower_ubo_reference.cpp
@@ -40,96 +40,6 @@
using namespace ir_builder;
-/**
- * Determine if a thing being dereferenced is row-major
- *
- * There is some trickery here.
- *
- * If the thing being dereferenced is a member of uniform block \b without an
- * instance name, then the name of the \c ir_variable is the field name of an
- * interface type. If this field is row-major, then the thing referenced is
- * row-major.
- *
- * If the thing being dereferenced is a member of uniform block \b with an
- * instance name, then the last dereference in the tree will be an
- * \c ir_dereference_record. If that record field is row-major, then the
- * thing referenced is row-major.
- */
-static bool
-is_dereferenced_thing_row_major(const ir_dereference *deref)
-{
- bool matrix = false;
- const ir_rvalue *ir = deref;
-
- while (true) {
- matrix = matrix || ir->type->without_array()->is_matrix();
-
- switch (ir->ir_type) {
- case ir_type_dereference_array: {
- const ir_dereference_array *const array_deref =
- (const ir_dereference_array *) ir;
-
- ir = array_deref->array;
- break;
- }
-
- case ir_type_dereference_record: {
- const ir_dereference_record *const record_deref =
- (const ir_dereference_record *) ir;
-
- ir = record_deref->record;
-
- const int idx = ir->type->field_index(record_deref->field);
- assert(idx >= 0);
-
- const enum glsl_matrix_layout matrix_layout =
- glsl_matrix_layout(ir->type->fields.structure[idx].matrix_layout);
-
- switch (matrix_layout) {
- case GLSL_MATRIX_LAYOUT_INHERITED:
- break;
- case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR:
- return false;
- case GLSL_MATRIX_LAYOUT_ROW_MAJOR:
- return matrix || deref->type->without_array()->is_record();
- }
-
- break;
- }
-
- case ir_type_dereference_variable: {
- const ir_dereference_variable *const var_deref =
- (const ir_dereference_variable *) ir;
-
- const enum glsl_matrix_layout matrix_layout =
- glsl_matrix_layout(var_deref->var->data.matrix_layout);
-
- switch (matrix_layout) {
- case GLSL_MATRIX_LAYOUT_INHERITED:
- assert(!matrix);
- return false;
- case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR:
- return false;
- case GLSL_MATRIX_LAYOUT_ROW_MAJOR:
- return matrix || deref->type->without_array()->is_record();
- }
-
- unreachable("invalid matrix layout");
- break;
- }
-
- default:
- return false;
- }
- }
-
- /* The tree must have ended with a dereference that wasn't an
- * ir_dereference_variable. That is invalid, and it should be impossible.
- */
- unreachable("invalid dereference tree");
- return false;
-}
-
namespace {
class lower_ubo_reference_visitor : public ir_rvalue_enter_visitor {
public:
@@ -140,14 +50,14 @@ public:
void handle_rvalue(ir_rvalue **rvalue);
void emit_ubo_loads(ir_dereference *deref, ir_variable *base_offset,
- unsigned int deref_offset, bool row_major);
+ unsigned int deref_offset);
ir_expression *ubo_load(const struct glsl_type *type,
ir_rvalue *offset);
void *mem_ctx;
struct gl_shader *shader;
struct gl_uniform_buffer_variable *ubo_var;
- ir_rvalue *uniform_block;
+ unsigned uniform_block;
bool progress;
};
@@ -159,11 +69,9 @@ public:
* \c UniformBlocks array.
*/
static const char *
-interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d,
- ir_rvalue **nonconst_block_index)
+interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d)
{
- ir_rvalue *previous_index = NULL;
- *nonconst_block_index = NULL;
+ ir_constant *previous_index = NULL;
while (d != NULL) {
switch (d->ir_type) {
@@ -171,21 +79,13 @@ interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d,
ir_dereference_variable *v = (ir_dereference_variable *) d;
if (previous_index
&& v->var->is_interface_instance()
- && v->var->type->is_array()) {
-
- ir_constant *const_index = previous_index->as_constant();
- if (!const_index) {
- *nonconst_block_index = previous_index;
- return ralloc_asprintf(mem_ctx, "%s[0]", base_name);
- } else {
- return ralloc_asprintf(mem_ctx,
- "%s[%d]",
- base_name,
- const_index->get_uint_component(0));
- }
- } else {
+ && v->var->type->is_array())
+ return ralloc_asprintf(mem_ctx,
+ "%s[%d]",
+ base_name,
+ previous_index->get_uint_component(0));
+ else
return base_name;
- }
break;
}
@@ -201,8 +101,7 @@ interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d,
ir_dereference_array *a = (ir_dereference_array *) d;
d = a->array->as_dereference();
- previous_index = a->array_index;
-
+ previous_index = a->array_index->as_constant();
break;
}
@@ -232,24 +131,14 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
mem_ctx = ralloc_parent(*rvalue);
- ir_rvalue *nonconst_block_index;
const char *const field_name =
interface_field_name(mem_ctx, (char *) var->get_interface_type()->name,
- deref, &nonconst_block_index);
+ deref);
- this->uniform_block = NULL;
+ this->uniform_block = -1;
for (unsigned i = 0; i < shader->NumUniformBlocks; i++) {
if (strcmp(field_name, shader->UniformBlocks[i].Name) == 0) {
-
- ir_constant *index = new(mem_ctx) ir_constant(i);
-
- if (nonconst_block_index) {
- if (nonconst_block_index->type != glsl_type::uint_type)
- nonconst_block_index = i2u(nonconst_block_index);
- this->uniform_block = add(nonconst_block_index, index);
- } else {
- this->uniform_block = index;
- }
+ this->uniform_block = i;
struct gl_uniform_block *block = &shader->UniformBlocks[i];
@@ -260,11 +149,11 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
}
}
- assert(this->uniform_block);
+ assert(this->uniform_block != (unsigned) -1);
ir_rvalue *offset = new(mem_ctx) ir_constant(0u);
unsigned const_offset = 0;
- bool row_major = is_dereferenced_thing_row_major(deref);
+ bool row_major = ubo_var->RowMajor;
/* Calculate the offset to the start of the region of the UBO
* dereferenced by *rvalue. This may be a variable offset if an
@@ -301,14 +190,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
deref = deref_array->array->as_dereference();
break;
} else {
- /* Whether or not the field is row-major (because it might be a
- * bvec2 or something) does not affect the array itself. We need
- * to know whether an array element in its entirety is row-major.
- */
- const bool array_row_major =
- is_dereferenced_thing_row_major(deref_array);
-
- array_stride = deref_array->type->std140_size(array_row_major);
+ array_stride = deref_array->type->std140_size(row_major);
array_stride = glsl_align(array_stride, 16);
}
@@ -316,8 +198,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
if (array_index->type->base_type == GLSL_TYPE_INT)
array_index = i2u(array_index);
- ir_constant *const_index =
- array_index->constant_expression_value(NULL);
+ ir_constant *const_index = array_index->as_constant();
if (const_index) {
const_offset += array_stride * const_index->value.u[0];
} else {
@@ -334,49 +215,20 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
const glsl_type *struct_type = deref_record->record->type;
unsigned intra_struct_offset = 0;
- /* glsl_type::std140_base_alignment doesn't grok interfaces. Use
- * 16-bytes for the alignment because that is the general minimum of
- * std140.
- */
- const unsigned struct_alignment = struct_type->is_interface()
- ? 16
- : struct_type->std140_base_alignment(row_major);
-
-
+ unsigned max_field_align = 16;
for (unsigned int i = 0; i < struct_type->length; i++) {
const glsl_type *type = struct_type->fields.structure[i].type;
-
- ir_dereference_record *field_deref =
- new(mem_ctx) ir_dereference_record(deref_record->record,
- struct_type->fields.structure[i].name);
- const bool field_row_major =
- is_dereferenced_thing_row_major(field_deref);
-
- ralloc_free(field_deref);
-
- unsigned field_align = type->std140_base_alignment(field_row_major);
-
+ unsigned field_align = type->std140_base_alignment(row_major);
+ max_field_align = MAX2(field_align, max_field_align);
intra_struct_offset = glsl_align(intra_struct_offset, field_align);
if (strcmp(struct_type->fields.structure[i].name,
deref_record->field) == 0)
break;
- intra_struct_offset += type->std140_size(field_row_major);
-
- /* If the field just examined was itself a structure, apply rule
- * #9:
- *
- * "The structure may have padding at the end; the base offset
- * of the member following the sub-structure is rounded up to
- * the next multiple of the base alignment of the structure."
- */
- if (type->without_array()->is_record()) {
- intra_struct_offset = glsl_align(intra_struct_offset,
- struct_alignment);
-
- }
+ intra_struct_offset += type->std140_size(row_major);
}
+ const_offset = glsl_align(const_offset, max_field_align);
const_offset += intra_struct_offset;
deref = deref_record->record->as_dereference();
@@ -405,7 +257,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
base_ir->insert_before(assign(load_offset, offset));
deref = new(mem_ctx) ir_dereference_variable(load_var);
- emit_ubo_loads(deref, load_offset, const_offset, row_major);
+ emit_ubo_loads(deref, load_offset, const_offset);
*rvalue = deref;
progress = true;
@@ -415,12 +267,11 @@ ir_expression *
lower_ubo_reference_visitor::ubo_load(const glsl_type *type,
ir_rvalue *offset)
{
- ir_rvalue *block_ref = this->uniform_block->clone(mem_ctx, NULL);
return new(mem_ctx)
ir_expression(ir_binop_ubo_load,
- type,
- block_ref,
- offset);
+ type,
+ new(mem_ctx) ir_constant(this->uniform_block),
+ offset);
}
@@ -435,8 +286,7 @@ lower_ubo_reference_visitor::ubo_load(const glsl_type *type,
void
lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref,
ir_variable *base_offset,
- unsigned int deref_offset,
- bool row_major)
+ unsigned int deref_offset)
{
if (deref->type->is_record()) {
unsigned int field_offset = 0;
@@ -450,19 +300,18 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref,
field_offset =
glsl_align(field_offset,
- field->type->std140_base_alignment(row_major));
+ field->type->std140_base_alignment(ubo_var->RowMajor));
- emit_ubo_loads(field_deref, base_offset, deref_offset + field_offset,
- row_major);
+ emit_ubo_loads(field_deref, base_offset, deref_offset + field_offset);
- field_offset += field->type->std140_size(row_major);
+ field_offset += field->type->std140_size(ubo_var->RowMajor);
}
return;
}
if (deref->type->is_array()) {
unsigned array_stride =
- glsl_align(deref->type->fields.array->std140_size(row_major),
+ glsl_align(deref->type->fields.array->std140_size(ubo_var->RowMajor),
16);
for (unsigned i = 0; i < deref->type->length; i++) {
@@ -471,8 +320,7 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref,
new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL),
element);
emit_ubo_loads(element_deref, base_offset,
- deref_offset + i * array_stride,
- row_major);
+ deref_offset + i * array_stride);
}
return;
}
@@ -484,19 +332,10 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref,
new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL),
col);
- if (row_major) {
- /* For a row-major matrix, the next column starts at the next
- * element.
- */
- emit_ubo_loads(col_deref, base_offset, deref_offset + i * 4,
- row_major);
- } else {
- /* std140 always rounds the stride of arrays (and matrices) to a
- * vec4, so matrices are always 16 between columns/rows.
- */
- emit_ubo_loads(col_deref, base_offset, deref_offset + i * 16,
- row_major);
- }
+ /* std140 always rounds the stride of arrays (and matrices)
+ * to a vec4, so matrices are always 16 between columns/rows.
+ */
+ emit_ubo_loads(col_deref, base_offset, deref_offset + i * 16);
}
return;
}
@@ -504,7 +343,7 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref,
assert(deref->type->is_scalar() ||
deref->type->is_vector());
- if (!row_major) {
+ if (!ubo_var->RowMajor) {
ir_rvalue *offset = add(base_offset,
new(mem_ctx) ir_constant(deref_offset));
base_ir->insert_before(assign(deref->clone(mem_ctx, NULL),
diff --git a/dist/Mesa/src/glsl/opt_algebraic.cpp b/dist/Mesa/src/glsl/opt_algebraic.cpp
index 430f5cb97..9d5539252 100644
--- a/dist/Mesa/src/glsl/opt_algebraic.cpp
+++ b/dist/Mesa/src/glsl/opt_algebraic.cpp
@@ -45,9 +45,7 @@ namespace {
class ir_algebraic_visitor : public ir_rvalue_visitor {
public:
- ir_algebraic_visitor(bool native_integers,
- const struct gl_shader_compiler_options *options)
- : options(options)
+ ir_algebraic_visitor(bool native_integers)
{
this->progress = false;
this->mem_ctx = NULL;
@@ -71,7 +69,6 @@ public:
ir_rvalue *swizzle_if_required(ir_expression *expr,
ir_rvalue *operand);
- const struct gl_shader_compiler_options *options;
void *mem_ctx;
bool native_integers;
@@ -105,45 +102,9 @@ is_vec_negative_one(ir_constant *ir)
}
static inline bool
-is_valid_vec_const(ir_constant *ir)
+is_vec_basis(ir_constant *ir)
{
- if (ir == NULL)
- return false;
-
- if (!ir->type->is_scalar() && !ir->type->is_vector())
- return false;
-
- return true;
-}
-
-static inline bool
-is_less_than_one(ir_constant *ir)
-{
- if (!is_valid_vec_const(ir))
- return false;
-
- unsigned component = 0;
- for (int c = 0; c < ir->type->vector_elements; c++) {
- if (ir->get_float_component(c) < 1.0f)
- component++;
- }
-
- return (component == ir->type->vector_elements);
-}
-
-static inline bool
-is_greater_than_zero(ir_constant *ir)
-{
- if (!is_valid_vec_const(ir))
- return false;
-
- unsigned component = 0;
- for (int c = 0; c < ir->type->vector_elements; c++) {
- if (ir->get_float_component(c) > 0.0f)
- component++;
- }
-
- return (component == ir->type->vector_elements);
+ return (ir == NULL) ? false : ir->is_basis();
}
static void
@@ -155,46 +116,6 @@ update_type(ir_expression *ir)
ir->type = ir->operands[1]->type;
}
-/* Recognize (v.x + v.y) + (v.z + v.w) as dot(v, 1.0) */
-static ir_expression *
-try_replace_with_dot(ir_expression *expr0, ir_expression *expr1, void *mem_ctx)
-{
- if (expr0 && expr0->operation == ir_binop_add &&
- expr0->type->is_float() &&
- expr1 && expr1->operation == ir_binop_add &&
- expr1->type->is_float()) {
- ir_swizzle *x = expr0->operands[0]->as_swizzle();
- ir_swizzle *y = expr0->operands[1]->as_swizzle();
- ir_swizzle *z = expr1->operands[0]->as_swizzle();
- ir_swizzle *w = expr1->operands[1]->as_swizzle();
-
- if (!x || x->mask.num_components != 1 ||
- !y || y->mask.num_components != 1 ||
- !z || z->mask.num_components != 1 ||
- !w || w->mask.num_components != 1) {
- return NULL;
- }
-
- bool swiz_seen[4] = {false, false, false, false};
- swiz_seen[x->mask.x] = true;
- swiz_seen[y->mask.x] = true;
- swiz_seen[z->mask.x] = true;
- swiz_seen[w->mask.x] = true;
-
- if (!swiz_seen[0] || !swiz_seen[1] ||
- !swiz_seen[2] || !swiz_seen[3]) {
- return NULL;
- }
-
- if (x->val->equals(y->val) &&
- x->val->equals(z->val) &&
- x->val->equals(w->val)) {
- return dot(x->val, new(mem_ctx) ir_constant(1.0f, 4));
- }
- }
- return NULL;
-}
-
void
ir_algebraic_visitor::reassociate_operands(ir_expression *ir1,
int op1,
@@ -351,20 +272,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
if (op_expr[0]->operation == ir_unop_log2) {
return op_expr[0]->operands[0];
}
-
- if (!options->EmitNoPow && op_expr[0]->operation == ir_binop_mul) {
- for (int log2_pos = 0; log2_pos < 2; log2_pos++) {
- ir_expression *log2_expr =
- op_expr[0]->operands[log2_pos]->as_expression();
-
- if (log2_expr && log2_expr->operation == ir_unop_log2) {
- return new(mem_ctx) ir_expression(ir_binop_pow,
- ir->type,
- log2_expr->operands[0],
- op_expr[0]->operands[1 - log2_pos]);
- }
- }
- }
break;
case ir_unop_log2:
@@ -422,14 +329,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
if (op_const[1] && !op_const[0])
reassociate_constant(ir, 1, op_const[1], op_expr[0]);
- /* Recognize (v.x + v.y) + (v.z + v.w) as dot(v, 1.0) */
- if (options->OptimizeForAOS) {
- ir_expression *expr = try_replace_with_dot(op_expr[0], op_expr[1],
- mem_ctx);
- if (expr)
- return expr;
- }
-
/* Replace (-x + y) * a + x and commutative variations with lrp(x, y, a).
*
* (-x + y) * a + x
@@ -481,7 +380,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
}
}
}
-
break;
case ir_binop_sub:
@@ -531,34 +429,21 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1]))
return ir_constant::zero(mem_ctx, ir->type);
- for (int i = 0; i < 2; i++) {
- if (!op_const[i])
- continue;
-
- unsigned components[4] = { 0 }, count = 0;
-
- for (unsigned c = 0; c < op_const[i]->type->vector_elements; c++) {
- if (op_const[i]->value.f[c] == 0.0)
- continue;
-
- components[count] = c;
- count++;
- }
-
- /* No channels had zero values; bail. */
- if (count >= op_const[i]->type->vector_elements)
- break;
-
- ir_expression_operation op = count == 1 ?
- ir_binop_mul : ir_binop_dot;
-
- /* Swizzle both operands to remove the channels that were zero. */
- return new(mem_ctx)
- ir_expression(op, glsl_type::float_type,
- new(mem_ctx) ir_swizzle(ir->operands[0],
- components, count),
- new(mem_ctx) ir_swizzle(ir->operands[1],
- components, count));
+ if (is_vec_basis(op_const[0])) {
+ unsigned component = 0;
+ for (unsigned c = 0; c < op_const[0]->type->vector_elements; c++) {
+ if (op_const[0]->value.f[c] == 1.0)
+ component = c;
+ }
+ return new(mem_ctx) ir_swizzle(ir->operands[1], component, 0, 0, 0, 1);
+ }
+ if (is_vec_basis(op_const[1])) {
+ unsigned component = 0;
+ for (unsigned c = 0; c < op_const[1]->type->vector_elements; c++) {
+ if (op_const[1]->value.f[c] == 1.0)
+ component = c;
+ }
+ return new(mem_ctx) ir_swizzle(ir->operands[0], component, 0, 0, 0, 1);
}
break;
@@ -677,62 +562,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
break;
- case ir_binop_min:
- case ir_binop_max:
- if (ir->type->base_type != GLSL_TYPE_FLOAT)
- break;
-
- /* Replace min(max) operations and its commutative combinations with
- * a saturate operation
- */
- for (int op = 0; op < 2; op++) {
- ir_expression *minmax = op_expr[op];
- ir_constant *outer_const = op_const[1 - op];
- ir_expression_operation op_cond = (ir->operation == ir_binop_max) ?
- ir_binop_min : ir_binop_max;
-
- if (!minmax || !outer_const || (minmax->operation != op_cond))
- continue;
-
- /* Found a min(max) combination. Now try to see if its operands
- * meet our conditions that we can do just a single saturate operation
- */
- for (int minmax_op = 0; minmax_op < 2; minmax_op++) {
- ir_rvalue *inner_val_a = minmax->operands[minmax_op];
- ir_rvalue *inner_val_b = minmax->operands[1 - minmax_op];
-
- if (!inner_val_a || !inner_val_b)
- continue;
-
- /* Found a {min|max} ({max|min} (x, 0.0), 1.0) operation and its variations */
- if ((outer_const->is_one() && inner_val_a->is_zero()) ||
- (inner_val_a->is_one() && outer_const->is_zero()))
- return saturate(inner_val_b);
-
- /* Found a {min|max} ({max|min} (x, 0.0), b) where b < 1.0
- * and its variations
- */
- if (is_less_than_one(outer_const) && inner_val_b->is_zero())
- return expr(ir_binop_min, saturate(inner_val_a), outer_const);
-
- if (!inner_val_b->as_constant())
- continue;
-
- if (is_less_than_one(inner_val_b->as_constant()) && outer_const->is_zero())
- return expr(ir_binop_min, saturate(inner_val_a), inner_val_b);
-
- /* Found a {min|max} ({max|min} (x, b), 1.0), where b > 0.0
- * and its variations
- */
- if (outer_const->is_one() && is_greater_than_zero(inner_val_b->as_constant()))
- return expr(ir_binop_max, saturate(inner_val_a), inner_val_b);
- if (inner_val_b->as_constant()->is_one() && is_greater_than_zero(outer_const))
- return expr(ir_binop_max, saturate(inner_val_a), outer_const);
- }
- }
-
- break;
-
case ir_unop_rcp:
if (op_expr[0] && op_expr[0]->operation == ir_unop_rcp)
return op_expr[0]->operands[0];
@@ -818,10 +647,9 @@ ir_algebraic_visitor::handle_rvalue(ir_rvalue **rvalue)
}
bool
-do_algebraic(exec_list *instructions, bool native_integers,
- const struct gl_shader_compiler_options *options)
+do_algebraic(exec_list *instructions, bool native_integers)
{
- ir_algebraic_visitor v(native_integers, options);
+ ir_algebraic_visitor v(native_integers);
visit_list_elements(&v, instructions);
diff --git a/dist/Mesa/src/glsl/opt_array_splitting.cpp b/dist/Mesa/src/glsl/opt_array_splitting.cpp
index 9e73f3c44..97d3a57e9 100644
--- a/dist/Mesa/src/glsl/opt_array_splitting.cpp
+++ b/dist/Mesa/src/glsl/opt_array_splitting.cpp
@@ -135,7 +135,8 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var)
if (var->type->is_unsized_array())
return NULL;
- foreach_in_list(variable_entry, entry, &this->variable_list) {
+ foreach_list(n, &this->variable_list) {
+ variable_entry *entry = (variable_entry *) n;
if (entry->var == var)
return entry;
}
@@ -212,8 +213,8 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions,
* declarations, which need to be matched by name across shaders.
*/
if (!linked) {
- foreach_in_list(ir_instruction, node, instructions) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, instructions) {
+ ir_variable *var = ((ir_instruction *)node)->as_variable();
if (var) {
variable_entry *entry = get_variable_entry(var);
if (entry)
@@ -223,7 +224,9 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions,
}
/* Trim out variables we found that we can't split. */
- foreach_in_list_safe(variable_entry, entry, &variable_list) {
+ foreach_list_safe(n, &variable_list) {
+ variable_entry *entry = (variable_entry *) n;
+
if (debug) {
printf("array %s@%p: decl %d, split %d\n",
entry->var->name, (void *) entry->var, entry->declaration,
@@ -267,7 +270,8 @@ ir_array_splitting_visitor::get_splitting_entry(ir_variable *var)
{
assert(var);
- foreach_in_list(variable_entry, entry, this->variable_list) {
+ foreach_list(n, this->variable_list) {
+ variable_entry *entry = (variable_entry *) n;
if (entry->var == var) {
return entry;
}
@@ -295,7 +299,7 @@ ir_array_splitting_visitor::split_deref(ir_dereference **deref)
ir_constant *constant = deref_array->array_index->as_constant();
assert(constant);
- if (constant->value.i[0] >= 0 && constant->value.i[0] < (int)entry->size) {
+ if (constant->value.i[0] < (int)entry->size) {
*deref = new(entry->mem_ctx)
ir_dereference_variable(entry->components[constant->value.i[0]]);
} else {
@@ -364,7 +368,8 @@ optimize_split_arrays(exec_list *instructions, bool linked)
/* Replace the decls of the arrays to be split with their split
* components.
*/
- foreach_in_list(variable_entry, entry, &refs.variable_list) {
+ foreach_list(n, &refs.variable_list) {
+ variable_entry *entry = (variable_entry *) n;
const struct glsl_type *type = entry->var->type;
const struct glsl_type *subtype;
diff --git a/dist/Mesa/src/glsl/opt_cse.cpp b/dist/Mesa/src/glsl/opt_cse.cpp
index b0b67f496..1b8782bcb 100644
--- a/dist/Mesa/src/glsl/opt_cse.cpp
+++ b/dist/Mesa/src/glsl/opt_cse.cpp
@@ -173,7 +173,9 @@ dump_ae(exec_list *ae)
int i = 0;
printf("CSE: AE contents:\n");
- foreach_in_list(ae_entry, entry, ae) {
+ foreach_list(node, ae) {
+ ae_entry *entry = (ae_entry *)node;
+
printf("CSE: AE %2d (%p): ", i, entry);
(*entry->val)->print();
printf("\n");
@@ -194,8 +196,6 @@ is_cse_candidate_visitor::visit(ir_dereference_variable *ir)
if (ir->var->data.read_only) {
return visit_continue;
} else {
- if (debug)
- printf("CSE: non-candidate: var %s is not read only\n", ir->var->name);
ok = false;
return visit_stop;
}
@@ -222,11 +222,8 @@ is_cse_candidate(ir_rvalue *ir)
/* Our temporary variable assignment generation isn't ready to handle
* anything bigger than a vector.
*/
- if (!ir->type->is_vector() && !ir->type->is_scalar()) {
- if (debug)
- printf("CSE: non-candidate: not a vector/scalar\n");
+ if (!ir->type->is_vector() && !ir->type->is_scalar())
return false;
- }
/* Only handle expressions and textures currently. We may want to extend
* to variable-index array dereferences at some point.
@@ -236,8 +233,6 @@ is_cse_candidate(ir_rvalue *ir)
case ir_type_texture:
break;
default:
- if (debug)
- printf("CSE: non-candidate: not an expression/texture\n");
return false;
}
@@ -259,7 +254,9 @@ is_cse_candidate(ir_rvalue *ir)
ir_rvalue *
cse_visitor::try_cse(ir_rvalue *rvalue)
{
- foreach_in_list(ae_entry, entry, ae) {
+ foreach_list(node, ae) {
+ ae_entry *entry = (ae_entry *)node;
+
if (debug) {
printf("Comparing to AE %p: ", entry);
(*entry->val)->print();
@@ -283,7 +280,7 @@ cse_visitor::try_cse(ir_rvalue *rvalue)
ir_variable *var = new(rvalue) ir_variable(rvalue->type,
"cse",
- ir_var_temporary);
+ ir_var_auto);
/* Write the previous expression result into a new variable. */
base_ir->insert_before(var);
@@ -306,7 +303,8 @@ cse_visitor::try_cse(ir_rvalue *rvalue)
* updated so that any further elimination from inside gets its new
* assignments put before our new assignment.
*/
- foreach_in_list(ae_entry, fixup_entry, ae) {
+ foreach_list(fixup_node, ae) {
+ ae_entry *fixup_entry = (ae_entry *)fixup_node;
if (contains_rvalue(assignment->rhs, *fixup_entry->val))
fixup_entry->base_ir = assignment;
}
diff --git a/dist/Mesa/src/glsl/opt_dead_builtin_varyings.cpp b/dist/Mesa/src/glsl/opt_dead_builtin_varyings.cpp
index 50c8aa763..6612592aa 100644
--- a/dist/Mesa/src/glsl/opt_dead_builtin_varyings.cpp
+++ b/dist/Mesa/src/glsl/opt_dead_builtin_varyings.cpp
@@ -334,7 +334,7 @@ public:
}
void prepare_array(exec_list *ir,
- ir_variable **new_var,
+ struct ir_variable **new_var,
int max_elements, unsigned start_location,
const char *var_name, const char *mode_str,
unsigned usage, unsigned external_usage)
diff --git a/dist/Mesa/src/glsl/opt_dead_code.cpp b/dist/Mesa/src/glsl/opt_dead_code.cpp
index f45bf5dfd..af53d94fd 100644
--- a/dist/Mesa/src/glsl/opt_dead_code.cpp
+++ b/dist/Mesa/src/glsl/opt_dead_code.cpp
@@ -31,7 +31,7 @@
#include "ir_visitor.h"
#include "ir_variable_refcount.h"
#include "glsl_types.h"
-#include "util/hash_table.h"
+#include "main/hash_table.h"
static bool debug = false;
@@ -99,31 +99,10 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
* stage. Also, once uniform locations have been assigned, the
* declaration cannot be deleted.
*/
- if (entry->var->data.mode == ir_var_uniform) {
- if (uniform_locations_assigned || entry->var->constant_value)
- continue;
-
- /* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec
- * says:
- *
- * "All members of a named uniform block declared with a
- * shared or std140 layout qualifier are considered active,
- * even if they are not referenced in any shader in the
- * program. The uniform block itself is also considered
- * active, even if no member of the block is referenced."
- *
- * If the variable is in a uniform block with one of those
- * layouts, do not eliminate it.
- */
- if (entry->var->is_in_uniform_block()) {
- const glsl_type *const block_type =
- entry->var->is_interface_instance()
- ? entry->var->type : entry->var->get_interface_type();
-
- if (block_type->interface_packing != GLSL_INTERFACE_PACKING_PACKED)
- continue;
- }
- }
+ if (entry->var->data.mode == ir_var_uniform &&
+ (uniform_locations_assigned ||
+ entry->var->constant_value))
+ continue;
entry->var->remove();
progress = true;
@@ -150,10 +129,12 @@ do_dead_code_unlinked(exec_list *instructions)
{
bool progress = false;
- foreach_in_list(ir_instruction, ir, instructions) {
+ foreach_list(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
ir_function *f = ir->as_function();
if (f) {
- foreach_in_list(ir_function_signature, sig, &f->signatures) {
+ foreach_list(signode, &f->signatures) {
+ ir_function_signature *sig = (ir_function_signature *) signode;
/* The setting of the uniform_locations_assigned flag here is
* irrelevent. If there is a uniform declaration encountered
* inside the body of the function, something has already gone
diff --git a/dist/Mesa/src/glsl/opt_flip_matrices.cpp b/dist/Mesa/src/glsl/opt_flip_matrices.cpp
index 04c6170b8..9044fd680 100644
--- a/dist/Mesa/src/glsl/opt_flip_matrices.cpp
+++ b/dist/Mesa/src/glsl/opt_flip_matrices.cpp
@@ -45,7 +45,8 @@ public:
mvp_transpose = NULL;
texmat_transpose = NULL;
- foreach_in_list(ir_instruction, ir, instructions) {
+ foreach_list(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
ir_variable *var = ir->as_variable();
if (!var)
continue;
diff --git a/dist/Mesa/src/glsl/opt_vectorize.cpp b/dist/Mesa/src/glsl/opt_vectorize.cpp
index 2f71a8358..f9a3b6183 100644
--- a/dist/Mesa/src/glsl/opt_vectorize.cpp
+++ b/dist/Mesa/src/glsl/opt_vectorize.cpp
@@ -86,7 +86,6 @@ public:
virtual ir_visitor_status visit_enter(ir_expression *);
virtual ir_visitor_status visit_enter(ir_if *);
virtual ir_visitor_status visit_enter(ir_loop *);
- virtual ir_visitor_status visit_enter(ir_texture *);
virtual ir_visitor_status visit_leave(ir_assignment *);
@@ -228,7 +227,8 @@ write_mask_to_swizzle(unsigned write_mask)
case WRITEMASK_Z: return SWIZZLE_Z;
case WRITEMASK_W: return SWIZZLE_W;
}
- unreachable("not reached");
+ assert(!"not reached");
+ unreachable();
}
/**
@@ -353,18 +353,6 @@ ir_vectorize_visitor::visit_enter(ir_loop *ir)
}
/**
- * Upon entering an ir_texture, remove the current assignment from
- * further consideration. Vectorizing multiple texture lookups into one
- * is wrong.
- */
-ir_visitor_status
-ir_vectorize_visitor::visit_enter(ir_texture *)
-{
- this->current_assignment = NULL;
- return visit_continue_with_parent;
-}
-
-/**
* Upon leaving an ir_assignment, save a pointer to it in ::assignment[] if
* the swizzle mask(s) found were appropriate. Also save a pointer in
* ::last_assignment so that we can compare future assignments with it.
diff --git a/dist/Mesa/src/glsl/standalone_scaffolding.cpp b/dist/Mesa/src/glsl/standalone_scaffolding.cpp
index 67b0d0c82..6c25010b7 100644
--- a/dist/Mesa/src/glsl/standalone_scaffolding.cpp
+++ b/dist/Mesa/src/glsl/standalone_scaffolding.cpp
@@ -31,7 +31,7 @@
#include <assert.h>
#include <string.h>
-#include "util/ralloc.h"
+#include "ralloc.h"
void
_mesa_warning(struct gl_context *ctx, const char *fmt, ...)
@@ -83,33 +83,6 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
return shader;
}
-void
-_mesa_clear_shader_program_data(struct gl_shader_program *shProg)
-{
- unsigned i;
-
- shProg->NumUserUniformStorage = 0;
- shProg->UniformStorage = NULL;
- shProg->NumUniformRemapTable = 0;
- shProg->UniformRemapTable = NULL;
- shProg->UniformHash = NULL;
-
- ralloc_free(shProg->InfoLog);
- shProg->InfoLog = ralloc_strdup(shProg, "");
-
- ralloc_free(shProg->UniformBlocks);
- shProg->UniformBlocks = NULL;
- shProg->NumUniformBlocks = 0;
- for (i = 0; i < MESA_SHADER_STAGES; i++) {
- ralloc_free(shProg->UniformBlockStageIndex[i]);
- shProg->UniformBlockStageIndex[i] = NULL;
- }
-
- ralloc_free(shProg->AtomicBuffers);
- shProg->AtomicBuffers = NULL;
- shProg->NumAtomicBuffers = 0;
-}
-
void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
{
memset(ctx, 0, sizeof(*ctx));
@@ -125,7 +98,6 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
ctx->Extensions.ARB_ES3_compatibility = true;
ctx->Extensions.ARB_explicit_attrib_location = true;
ctx->Extensions.ARB_fragment_coord_conventions = true;
- ctx->Extensions.ARB_fragment_layer_viewport = true;
ctx->Extensions.ARB_gpu_shader5 = true;
ctx->Extensions.ARB_sample_shading = true;
ctx->Extensions.ARB_shader_bit_encoding = true;
@@ -191,5 +163,5 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
options.DefaultPragmas.Optimize = true;
for (int sh = 0; sh < MESA_SHADER_STAGES; ++sh)
- memcpy(&ctx->Const.ShaderCompilerOptions[sh], &options, sizeof(options));
+ memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options));
}
diff --git a/dist/Mesa/src/glsl/standalone_scaffolding.h b/dist/Mesa/src/glsl/standalone_scaffolding.h
index 895dd2782..df783afdb 100644
--- a/dist/Mesa/src/glsl/standalone_scaffolding.h
+++ b/dist/Mesa/src/glsl/standalone_scaffolding.h
@@ -45,9 +45,6 @@ extern "C" struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
extern "C" void
-_mesa_clear_shader_program_data(struct gl_shader_program *);
-
-extern "C" void
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
const char *msg, int len);
diff --git a/dist/Mesa/src/glsl/test_optpass.cpp b/dist/Mesa/src/glsl/test_optpass.cpp
index ac3e3f48c..db5cb2662 100644
--- a/dist/Mesa/src/glsl/test_optpass.cpp
+++ b/dist/Mesa/src/glsl/test_optpass.cpp
@@ -65,7 +65,7 @@ do_optimization(struct exec_list *ir, const char *optimization,
if (sscanf(optimization, "do_common_optimization ( %d ) ", &int_0) == 1) {
return do_common_optimization(ir, int_0 != 0, false, options, true);
} else if (strcmp(optimization, "do_algebraic") == 0) {
- return do_algebraic(ir, true, options);
+ return do_algebraic(ir, true);
} else if (strcmp(optimization, "do_constant_folding") == 0) {
return do_constant_folding(ir);
} else if (strcmp(optimization, "do_constant_variable") == 0) {
@@ -200,7 +200,6 @@ int test_optpass(int argc, char **argv)
initialize_context_to_defaults(ctx, API_OPENGL_COMPAT);
ctx->Driver.NewShader = _mesa_new_shader;
- ir_variable::temporaries_allocate_names = true;
struct gl_shader *shader = rzalloc(NULL, struct gl_shader);
shader->Type = shader_type;
@@ -243,7 +242,7 @@ int test_optpass(int argc, char **argv)
if (!state->error) {
GLboolean progress;
const struct gl_shader_compiler_options *options =
- &ctx->Const.ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader_type)];
+ &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader_type)];
do {
progress = do_optimization_passes(shader->ir, &argv[optind],
argc - optind, quiet != 0, options);
diff --git a/dist/Mesa/src/glsl/tests/builtin_variable_test.cpp b/dist/Mesa/src/glsl/tests/builtin_variable_test.cpp
index 11e384a07..3fdfce57d 100644
--- a/dist/Mesa/src/glsl/tests/builtin_variable_test.cpp
+++ b/dist/Mesa/src/glsl/tests/builtin_variable_test.cpp
@@ -25,6 +25,7 @@
#include "main/compiler.h"
#include "main/mtypes.h"
#include "main/macros.h"
+#include "ralloc.h"
#include "ir.h"
#include "glsl_parser_extras.h"
#include "glsl_symbol_table.h"
@@ -97,8 +98,8 @@ common_builtin::string_starts_with_prefix(const char *str, const char *prefix)
void
common_builtin::names_start_with_gl()
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
string_starts_with_prefix(var->name, "gl_");
}
@@ -107,8 +108,8 @@ common_builtin::names_start_with_gl()
void
common_builtin::uniforms_and_system_values_dont_have_explicit_location()
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_uniform && var->data.mode != ir_var_system_value)
continue;
@@ -121,8 +122,8 @@ common_builtin::uniforms_and_system_values_dont_have_explicit_location()
void
common_builtin::constants_are_constant()
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_auto)
continue;
@@ -136,8 +137,8 @@ common_builtin::constants_are_constant()
void
common_builtin::no_invalid_variable_modes()
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
switch (var->data.mode) {
case ir_var_auto:
@@ -173,8 +174,8 @@ TEST_F(vertex_builtin, names_start_with_gl)
TEST_F(vertex_builtin, inputs_have_explicit_location)
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_shader_in)
continue;
@@ -188,8 +189,8 @@ TEST_F(vertex_builtin, inputs_have_explicit_location)
TEST_F(vertex_builtin, outputs_have_explicit_location)
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_shader_out)
continue;
@@ -241,8 +242,8 @@ TEST_F(fragment_builtin, names_start_with_gl)
TEST_F(fragment_builtin, inputs_have_explicit_location)
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_shader_in)
continue;
@@ -261,8 +262,8 @@ TEST_F(fragment_builtin, inputs_have_explicit_location)
TEST_F(fragment_builtin, outputs_have_explicit_location)
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_shader_out)
continue;
@@ -312,8 +313,8 @@ TEST_F(geometry_builtin, names_start_with_gl)
TEST_F(geometry_builtin, inputs_have_explicit_location)
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_shader_in)
continue;
@@ -358,8 +359,8 @@ TEST_F(geometry_builtin, inputs_have_explicit_location)
TEST_F(geometry_builtin, outputs_have_explicit_location)
{
- foreach_in_list(ir_instruction, node, &this->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, &this->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var->data.mode != ir_var_shader_out)
continue;
diff --git a/dist/Mesa/src/glsl/tests/copy_constant_to_storage_tests.cpp b/dist/Mesa/src/glsl/tests/copy_constant_to_storage_tests.cpp
index acf2789f2..6ab20841e 100644
--- a/dist/Mesa/src/glsl/tests/copy_constant_to_storage_tests.cpp
+++ b/dist/Mesa/src/glsl/tests/copy_constant_to_storage_tests.cpp
@@ -24,7 +24,7 @@
#include "main/compiler.h"
#include "main/mtypes.h"
#include "main/macros.h"
-#include "util/ralloc.h"
+#include "ralloc.h"
#include "uniform_initializer_utils.h"
namespace linker {
@@ -32,8 +32,7 @@ extern void
copy_constant_to_storage(union gl_constant_value *storage,
const ir_constant *val,
const enum glsl_base_type base_type,
- const unsigned int elements,
- unsigned int boolean_true);
+ const unsigned int elements);
}
class copy_constant_to_storage : public ::testing::Test {
@@ -78,10 +77,9 @@ copy_constant_to_storage::int_test(unsigned rows)
linker::copy_constant_to_storage(storage,
val,
val->type->base_type,
- val->type->components(),
- 0xF00F);
+ val->type->components());
- verify_data(storage, 0, val, red_zone_size, 0xF00F);
+ verify_data(storage, 0, val, red_zone_size);
}
void
@@ -98,10 +96,9 @@ copy_constant_to_storage::uint_test(unsigned rows)
linker::copy_constant_to_storage(storage,
val,
val->type->base_type,
- val->type->components(),
- 0xF00F);
+ val->type->components());
- verify_data(storage, 0, val, red_zone_size, 0xF00F);
+ verify_data(storage, 0, val, red_zone_size);
}
void
@@ -118,10 +115,9 @@ copy_constant_to_storage::float_test(unsigned columns, unsigned rows)
linker::copy_constant_to_storage(storage,
val,
val->type->base_type,
- val->type->components(),
- 0xF00F);
+ val->type->components());
- verify_data(storage, 0, val, red_zone_size, 0xF00F);
+ verify_data(storage, 0, val, red_zone_size);
}
void
@@ -138,10 +134,9 @@ copy_constant_to_storage::bool_test(unsigned rows)
linker::copy_constant_to_storage(storage,
val,
val->type->base_type,
- val->type->components(),
- 0xF00F);
+ val->type->components());
- verify_data(storage, 0, val, red_zone_size, 0xF00F);
+ verify_data(storage, 0, val, red_zone_size);
}
/**
@@ -163,10 +158,9 @@ copy_constant_to_storage::sampler_test(void)
linker::copy_constant_to_storage(storage,
val,
GLSL_TYPE_SAMPLER,
- val->type->components(),
- 0xF00F);
+ val->type->components());
- verify_data(storage, 0, val, red_zone_size, 0xF00F);
+ verify_data(storage, 0, val, red_zone_size);
}
TEST_F(copy_constant_to_storage, bool_uniform)
diff --git a/dist/Mesa/src/glsl/tests/general_ir_test.cpp b/dist/Mesa/src/glsl/tests/general_ir_test.cpp
index 882642d14..862fa19ab 100644
--- a/dist/Mesa/src/glsl/tests/general_ir_test.cpp
+++ b/dist/Mesa/src/glsl/tests/general_ir_test.cpp
@@ -24,6 +24,7 @@
#include "main/compiler.h"
#include "main/mtypes.h"
#include "main/macros.h"
+#include "ralloc.h"
#include "ir.h"
TEST(ir_variable_constructor, interface)
diff --git a/dist/Mesa/src/glsl/tests/invalidate_locations_test.cpp b/dist/Mesa/src/glsl/tests/invalidate_locations_test.cpp
index ba94d7e3a..997592fc9 100644
--- a/dist/Mesa/src/glsl/tests/invalidate_locations_test.cpp
+++ b/dist/Mesa/src/glsl/tests/invalidate_locations_test.cpp
@@ -24,7 +24,7 @@
#include "main/compiler.h"
#include "main/mtypes.h"
#include "main/macros.h"
-#include "util/ralloc.h"
+#include "ralloc.h"
#include "ir.h"
#include "linker.h"
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/create_test_cases.py b/dist/Mesa/src/glsl/tests/lower_jumps/create_test_cases.py
index 3be1079bc..9974681e0 100644
--- a/dist/Mesa/src/glsl/tests/lower_jumps/create_test_cases.py
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/create_test_cases.py
@@ -126,7 +126,7 @@ def loop(statements):
body.
"""
check_sexp(statements)
- return [['loop', statements]]
+ return [['loop', [], [], [], [], statements]]
def declare_temp(var_type, var_name):
"""Create a declaration of the form
diff --git a/dist/Mesa/src/glsl/tests/optimization-test b/dist/Mesa/src/glsl/tests/optimization-test
index 26a51be69..8ca777691 100755
--- a/dist/Mesa/src/glsl/tests/optimization-test
+++ b/dist/Mesa/src/glsl/tests/optimization-test
@@ -9,14 +9,6 @@ fi
total=0
pass=0
-echo "====== Generating tests ======"
-for dir in tests/*/; do
- if [ -e "${dir}create_test_cases.py" ]; then
- cd $dir; $PYTHON2 create_test_cases.py; cd ..
- fi
- echo "$dir"
-done
-
echo "====== Testing optimization passes ======"
for test in `find . -iname '*.opt_test'`; do
echo -n "Testing $test..."
diff --git a/dist/Mesa/src/glsl/tests/sampler_types_test.cpp b/dist/Mesa/src/glsl/tests/sampler_types_test.cpp
index 04dd65e6e..86d329a83 100644
--- a/dist/Mesa/src/glsl/tests/sampler_types_test.cpp
+++ b/dist/Mesa/src/glsl/tests/sampler_types_test.cpp
@@ -24,6 +24,7 @@
#include "main/compiler.h"
#include "main/mtypes.h"
#include "main/macros.h"
+#include "ralloc.h"
#include "ir.h"
/**
diff --git a/dist/Mesa/src/glsl/tests/set_uniform_initializer_tests.cpp b/dist/Mesa/src/glsl/tests/set_uniform_initializer_tests.cpp
index d3fdeb3a8..be202b3d5 100644
--- a/dist/Mesa/src/glsl/tests/set_uniform_initializer_tests.cpp
+++ b/dist/Mesa/src/glsl/tests/set_uniform_initializer_tests.cpp
@@ -24,14 +24,14 @@
#include "main/compiler.h"
#include "main/mtypes.h"
#include "main/macros.h"
-#include "util/ralloc.h"
+#include "ralloc.h"
#include "uniform_initializer_utils.h"
namespace linker {
extern void
set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
const char *name, const glsl_type *type,
- ir_constant *val, unsigned int boolean_true);
+ ir_constant *val);
}
class set_uniform_initializer : public ::testing::Test {
@@ -179,11 +179,11 @@ non_array_test(void *mem_ctx, struct gl_shader_program *prog,
ir_constant *val;
generate_data(mem_ctx, base_type, columns, rows, val);
- linker::set_uniform_initializer(mem_ctx, prog, name, type, val, 0xF00F);
+ linker::set_uniform_initializer(mem_ctx, prog, name, type, val);
verify_initialization(prog, actual_index);
verify_data(prog->UniformStorage[actual_index].storage, 0, val,
- red_zone_components, 0xF00F);
+ red_zone_components);
}
TEST_F(set_uniform_initializer, int_uniform)
@@ -335,12 +335,11 @@ array_test(void *mem_ctx, struct gl_shader_program *prog,
generate_array_data(mem_ctx, base_type, columns, rows,
array_size + excess_data_size, val);
- linker::set_uniform_initializer(mem_ctx, prog, name, element_type, val,
- 0xF00F);
+ linker::set_uniform_initializer(mem_ctx, prog, name, element_type, val);
verify_initialization(prog, actual_index);
verify_data(prog->UniformStorage[actual_index].storage, array_size,
- val, red_zone_components, 0xF00F);
+ val, red_zone_components);
}
TEST_F(set_uniform_initializer, int_array_uniform)
diff --git a/dist/Mesa/src/glsl/tests/uniform_initializer_utils.cpp b/dist/Mesa/src/glsl/tests/uniform_initializer_utils.cpp
index 6f47acd4c..5e86c2432 100644
--- a/dist/Mesa/src/glsl/tests/uniform_initializer_utils.cpp
+++ b/dist/Mesa/src/glsl/tests/uniform_initializer_utils.cpp
@@ -23,7 +23,7 @@
#include <gtest/gtest.h>
#include "main/mtypes.h"
#include "main/macros.h"
-#include "util/ralloc.h"
+#include "ralloc.h"
#include "uniform_initializer_utils.h"
#include <stdio.h>
@@ -187,15 +187,14 @@ generate_array_data(void *mem_ctx, enum glsl_base_type base_type,
*/
void
verify_data(gl_constant_value *storage, unsigned storage_array_size,
- ir_constant *val, unsigned red_zone_size,
- unsigned int boolean_true)
+ ir_constant *val, unsigned red_zone_size)
{
if (val->type->base_type == GLSL_TYPE_ARRAY) {
const glsl_type *const element_type = val->array_elements[0]->type;
for (unsigned i = 0; i < storage_array_size; i++) {
verify_data(storage + (i * element_type->components()), 0,
- val->array_elements[i], 0, boolean_true);
+ val->array_elements[i], 0);
}
const unsigned components = element_type->components();
@@ -218,7 +217,7 @@ verify_data(gl_constant_value *storage, unsigned storage_array_size,
EXPECT_EQ(val->value.f[i], storage[i].f);
break;
case GLSL_TYPE_BOOL:
- EXPECT_EQ(val->value.b[i] ? boolean_true : 0, storage[i].i);
+ EXPECT_EQ(int(val->value.b[i]), storage[i].i);
break;
case GLSL_TYPE_ATOMIC_UINT:
case GLSL_TYPE_STRUCT:
diff --git a/dist/Mesa/src/glsl/tests/uniform_initializer_utils.h b/dist/Mesa/src/glsl/tests/uniform_initializer_utils.h
index b4d0c1022..f8c06d29c 100644
--- a/dist/Mesa/src/glsl/tests/uniform_initializer_utils.h
+++ b/dist/Mesa/src/glsl/tests/uniform_initializer_utils.h
@@ -44,5 +44,4 @@ generate_array_data(void *mem_ctx, enum glsl_base_type base_type,
extern void
verify_data(gl_constant_value *storage, unsigned storage_array_size,
- ir_constant *val, unsigned red_zone_size,
- unsigned int boolean_true);
+ ir_constant *val, unsigned red_zone_size);
diff --git a/dist/Mesa/src/glsl/tests/varyings_test.cpp b/dist/Mesa/src/glsl/tests/varyings_test.cpp
index 4573529f6..662fc0e40 100644
--- a/dist/Mesa/src/glsl/tests/varyings_test.cpp
+++ b/dist/Mesa/src/glsl/tests/varyings_test.cpp
@@ -24,7 +24,7 @@
#include "main/compiler.h"
#include "main/mtypes.h"
#include "main/macros.h"
-#include "util/ralloc.h"
+#include "ralloc.h"
#include "ir.h"
#include "program/hash_table.h"