Mesa (main): vulkan: Move all the common object code to runtime/

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 29 23:37:09 UTC 2021


Module: Mesa
Branch: main
Commit: 4108fda4268943a52cffc6627b598638763b88c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4108fda4268943a52cffc6627b598638763b88c9

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Oct  1 16:45:44 2021 -0500

vulkan: Move all the common object code to runtime/

Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>

---

 src/amd/vulkan/meson.build                         |   2 +-
 src/amd/vulkan/radv_descriptor_set.h               |   2 +-
 src/amd/vulkan/radv_shader.h                       |   4 +-
 src/broadcom/vulkan/meson.build                    |   1 +
 src/broadcom/vulkan/v3dv_meta_copy.c               |   2 +-
 src/freedreno/vulkan/meson.build                   |   1 +
 src/gallium/frontends/lavapipe/meson.build         |   3 +-
 src/intel/vulkan/meson.build                       |   8 +-
 src/panfrost/vulkan/meson.build                    |   2 +
 src/virtio/vulkan/meson.build                      |   1 +
 src/vulkan/meson.build                             |   1 +
 src/vulkan/runtime/meson.build                     | 135 +++++++++++++++++++++
 src/vulkan/{util => runtime}/vk_cmd_copy.c         |   0
 src/vulkan/{util => runtime}/vk_command_buffer.c   |   0
 src/vulkan/{util => runtime}/vk_command_buffer.h   |   0
 src/vulkan/{util => runtime}/vk_debug_report.c     |   0
 src/vulkan/{util => runtime}/vk_debug_report.h     |   0
 src/vulkan/{util => runtime}/vk_debug_utils.c      |   0
 src/vulkan/{util => runtime}/vk_debug_utils.h      |   0
 .../{util => runtime}/vk_deferred_operation.c      |   0
 .../{util => runtime}/vk_deferred_operation.h      |   0
 src/vulkan/{util => runtime}/vk_descriptors.c      |   0
 src/vulkan/{util => runtime}/vk_descriptors.h      |   0
 src/vulkan/{util => runtime}/vk_device.c           |   0
 src/vulkan/{util => runtime}/vk_device.h           |   0
 src/vulkan/{util => runtime}/vk_image.c            |   0
 src/vulkan/{util => runtime}/vk_image.h            |   0
 src/vulkan/{util => runtime}/vk_instance.c         |   0
 src/vulkan/{util => runtime}/vk_instance.h         |   0
 src/vulkan/{util => runtime}/vk_log.c              |   0
 src/vulkan/{util => runtime}/vk_log.h              |   0
 src/vulkan/{util => runtime}/vk_object.c           |   0
 src/vulkan/{util => runtime}/vk_object.h           |   0
 src/vulkan/{util => runtime}/vk_physical_device.c  |   0
 src/vulkan/{util => runtime}/vk_physical_device.h  |   0
 .../vk_physical_device_features.py                 |   0
 src/vulkan/{util => runtime}/vk_queue.c            |   0
 src/vulkan/{util => runtime}/vk_queue.h            |   0
 src/vulkan/{util => runtime}/vk_render_pass.c      |   0
 src/vulkan/{util => runtime}/vk_shader_module.c    |   0
 src/vulkan/{util => runtime}/vk_shader_module.h    |   0
 src/vulkan/{util => runtime}/vk_synchronization2.c |   0
 src/vulkan/util/meson.build                        | 106 ++--------------
 src/vulkan/wsi/meson.build                         |   3 +-
 src/vulkan/wsi/wsi_common_private.h                |   2 +-
 45 files changed, 165 insertions(+), 108 deletions(-)

diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build
index 1d09248036c..8c8a14de684 100644
--- a/src/amd/vulkan/meson.build
+++ b/src/amd/vulkan/meson.build
@@ -157,7 +157,7 @@ libvulkan_radeon = shared_library(
     dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
     dep_valgrind, radv_deps, idep_aco,
     idep_mesautil, idep_nir, idep_vulkan_util, idep_vulkan_wsi,
-    idep_amdgfxregs_h, idep_xmlconfig,
+    idep_vulkan_runtime, idep_amdgfxregs_h, idep_xmlconfig,
   ],
   c_args : [no_override_init_args, radv_flags, c_msvc_compat_args],
   cpp_args : [radv_flags, cpp_msvc_compat_args],
