diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-01-30 01:11:31 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-02-05 01:26:28 +0000 |
commit | e67e0726372ab65f410411e607701be4673ff6ef (patch) | |
tree | 039d895a9740c272b45aafd3e0c87914ca733262 /src/gallium/drivers/panfrost/meson.build | |
parent | 61d3ae6e0bde93c5601278d1a60c44be655a7cb5 (diff) |
panfrost: Implement Midgard shader toolchain
This patch implements the free Midgard shader toolchain: the assembler,
the disassembler, and the NIR-based compiler. The assembler is a
standalone inaccessible Python script for reference purposes. The
disassembler and the compiler are implemented in C, accessible via the
standalone `midgard_compiler` binary. Later patches will use these
interfaces from the driver for online compilation.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Acked-by: Rob Clark <[email protected]>
Acked-by: Eric Anholt <[email protected]>
Acked-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/meson.build')
-rw-r--r-- | src/gallium/drivers/panfrost/meson.build | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/meson.build b/src/gallium/drivers/panfrost/meson.build index fdf66c02138..f4dec42ad3e 100644 --- a/src/gallium/drivers/panfrost/meson.build +++ b/src/gallium/drivers/panfrost/meson.build @@ -23,6 +23,10 @@ files_panfrost = files( 'pan_public.h', 'pan_screen.c', 'pan_screen.h', + + 'midgard/midgard_compile.c', + 'midgard/cppwrap.cpp', + 'midgard/disassemble.c', ) inc_panfrost = [ @@ -32,12 +36,25 @@ inc_panfrost = [ inc_drm_uapi, inc_include, inc_src, - include_directories('include') + include_directories('include'), + include_directories('midgard'), ] +midgard_nir_algebraic_c = custom_target( + 'midgard_nir_algebraic.c', + input : 'midgard/midgard_nir_algebraic.py', + output : 'midgard_nir_algebraic.c', + command : [ + prog_python, '@INPUT@', + '-p', join_paths(meson.source_root(), 'src/compiler/nir/'), + ], + capture : true, + depend_files : nir_algebraic_py, +) + libpanfrost = static_library( 'panfrost', - [files_panfrost], + [files_panfrost, midgard_nir_algebraic_c], dependencies: [ dep_thread, idep_nir @@ -50,3 +67,26 @@ driver_panfrost = declare_dependency( compile_args : ['-DGALLIUM_PANFROST', '-Wno-pointer-arith'], link_with : [libpanfrost, libpanfrostwinsys], ) + +files_midgard = files( + 'midgard/midgard_compile.c', + 'midgard/cppwrap.cpp', + 'midgard/disassemble.c', + 'midgard/cmdline.c', +) + +midgard_compiler = executable( + 'midgard_compiler', + [files_midgard, midgard_nir_algebraic_c], + include_directories : inc_panfrost, + dependencies : [ + dep_thread, + idep_nir + ], + link_with : [ + libgallium, + libglsl_standalone, + libmesa_util + ], + build_by_default : true +) |