pan: Add a central libpanfrost_compiler library

The only thing that only pulls in bifrost is our CL compiler for
pre-builts.  Everything that uses pan_shader.h pulls it in because
that's header-only and calls into both back-ends anyway.  Some day
we might want to figure out how to properly dead-code the midgard
compiler for Vulkan but today is not that day.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38753>
This commit is contained in:
Faith Ekstrand
2025-12-01 10:15:28 -05:00
committed by Marge Bot
parent 013c94458e
commit 4c9ec8fad2
10 changed files with 20 additions and 22 deletions
+1 -1
View File
@@ -83,5 +83,5 @@ libpanfrost = static_library(
driver_panfrost = declare_dependency(
compile_args : compile_args_panfrost,
link_with : [libpanfrost, libpanfrostwinsys, libpanfrost_shared, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_decode, libpanfrost_lib],
link_with : [libpanfrost, libpanfrostwinsys, libpanfrost_shared, libpanfrost_compiler, libpanfrost_decode, libpanfrost_lib],
)
+1 -1
View File
@@ -9,7 +9,7 @@ else
prog_panfrost_compile = executable(
'panfrost_compile',
['pan_compile.c'],
link_with : [libpanfrost_bifrost],
link_with : [libpanfrost_compiler],
include_directories : [inc_include, inc_src],
c_args : [c_msvc_compat_args, no_override_init_args],
link_args : [ld_args_build_id],
@@ -135,7 +135,6 @@ libpanfrost_bifrost_disasm = static_library(
['bifrost/disassemble.c', 'bi_print_common.c', bifrost_gen_disasm_c],
include_directories : [inc_include, inc_src],
dependencies: [idep_nir],
link_with: [libpanfrost_util],
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
@@ -151,8 +150,3 @@ libpanfrost_bifrost = static_library(
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
if with_tests
subdir('test')
subdir('valhall/test')
endif
@@ -19,7 +19,7 @@ test(
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_valhall],
dependencies: [idep_gtest, idep_nir, idep_bi_opcodes_h, idep_bi_builder_h, idep_valhall_enums_h],
link_with : [libpanfrost_bifrost],
link_with : [libpanfrost_compiler],
),
suite : ['panfrost'],
protocol : 'gtest',
@@ -19,7 +19,7 @@ test(
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_valhall],
dependencies: [idep_gtest, idep_nir, idep_bi_opcodes_h, idep_bi_builder_h, idep_valhall_enums_h],
link_with : [libpanfrost_bifrost],
link_with : [libpanfrost_compiler],
),
suite : ['panfrost'],
protocol : 'gtest',
+12 -6
View File
@@ -1,7 +1,7 @@
# Copyright © 2025 Collabora, Ltd.
# SPDX-License-Identifier: MIT
libpanfrost_util_files = files(
libpanfrost_compiler_files = files(
'pan_ir.c',
'pan_ir.h',
'pan_nir_collect_varyings.c',
@@ -18,15 +18,21 @@ libpanfrost_util_files = files(
'pan_nir_lower_xfb.c',
)
libpanfrost_util = static_library(
'panfrost_util',
[libpanfrost_util_files],
subdir('bifrost')
subdir('midgard')
libpanfrost_compiler = static_library(
'panfrost_compiler',
[libpanfrost_compiler_files],
include_directories : [inc_include, inc_src],
dependencies: [idep_nir, idep_mesautil],
link_with: [libpanfrost_midgard, libpanfrost_bifrost],
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
subdir('bifrost')
subdir('midgard')
if with_tests
subdir('bifrost/test')
subdir('bifrost/valhall/test')
endif
+1 -1
View File
@@ -55,7 +55,7 @@ libpanfrost_midgard = static_library(
idep_nir,
idep_mesautil,
],
link_with: [libpanfrost_util, libpanfrost_midgard_disasm],
link_with: [libpanfrost_midgard_disasm],
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
+1 -1
View File
@@ -66,7 +66,7 @@ libpanfrost_lib = static_library(
)
libpanfrost_dep = declare_dependency(
link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_pixel_format, libpanfrost_per_arch],
link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_compiler, libpanfrost_pixel_format, libpanfrost_per_arch],
include_directories: [inc_include, inc_src, inc_panfrost],
dependencies: [deps_for_libpanfrost, libpankmod_dep, idep_nir],
)
+1 -1
View File
@@ -44,7 +44,7 @@ bifrost_compiler = executable(
dep_libdrm,
],
link_with : [
libpanfrost_bifrost,
libpanfrost_compiler,
],
build_by_default : with_tools.contains('panfrost')
)
+1 -3
View File
@@ -196,11 +196,9 @@ libvulkan_panfrost = shared_library(
link_whole : [panvk_per_arch_libs],
link_with : [
libpanfrost_shared,
libpanfrost_midgard,
libpanfrost_bifrost,
libpanfrost_decode,
libpanfrost_lib,
libpanfrost_util,
libpanfrost_compiler,
],
dependencies : [
dep_dl,