diff --git a/src/amd/vulkan/radv_descriptor_set.h b/src/amd/vulkan/radv_descriptor_set.h
index 5e0ea7eaed4..298c4c62fcb 100644
--- a/src/amd/vulkan/radv_descriptor_set.h
+++ b/src/amd/vulkan/radv_descriptor_set.h
@@ -26,7 +26,7 @@
 
 #include "radv_constants.h"
 
-#include "vulkan/util/vk_object.h"
+#include "vulkan/runtime/vk_object.h"
 
 #include <vulkan/vulkan.h>
 
diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
index 9cabbfc21c1..4ebd488dfb8 100644
--- a/src/amd/vulkan/radv_shader.h
+++ b/src/amd/vulkan/radv_shader.h
@@ -35,8 +35,8 @@
 #include "radv_constants.h"
 
 #include "nir/nir.h"
-#include "vulkan/util/vk_object.h"
-#include "vulkan/util/vk_shader_module.h"
+#include "vulkan/runtime/vk_object.h"
+#include "vulkan/runtime/vk_shader_module.h"
 #include "vulkan/vulkan.h"
 
 #define RADV_VERT_ATTRIB_MAX MAX2(VERT_ATTRIB_MAX, VERT_ATTRIB_GENERIC0 + MAX_VERTEX_ATTRIBS)
diff --git a/src/broadcom/vulkan/meson.build b/src/broadcom/vulkan/meson.build
index 9e0326b6130..bfa7e9f29f2 100644
--- a/src/broadcom/vulkan/meson.build
+++ b/src/broadcom/vulkan/meson.build
@@ -85,6 +85,7 @@ v3dv_deps = [
   idep_nir,
   idep_nir_headers,
   idep_vulkan_util,
+  idep_vulkan_runtime,
   idep_vulkan_wsi,
 ]
 
diff --git a/src/broadcom/vulkan/v3dv_meta_copy.c b/src/broadcom/vulkan/v3dv_meta_copy.c
index b7c29d08223..a3237e82f90 100644
--- a/src/broadcom/vulkan/v3dv_meta_copy.c
+++ b/src/broadcom/vulkan/v3dv_meta_copy.c
@@ -27,7 +27,7 @@
 #include "compiler/nir/nir_builder.h"
 #include "vk_format_info.h"
 #include "util/u_pack_color.h"
-#include "vulkan/util/vk_common_entrypoints.h"
+#include "vulkan/runtime/vk_common_entrypoints.h"
 
 static uint32_t
 meta_blit_key_hash(const void *key)
diff --git a/src/freedreno/vulkan/meson.build b/src/freedreno/vulkan/meson.build
index 9a1a46468e3..07185a93b93 100644
--- a/src/freedreno/vulkan/meson.build
+++ b/src/freedreno/vulkan/meson.build
@@ -142,6 +142,7 @@ libvulkan_freedreno = shared_library(
     idep_nir,
     tu_deps,
     idep_vulkan_util,
+    idep_vulkan_runtime,
     idep_vulkan_wsi,
     idep_mesautil,
   ],
diff --git a/src/gallium/frontends/lavapipe/meson.build b/src/gallium/frontends/lavapipe/meson.build
index 5a6ffeeb4a4..d1c329efa66 100644
--- a/src/gallium/frontends/lavapipe/meson.build
+++ b/src/gallium/frontends/lavapipe/meson.build
@@ -55,5 +55,6 @@ liblavapipe_st = static_library(
   c_args : [ c_msvc_compat_args, lvp_flags ],
   gnu_symbol_visibility : 'hidden',
   include_directories : [ inc_include, inc_src, inc_util, inc_gallium, inc_compiler, inc_gallium_aux ],
-  dependencies : [ idep_nir, idep_mesautil, idep_vulkan_util, idep_vulkan_wsi, lvp_deps ]
+  dependencies : [ idep_nir, idep_mesautil, idep_vulkan_util, idep_vulkan_wsi,
+                   idep_vulkan_runtime, lvp_deps ]
 )
diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build
index 7891fda8a42..6ec5d133870 100644
--- a/src/intel/vulkan/meson.build
+++ b/src/intel/vulkan/meson.build
@@ -77,6 +77,7 @@ foreach g : [['70', ['gfx7_cmd_buffer.c']], ['75', ['gfx7_cmd_buffer.c']],
     dependencies : [
       dep_libdrm, dep_valgrind, idep_nir_headers, idep_genxml,
       idep_vulkan_util_headers, idep_vulkan_wsi_headers,
+      idep_vulkan_runtime_headers,
     ],
   )
 endforeach
