[Mesa-dev] [PATCH 14/16] android: add inital NIR build

Chih-Wei Huang cwhuang at android-x86.org
Wed Apr 1 20:55:23 PDT 2015


2015-03-29 4:54 GMT+08:00 Emil Velikov <emil.l.velikov at gmail.com>:
> From: Mauro Rossi <issor.oruam at gmail.com>
>
> Required by the i965 driver.
>
> Cc: "10.5" <mesa-stable at lists.freedesktop.org>
> [Emil Velikov: Split from a larger commit]
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  src/glsl/Android.gen.mk         | 62 +++++++++++++++++++++++++++++++++++++++--
>  src/glsl/Android.mk             |  3 +-
>  src/mesa/drivers/dri/Android.mk |  1 +
>  3 files changed, 63 insertions(+), 3 deletions(-)
>
> diff --git a/src/glsl/Android.gen.mk b/src/glsl/Android.gen.mk
> index 7ec56d4..82f2bf1 100644
> --- a/src/glsl/Android.gen.mk
> +++ b/src/glsl/Android.gen.mk
> @@ -33,11 +33,21 @@ sources := \
>         glsl_lexer.cpp \
>         glsl_parser.cpp \
>         glcpp/glcpp-lex.c \
> -       glcpp/glcpp-parse.c
> +       glcpp/glcpp-parse.c \
> +       nir/nir_builder_opcodes.h \
> +       nir/nir_constant_expressions.c \
> +       nir/nir_opcodes.c \
> +       nir/nir_opcodes.h \
> +       nir/nir_opt_algebraic.c
>
>  LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES))
>
> -LOCAL_C_INCLUDES += $(intermediates) $(intermediates)/glcpp $(MESA_TOP)/src/glsl/glcpp
> +LOCAL_C_INCLUDES += \
> +       $(intermediates) \
> +       $(intermediates)/glcpp \
> +       $(intermediates)/nir \
> +       $(MESA_TOP)/src/glsl/glcpp \
> +       $(MESA_TOP)/src/glsl/nir
>
>  sources := $(addprefix $(intermediates)/, $(sources))
>  LOCAL_GENERATED_SOURCES += $(sources)
> @@ -77,3 +87,51 @@ $(intermediates)/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glcpp/glcpp-lex.l
>
>  $(intermediates)/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glcpp/glcpp-parse.y
>         $(call glsl_local-y-to-c-and-h)
> +
> +nir_builder_opcodes_gen := $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
> +nir_builder_opcodes_deps := \
> +       $(LOCAL_PATH)/nir/nir_opcodes.py \
> +       $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
> +
> +$(intermediates)/nir/nir_builder_opcodes.h: $(nir_builder_opcodes_deps)
> +       @mkdir -p $(dir $@)

            @mkdir -p $(@D)

> +       @$(MESA_PYTHON2) $(nir_builder_opcodes_gen) $< > $@

            Use $(hide) instead of @

> +
> +nir_constant_expressions_gen := $(LOCAL_PATH)/nir/nir_constant_expressions.py
> +nir_constant_expressions_deps := \
> +       $(LOCAL_PATH)/nir/nir_opcodes.py \
> +       $(LOCAL_PATH)/nir/nir_constant_expressions.py \
> +       $(LOCAL_PATH)/nir/nir_constant_expressions.h
> +
> +$(intermediates)/nir/nir_constant_expressions.c: $(nir_constant_expressions_deps)
> +       @mkdir -p $(dir $@)
> +       @$(MESA_PYTHON2) $(nir_constant_expressions_gen) $< > $@

            Use $(hide) instead of @

> +
> +nir_opcodes_h_gen := $(LOCAL_PATH)/nir/nir_opcodes_h.py
> +nir_opcodes_h_deps := \
> +       $(LOCAL_PATH)/nir/nir_opcodes.py \
> +       $(LOCAL_PATH)/nir/nir_opcodes_h.py
> +
> +$(intermediates)/nir/nir_opcodes.h: $(nir_opcodes_h_deps)
> +       @mkdir -p $(dir $@)
> +       @$(MESA_PYTHON2) $(nir_opcodes_h_gen) $< > $@

            Use $(hide) instead of @

> +
> +$(LOCAL_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
> +
> +nir_opcodes_c_gen := $(LOCAL_PATH)/nir/nir_opcodes_c.py
> +nir_opcodes_c_deps := \
> +       $(LOCAL_PATH)/nir/nir_opcodes.py \
> +       $(LOCAL_PATH)/nir/nir_opcodes_c.py
> +
> +$(intermediates)/nir/nir_opcodes.c: $(nir_opcodes_c_deps)
> +       @mkdir -p $(dir $@)
> +       @$(MESA_PYTHON2) $(nir_opcodes_c_gen) $< > $@

            Use $(hide) instead of @

> +
> +nir_opt_algebraic_gen := $(LOCAL_PATH)/nir/nir_opt_algebraic.py
> +nir_opt_algebraic_deps := \
> +       $(LOCAL_PATH)/nir/nir_opt_algebraic.py \
> +       $(LOCAL_PATH)/nir/nir_algebraic.py
> +
> +$(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps)
> +       @mkdir -p $(dir $@)
> +       @$(MESA_PYTHON2) $(nir_opt_algebraic_gen) $< > $@

            Use $(hide) instead of @

> diff --git a/src/glsl/Android.mk b/src/glsl/Android.mk
> index 356f44e..f20741e 100644
> --- a/src/glsl/Android.mk
> +++ b/src/glsl/Android.mk
> @@ -35,7 +35,8 @@ include $(CLEAR_VARS)
>
>  LOCAL_SRC_FILES := \
>         $(LIBGLCPP_FILES) \
> -       $(LIBGLSL_FILES)
> +       $(LIBGLSL_FILES) \
> +       $(NIR_FILES)
>
>  LOCAL_C_INCLUDES := \
>         $(MESA_TOP)/src/mapi \
> diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk
> index 64e237b..764cd5a 100644
> --- a/src/mesa/drivers/dri/Android.mk
> +++ b/src/mesa/drivers/dri/Android.mk
> @@ -36,6 +36,7 @@ MESA_DRI_CFLAGS := \
>
>  MESA_DRI_C_INCLUDES := \
>         $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_dri_common) \
> +       $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_glsl)/nir \

I prefer this hunk be replaced by a more simpler solution:

diff --git a/src/glsl/Android.gen.mk b/src/glsl/Android.gen.mk
index 82f2bf1..cc2e633 100644
--- a/src/glsl/Android.gen.mk
+++ b/src/glsl/Android.gen.mk
@@ -49,6 +49,9 @@ LOCAL_C_INCLUDES += \
        $(MESA_TOP)/src/glsl/glcpp \
        $(MESA_TOP)/src/glsl/nir

+LOCAL_EXPORT_C_INCLUDE_DIRS += \
+       $(intermediates)/nir
+
 sources := $(addprefix $(intermediates)/, $(sources))
 LOCAL_GENERATED_SOURCES += $(sources)

This is also useful to fix the build error of libmesa_program.
(seems you didn't address this issue in these patches?)


>         $(addprefix $(MESA_TOP)/, $(mesa_dri_common_INCLUDES)) \
>         $(MESA_TOP)/src/gallium/include \
>         $(MESA_TOP)/src/gallium/auxiliary \


-- 
Chih-Wei
Android-x86 project
http://www.android-x86.org


More information about the mesa-dev mailing list