glsl: Use the generated constant expression code

Immediately previous to this patch,

    diff -wud src/glsl/ir_constant_expression.cpp \
              src/glsl/ir_expression_operation_constant.h

should be "minimal."

v3: With much help from José Fonseca, fix the SCons build.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Ian Romanick
2016-07-12 16:42:36 -07:00
parent f3fcfe001f
commit ee3cdac785
4 changed files with 14 additions and 1109 deletions

View File

@@ -201,6 +201,10 @@ glsl/ir_expression_operation.h: glsl/ir_expression_operation.py
$(MKDIR_GEN) $(MKDIR_GEN)
$(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py enum > $@ || ($(RM) $@; false) $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py enum > $@ || ($(RM) $@; false)
glsl/ir_expression_operation_constant.h: glsl/ir_expression_operation.py
$(MKDIR_GEN)
$(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py constant > $@ || ($(RM) $@; false)
glsl/ir_expression_operation_strings.h: glsl/ir_expression_operation.py glsl/ir_expression_operation_strings.h: glsl/ir_expression_operation.py
$(MKDIR_GEN) $(MKDIR_GEN)
$(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py strings > $@ || ($(RM) $@; false) $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py strings > $@ || ($(RM) $@; false)
@@ -215,6 +219,7 @@ BUILT_SOURCES += \
glsl/glsl_parser.cpp \ glsl/glsl_parser.cpp \
glsl/glsl_lexer.cpp \ glsl/glsl_lexer.cpp \
glsl/ir_expression_operation.h \ glsl/ir_expression_operation.h \
glsl/ir_expression_operation_constant.h \
glsl/ir_expression_operation_strings.h \ glsl/ir_expression_operation_strings.h \
glsl/glcpp/glcpp-parse.c \ glsl/glcpp/glcpp-parse.c \
glsl/glcpp/glcpp-lex.c glsl/glcpp/glcpp-lex.c
@@ -224,6 +229,7 @@ CLEANFILES += \
glsl/glsl_parser.cpp \ glsl/glsl_parser.cpp \
glsl/glsl_lexer.cpp \ glsl/glsl_lexer.cpp \
glsl/ir_expression_operation.h \ glsl/ir_expression_operation.h \
glsl/ir_expression_operation_constant.h \
glsl/ir_expression_operation_strings.h \ glsl/ir_expression_operation_strings.h \
glsl/glcpp/glcpp-parse.c \ glsl/glcpp/glcpp-parse.c \
glsl/glcpp/glcpp-lex.c glsl/glcpp/glcpp-lex.c

View File

@@ -147,6 +147,7 @@ GLSL_COMPILER_CXX_FILES = \
# libglsl generated sources # libglsl generated sources
LIBGLSL_GENERATED_FILES = \ LIBGLSL_GENERATED_FILES = \
glsl/ir_expression_operation.h \ glsl/ir_expression_operation.h \
glsl/ir_expression_operation_constant.h \
glsl/ir_expression_operation_strings.h \ glsl/ir_expression_operation_strings.h \
glsl/glsl_lexer.cpp \ glsl/glsl_lexer.cpp \
glsl/glsl_parser.cpp \ glsl/glsl_parser.cpp \

View File

@@ -124,7 +124,12 @@ env.CodeGenerate(
source = [], source = [],
command = python_cmd + ' $SCRIPT enum > $TARGET' command = python_cmd + ' $SCRIPT enum > $TARGET'
) )
env.CodeGenerate(
target = 'glsl/ir_expression_operation_constant.h',
script = 'glsl/ir_expression_operation.py',
source = [],
command = python_cmd + ' $SCRIPT constant > $TARGET'
)
env.CodeGenerate( env.CodeGenerate(
target = 'glsl/ir_expression_operation_strings.h', target = 'glsl/ir_expression_operation_strings.h',
script = 'glsl/ir_expression_operation.py', script = 'glsl/ir_expression_operation.py',

File diff suppressed because it is too large Load Diff