@@ -118,6 +119,7 @@ anv_deps = [
   idep_genxml,
   idep_nir_headers,
   idep_vulkan_util_headers,
+  idep_vulkan_runtime_headers,
   idep_vulkan_wsi_headers,
 ]
 anv_flags = [
@@ -175,7 +177,7 @@ libvulkan_intel = shared_library(
   dependencies : [
     dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,
     idep_nir, idep_genxml, idep_vulkan_util, idep_vulkan_wsi,
-    idep_mesautil, idep_xmlconfig,
+    idep_vulkan_runtime, idep_mesautil, idep_xmlconfig,
   ],
   c_args : anv_flags,
   gnu_symbol_visibility : 'hidden',
@@ -210,7 +212,8 @@ if with_tests
     ],
     dependencies : [
       dep_thread, dep_dl, dep_m, anv_deps,
-      idep_nir, idep_vulkan_util, idep_vulkan_wsi, idep_mesautil,
+      idep_nir, idep_vulkan_util, idep_vulkan_wsi, idep_vulkan_runtime,
+      idep_mesautil,
     ],
     c_args : anv_flags,
     gnu_symbol_visibility : 'hidden',
@@ -229,6 +232,7 @@ if with_tests
         dependencies : [
           dep_libdrm, dep_thread, dep_m, dep_valgrind,
           idep_vulkan_util, idep_vulkan_wsi_headers,
+          idep_vulkan_runtime,
         ],
         include_directories : [
           inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
diff --git a/src/panfrost/vulkan/meson.build b/src/panfrost/vulkan/meson.build
index 1b3a57734bc..971ca85101d 100644
--- a/src/panfrost/vulkan/meson.build
+++ b/src/panfrost/vulkan/meson.build
@@ -85,6 +85,7 @@ foreach arch : ['5', '6', '7']
       idep_nir_headers,
       idep_pan_packers,
       idep_vulkan_util_headers,
+      idep_vulkan_runtime_headers,
       idep_vulkan_wsi_headers,
       dep_libdrm,
       dep_valgrind,
@@ -129,6 +130,7 @@ libvulkan_panfrost = shared_library(
     idep_pan_packers,
     panvk_deps,
     idep_vulkan_util,
+    idep_vulkan_runtime,
     idep_vulkan_wsi,
     idep_mesautil,
   ],
diff --git a/src/virtio/vulkan/meson.build b/src/virtio/vulkan/meson.build
index 1d31934f908..fbce2339652 100644
--- a/src/virtio/vulkan/meson.build
+++ b/src/virtio/vulkan/meson.build
@@ -56,6 +56,7 @@ vn_deps = [
   dep_thread,
   idep_mesautil,
   idep_vulkan_util,
+  idep_vulkan_runtime,
   idep_vulkan_wsi,
   idep_xmlconfig,
 ]
diff --git a/src/vulkan/meson.build b/src/vulkan/meson.build
index 65280502295..6384af78297 100644
--- a/src/vulkan/meson.build
+++ b/src/vulkan/meson.build
@@ -55,6 +55,7 @@ endif
 
 
 subdir('util')
+subdir('runtime')
 subdir('wsi')
 if with_vulkan_overlay_layer
   subdir('overlay-layer')
diff --git a/src/vulkan/runtime/meson.build b/src/vulkan/runtime/meson.build
new file mode 100644
index 00000000000..b72846b9824
--- /dev/null
+++ b/src/vulkan/runtime/meson.build
@@ -0,0 +1,135 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+# Mesa-local imports in the Python files must be declared here for correct
+# dependency tracking.
+vk_physical_device_features_gen_depend_files = [
+]
+
+files_vulkan_runtime = files(
+  'vk_cmd_copy.c',
+  'vk_command_buffer.c',
+  'vk_command_buffer.h',
+  'vk_debug_report.c',
+  'vk_debug_report.h',
+  'vk_debug_utils.c',
+  'vk_debug_utils.h',
+  'vk_deferred_operation.c',
+  'vk_deferred_operation.h',
+  'vk_descriptors.c',
+  'vk_descriptors.h',
+  'vk_device.c',
+  'vk_device.h',
+  'vk_image.c',
+  'vk_image.h',
+  'vk_instance.c',
+  'vk_instance.h',
+  'vk_log.c',
+  'vk_log.h',
+  'vk_object.c',
+  'vk_object.h',
+  'vk_physical_device.c',
+  'vk_physical_device.h',
+  'vk_queue.c',
+  'vk_queue.h',
+  'vk_render_pass.c',
+  'vk_shader_module.c',
+  'vk_shader_module.h',
+  'vk_synchronization2.c',
+)
+
+vk_common_entrypoints = custom_target(
+  'vk_common_entrypoints',
+  input : [vk_entrypoints_gen, vk_api_xml],
+  output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],
+  command : [
+    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
+    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',
+  ],
+  depend_files : vk_entrypoints_gen_depend_files,
+)
+
+vk_cmd_queue = custom_target(
+  'vk_cmd_queue',
+  input : [vk_cmd_queue_gen, vk_api_xml],
+  output : ['vk_cmd_queue.c', 'vk_cmd_queue.h'],
+  command : [
+    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
+    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
+  ],
+  depend_files : vk_cmd_queue_gen_depend_files,
+)
+
+vk_dispatch_trampolines = custom_target(
+  'vk_dispatch_trampolines',
+  input : [vk_dispatch_trampolines_gen, vk_api_xml],
+  output : ['vk_dispatch_trampolines.c', 'vk_dispatch_trampolines.h'],
+  command : [
+    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
+    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
+  ],
+  depend_files : vk_dispatch_trampolines_gen_depend_files,
+)
+
+vk_physical_device_features = custom_target(
+  'vk_physical_device_features',
+  input : ['vk_physical_device_features.py', vk_api_xml],
+  output : ['vk_physical_device_features.c'],
+  command : [
+    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
+    '--out-c', '@OUTPUT0@'
+  ],
+  depend_files : vk_physical_device_features_gen_depend_files,
+)
+
+libvulkan_runtime = static_library(
+  'vulkan_runtime',
+  [files_vulkan_runtime, vk_common_entrypoints, vk_cmd_queue,
+   vk_dispatch_trampolines, vk_physical_device_features],
+  include_directories : [inc_include, inc_src, inc_gallium],
+  dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers,
+                  idep_vulkan_util],
+  # For glsl_type_singleton
+  link_with : libcompiler,
+  c_args : [vulkan_wsi_args],
+  gnu_symbol_visibility : 'hidden',
+  build_by_default : false,
+)
+
+idep_vulkan_runtime_headers = declare_dependency(
+  include_directories : include_directories('.')
+)
+
+# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
+# See this discussion here:
+# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506 
+if get_option('backend').startswith('vs')
+  idep_vulkan_runtime = declare_dependency(
+    link_with : libvulkan_runtime,
+    dependencies : idep_vulkan_runtime_headers
+  )
+else
+  idep_vulkan_runtime = declare_dependency(
+    # Instruct users of this library to link with --whole-archive.  Otherwise,
+    # our weak function overloads may not resolve properly.
+    link_whole : libvulkan_runtime,
+    dependencies : idep_vulkan_runtime_headers
+  )
+endif
diff --git a/src/vulkan/util/vk_cmd_copy.c b/src/vulkan/runtime/vk_cmd_copy.c
similarity index 100%
rename from src/vulkan/util/vk_cmd_copy.c
rename to src/vulkan/runtime/vk_cmd_copy.c
diff --git a/src/vulkan/util/vk_command_buffer.c b/src/vulkan/runtime/vk_command_buffer.c
similarity index 100%
rename from src/vulkan/util/vk_command_buffer.c
rename to src/vulkan/runtime/vk_command_buffer.c
diff --git a/src/vulkan/util/vk_command_buffer.h b/src/vulkan/runtime/vk_command_buffer.h
similarity index 100%
rename from src/vulkan/util/vk_command_buffer.h
rename to src/vulkan/runtime/vk_command_buffer.h
diff --git a/src/vulkan/util/vk_debug_report.c b/src/vulkan/runtime/vk_debug_report.c
similarity index 100%
rename from src/vulkan/util/vk_debug_report.c
rename to src/vulkan/runtime/vk_debug_report.c
diff --git a/src/vulkan/util/vk_debug_report.h b/src/vulkan/runtime/vk_debug_report.h
similarity index 100%
rename from src/vulkan/util/vk_debug_report.h
rename to src/vulkan/runtime/vk_debug_report.h
diff --git a/src/vulkan/util/vk_debug_utils.c b/src/vulkan/runtime/vk_debug_utils.c
similarity index 100%
rename from src/vulkan/util/vk_debug_utils.c
rename to src/vulkan/runtime/vk_debug_utils.c
diff --git a/src/vulkan/util/vk_debug_utils.h b/src/vulkan/runtime/vk_debug_utils.h
similarity index 100%
rename from src/vulkan/util/vk_debug_utils.h
rename to src/vulkan/runtime/vk_debug_utils.h
diff --git a/src/vulkan/util/vk_deferred_operation.c b/src/vulkan/runtime/vk_deferred_operation.c
similarity index 100%
rename from src/vulkan/util/vk_deferred_operation.c
rename to src/vulkan/runtime/vk_deferred_operation.c
diff --git a/src/vulkan/util/vk_deferred_operation.h b/src/vulkan/runtime/vk_deferred_operation.h
similarity index 100%
rename from src/vulkan/util/vk_deferred_operation.h
rename to src/vulkan/runtime/vk_deferred_operation.h
diff --git a/src/vulkan/util/vk_descriptors.c b/src/vulkan/runtime/vk_descriptors.c
similarity index 100%
rename from src/vulkan/util/vk_descriptors.c
rename to src/vulkan/runtime/vk_descriptors.c
diff --git a/src/vulkan/util/vk_descriptors.h b/src/vulkan/runtime/vk_descriptors.h
similarity index 100%
rename from src/vulkan/util/vk_descriptors.h
rename to src/vulkan/runtime/vk_descriptors.h
diff --git a/src/vulkan/util/vk_device.c b/src/vulkan/runtime/vk_device.c
similarity index 100%
rename from src/vulkan/util/vk_device.c
rename to src/vulkan/runtime/vk_device.c
diff --git a/src/vulkan/util/vk_device.h b/src/vulkan/runtime/vk_device.h
similarity index 100%
rename from src/vulkan/util/vk_device.h
rename to src/vulkan/runtime/vk_device.h
diff --git a/src/vulkan/util/vk_image.c b/src/vulkan/runtime/vk_image.c
similarity index 100%
rename from src/vulkan/util/vk_image.c
rename to src/vulkan/runtime/vk_image.c
diff --git a/src/vulkan/util/vk_image.h b/src/vulkan/runtime/vk_image.h
similarity index 100%
rename from src/vulkan/util/vk_image.h
rename to src/vulkan/runtime/vk_image.h
diff --git a/src/vulkan/util/vk_instance.c b/src/vulkan/runtime/vk_instance.c
similarity index 100%
rename from src/vulkan/util/vk_instance.c
rename to src/vulkan/runtime/vk_instance.c
diff --git a/src/vulkan/util/vk_instance.h b/src/vulkan/runtime/vk_instance.h
similarity index 100%
rename from src/vulkan/util/vk_instance.h
rename to src/vulkan/runtime/vk_instance.h
diff --git a/src/vulkan/util/vk_log.c b/src/vulkan/runtime/vk_log.c
similarity index 100%
rename from src/vulkan/util/vk_log.c
rename to src/vulkan/runtime/vk_log.c
diff --git a/src/vulkan/util/vk_log.h b/src/vulkan/runtime/vk_log.h
similarity index 100%
rename from src/vulkan/util/vk_log.h
rename to src/vulkan/runtime/vk_log.h
diff --git a/src/vulkan/util/vk_object.c b/src/vulkan/runtime/vk_object.c
similarity index 100%
rename from src/vulkan/util/vk_object.c
rename to src/vulkan/runtime/vk_object.c
diff --git a/src/vulkan/util/vk_object.h b/src/vulkan/runtime/vk_object.h
similarity index 100%
rename from src/vulkan/util/vk_object.h
rename to src/vulkan/runtime/vk_object.h
diff --git a/src/vulkan/util/vk_physical_device.c b/src/vulkan/runtime/vk_physical_device.c
similarity index 100%
rename from src/vulkan/util/vk_physical_device.c
rename to src/vulkan/runtime/vk_physical_device.c
diff --git a/src/vulkan/util/vk_physical_device.h b/src/vulkan/runtime/vk_physical_device.h
similarity index 100%
rename from src/vulkan/util/vk_physical_device.h
rename to src/vulkan/runtime/vk_physical_device.h
diff --git a/src/vulkan/util/vk_physical_device_features.py b/src/vulkan/runtime/vk_physical_device_features.py
similarity index 100%
rename from src/vulkan/util/vk_physical_device_features.py
rename to src/vulkan/runtime/vk_physical_device_features.py
diff --git a/src/vulkan/util/vk_queue.c b/src/vulkan/runtime/vk_queue.c
similarity index 100%
rename from src/vulkan/util/vk_queue.c
rename to src/vulkan/runtime/vk_queue.c
diff --git a/src/vulkan/util/vk_queue.h b/src/vulkan/runtime/vk_queue.h
similarity index 100%
rename from src/vulkan/util/vk_queue.h
rename to src/vulkan/runtime/vk_queue.h
diff --git a/src/vulkan/util/vk_render_pass.c b/src/vulkan/runtime/vk_render_pass.c
similarity index 100%
rename from src/vulkan/util/vk_render_pass.c
rename to src/vulkan/runtime/vk_render_pass.c
diff --git a/src/vulkan/util/vk_shader_module.c b/src/vulkan/runtime/vk_shader_module.c
similarity index 100%
rename from src/vulkan/util/vk_shader_module.c
rename to src/vulkan/runtime/vk_shader_module.c
diff --git a/src/vulkan/util/vk_shader_module.h b/src/vulkan/runtime/vk_shader_module.h
similarity index 100%
rename from src/vulkan/util/vk_shader_module.h
rename to src/vulkan/runtime/vk_shader_module.h
diff --git a/src/vulkan/util/vk_synchronization2.c b/src/vulkan/runtime/vk_synchronization2.c
similarity index 100%
rename from src/vulkan/util/vk_synchronization2.c
rename to src/vulkan/runtime/vk_synchronization2.c
diff --git a/src/vulkan/util/meson.build b/src/vulkan/util/meson.build
index fd90ebbb4ab..ed8e5dd6cc5 100644
--- a/src/vulkan/util/meson.build
+++ b/src/vulkan/util/meson.build
@@ -50,62 +50,22 @@ vk_commands_gen_depend_files = [
   files('vk_entrypoints.py'),
   vk_entrypoints_depend_files,
 ]
-vk_physical_device_features_gen_depend_files = [
-]
 
 vk_entrypoints_gen = files('vk_entrypoints_gen.py')
 vk_extensions_gen = files('vk_extensions_gen.py')
 vk_icd_gen = files('vk_icd_gen.py')
+vk_cmd_queue_gen = files('vk_cmd_queue_gen.py')
 vk_commands_gen = files('vk_commands_gen.py')
+vk_dispatch_trampolines_gen = files('vk_dispatch_trampolines_gen.py')
 
 files_vulkan_util = files(
   'vk_alloc.c',
   'vk_alloc.h',
-  'vk_cmd_copy.c',
-  'vk_command_buffer.c',
-  'vk_command_buffer.h',
-  'vk_debug_report.c',
-  'vk_debug_report.h',
-  'vk_debug_utils.c',
-  'vk_debug_utils.h',
-  'vk_deferred_operation.c',
-  'vk_deferred_operation.h',
-  'vk_descriptors.c',
-  'vk_descriptors.h',
-  'vk_device.c',
-  'vk_device.h',
   'vk_format.c',
-  'vk_image.c',
-  'vk_image.h',
-  'vk_instance.c',
-  'vk_instance.h',
-  'vk_log.c',
-  'vk_log.h',
-  'vk_object.c',
-  'vk_object.h',
-  'vk_physical_device.c',
-  'vk_physical_device.h',
-  'vk_queue.c',
-  'vk_queue.h',
-  'vk_render_pass.c',
-  'vk_shader_module.c',
-  'vk_shader_module.h',
-  'vk_synchronization2.c',
   'vk_util.c',
   'vk_util.h',
 )
 
-vk_common_entrypoints = custom_target(
-  'vk_common_entrypoints',
-  input : [vk_entrypoints_gen, vk_api_xml],
-  output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],
-  command : [
-    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
-    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',
-  ],
-  depend_files : vk_entrypoints_gen_depend_files,
-)
-
 vk_dispatch_table = custom_target(
   'vk_dispatch_table',
   input : ['vk_dispatch_table_gen.py', vk_api_xml],
@@ -117,17 +77,6 @@ vk_dispatch_table = custom_target(
   depend_files : vk_dispatch_table_gen_depend_files,
 )
 
-vk_dispatch_trampolines = custom_target(
-  'vk_dispatch_trampolines',
-  input : ['vk_dispatch_trampolines_gen.py', vk_api_xml],
-  output : ['vk_dispatch_trampolines.c', 'vk_dispatch_trampolines.h'],
-  command : [
-    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
-    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
-  ],
-  depend_files : vk_dispatch_trampolines_gen_depend_files,
-)
-
 vk_enum_to_str = custom_target(
   'vk_enum_to_str',
   input : ['gen_enum_to_str.py', vk_api_xml],
@@ -149,61 +98,22 @@ vk_extensions = custom_target(
   depend_files : vk_extensions_gen_depend_files,
 )
 
-vk_cmd_queue = custom_target(
-  'vk_cmd_queue',
-  input : ['vk_cmd_queue_gen.py', vk_api_xml],
-  output : ['vk_cmd_queue.c', 'vk_cmd_queue.h'],
-  command : [
-    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
-    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
-  ],
-  depend_files : vk_cmd_queue_gen_depend_files,
-)
-
-vk_physical_device_features = custom_target(
-  'vk_physical_device_features',
-  input : ['vk_physical_device_features.py', vk_api_xml],
-  output : ['vk_physical_device_features.c'],
-  command : [
-    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
-    '--out-c', '@OUTPUT0@'
-  ],
-  depend_files : vk_physical_device_features_gen_depend_files,
-)
-
 libvulkan_util = static_library(
   'vulkan_util',
-  [files_vulkan_util, vk_common_entrypoints, vk_dispatch_table,
-   vk_dispatch_trampolines,
-   vk_enum_to_str, vk_extensions, vk_cmd_queue, vk_physical_device_features],
+  [files_vulkan_util, vk_dispatch_table, vk_enum_to_str, vk_extensions],
   include_directories : [inc_include, inc_src, inc_gallium],
   dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers],
-  # For glsl_type_singleton
-  link_with : libcompiler,
   c_args : [vulkan_wsi_args],
   gnu_symbol_visibility : 'hidden',
   build_by_default : false,
 )
 
 idep_vulkan_util_headers = declare_dependency(
-  sources : [vk_dispatch_table[1], vk_dispatch_trampolines[1],
-             vk_enum_to_str[1], vk_extensions[1]],
+  sources : [vk_dispatch_table[1], vk_enum_to_str[1], vk_extensions[1]],
   include_directories : include_directories('.')
 )
 
-# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
-# See this discussion here:
-# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
-if get_option('backend').startswith('vs')
-  idep_vulkan_util = declare_dependency(
-    link_with : libvulkan_util,
-    dependencies : idep_vulkan_util_headers
-  )
-else
-  idep_vulkan_util = declare_dependency(
-    # Instruct users of this library to link with --whole-archive.  Otherwise,
-    # our weak function overloads may not resolve properly.
-    link_whole : libvulkan_util,
-    dependencies : idep_vulkan_util_headers
-  )
-endif
+idep_vulkan_util = declare_dependency(
+  link_with : libvulkan_util,
+  dependencies : idep_vulkan_util_headers
+)
diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build
index d2a823a708e..427ce5803f4 100644
--- a/src/vulkan/wsi/meson.build
+++ b/src/vulkan/wsi/meson.build
@@ -60,7 +60,8 @@ libvulkan_wsi = static_library(
   [files_vulkan_wsi, wsi_entrypoints],
   include_directories : [inc_include, inc_src],
   dependencies : [
-    vulkan_wsi_deps, dep_libdrm, idep_vulkan_util_headers, idep_xmlconfig,
+    vulkan_wsi_deps, dep_libdrm, idep_vulkan_util_headers,
+    idep_vulkan_runtime_headers, idep_xmlconfig,
   ],
   c_args : [vulkan_wsi_args],
   gnu_symbol_visibility : 'hidden',
diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h
index f08002abfaf..2bed91ded38 100644
--- a/src/vulkan/wsi/wsi_common_private.h
+++ b/src/vulkan/wsi/wsi_common_private.h
@@ -24,7 +24,7 @@
 #define WSI_COMMON_PRIVATE_H
 
 #include "wsi_common.h"
-#include "vulkan/util/vk_object.h"
+#include "vulkan/runtime/vk_object.h"
 
 struct wsi_image {
    VkImage image;



More information about the mesa-commit mailing list