| # Copyright 2016 The Fuchsia Authors |
| # |
| # 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 (including the next |
| # paragraph) 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. |
| |
| import("//garnet/lib/magma/gnbuild/magma.gni") |
| |
| declare_args() { |
| use_mock_magma = false |
| } |
| |
| config("vulkan_internal_config") { |
| include_dirs = [ |
| ".", |
| "..", # because anv_private.h includes isl/isl.h |
| "$magma_build_root/third_party/libdrm", # because anv_private.h includes i915_drm.h |
| "$mesa_build_root/src/compiler", # because anv_nir.h includes nir/nir.h |
| "$mesa_build_root/src", # because isl.h includes util/macros.h |
| "$root_gen_dir/third_party/mesa/src/intel/vulkan", |
| ] |
| |
| defines = [ "FFS_DEFINED=1" ] |
| } |
| |
| shared_library("vulkan_intel") { |
| deps = [ |
| ":vulkan_internal", |
| ] |
| |
| if (use_mock_magma) { |
| deps += [ "$magma_build_root/tests/mock:magma_system" ] |
| } else { |
| deps += [ "$magma_build_root:libmagma" ] |
| } |
| } |
| |
| # Also used by testing targets |
| source_set("vulkan_internal") { |
| public_deps = [ |
| "$mesa_build_root/include:vulkan", |
| "$mesa_build_root/src/intel/compiler", |
| "$mesa_build_root/src/vulkan/wsi", |
| ] |
| |
| public_configs = [ |
| ":vulkan_internal_config", |
| "$mesa_build_root/src:common_config", |
| ] |
| |
| deps = [ |
| ":anv_entrypoints", |
| ":gen", |
| "$magma_build_root/include:magma_abi", |
| "$magma_build_root/src/magma_util", |
| "$magma_build_root/src/magma_util/platform:futex", |
| "$mesa_build_root/include:c_compat", |
| "$mesa_build_root/src/compiler/nir", |
| "$mesa_build_root/src/compiler/spirv", |
| "$mesa_build_root/src/intel:genxml", |
| "$mesa_build_root/src/intel:isl", |
| "$mesa_build_root/src/intel/blorp", |
| "$mesa_build_root/src/intel/common", |
| "$mesa_build_root/src/vulkan/util", |
| "$mesa_build_root/src/magma", |
| "$mesa_build_root/src/util", |
| ] |
| |
| sources = [ |
| "$target_gen_dir/anv_entrypoints.c", |
| "$target_gen_dir/anv_entrypoints.h", |
| "anv_allocator.c", |
| "anv_batch_chain.c", |
| "anv_blorp.c", |
| "anv_cmd_buffer.c", |
| "anv_descriptor_set.c", |
| "anv_device.c", |
| "anv_dump.c", |
| "anv_formats.c", |
| "anv_genX.h", |
| "anv_image.c", |
| "anv_intel.c", |
| "anv_magma.cc", |
| "anv_nir.h", |
| "anv_nir_apply_pipeline_layout.c", |
| "anv_nir_lower_push_constants.c", |
| "anv_nir_lower_input_attachments.c", |
| "anv_pass.c", |
| "anv_pipeline.c", |
| "anv_pipeline_cache.c", |
| "anv_platform.cc", |
| "anv_private.h", |
| "anv_util.c", |
| "anv_wsi.c", |
| "anv_wsi_magma.cc", |
| "vk_format_info.h", |
| ] |
| } |
| |
| group("gen") { |
| deps = [ |
| ":gen7", |
| ":gen75", |
| ":gen8", |
| ":gen9", |
| ] |
| } |
| |
| template("vulkan_gen8") { |
| source_set(target_name) { |
| defines = [ invoker.defines ] |
| |
| configs += [ |
| ":vulkan_internal_config", |
| "$mesa_build_root/src:common_config", |
| ] |
| |
| sources = [ |
| "gen8_cmd_buffer.c", |
| "genX_blorp_exec.c", |
| "genX_cmd_buffer.c", |
| "genX_gpu_memcpy.c", |
| "genX_pipeline.c", |
| "genX_query.c", |
| "genX_state.c", |
| ] |
| |
| deps = [ |
| ":anv_entrypoints", |
| "$magma_build_root/include:magma_abi", |
| "$mesa_build_root/include:c_compat", |
| "$mesa_build_root/src/intel:genxml", |
| "$mesa_build_root/src/intel:isl", |
| "$mesa_build_root/src/intel/blorp", |
| "$mesa_build_root/src/vulkan/wsi", |
| ] |
| } |
| } |
| |
| vulkan_gen8("gen8") { |
| defines = "GEN_VERSIONx10=80" |
| } |
| |
| vulkan_gen8("gen9") { |
| defines = "GEN_VERSIONx10=90" |
| } |
| |
| template("vulkan_gen7") { |
| source_set(target_name) { |
| defines = [ invoker.defines ] |
| |
| configs += [ |
| ":vulkan_internal_config", |
| "$mesa_build_root/src:common_config", |
| ] |
| |
| sources = [ |
| "gen7_cmd_buffer.c", |
| "genX_blorp_exec.c", |
| "genX_cmd_buffer.c", |
| "genX_gpu_memcpy.c", |
| "genX_pipeline.c", |
| "genX_query.c", |
| "genX_state.c", |
| ] |
| |
| deps = [ |
| ":anv_entrypoints", |
| "$magma_build_root/include:magma_abi", |
| "$mesa_build_root/include:c_compat", |
| "$mesa_build_root/src/intel:genxml", |
| "$mesa_build_root/src/intel:isl", |
| "$mesa_build_root/src/intel/blorp", |
| "$mesa_build_root/src/vulkan/wsi", |
| ] |
| } |
| } |
| |
| vulkan_gen7("gen7") { |
| defines = "GEN_VERSIONx10=70" |
| } |
| |
| vulkan_gen7("gen75") { |
| defines = "GEN_VERSIONx10=75" |
| } |
| |
| action("anv_entrypoints") { |
| outputs = [ "$target_gen_dir/anv_entrypoints.h", |
| "$target_gen_dir/anv_entrypoints.c", |
| ] |
| |
| script = "anv_entrypoints_gen.py" |
| |
| inputs = [ |
| "$mesa_build_root/src/vulkan/registry/vk.xml", |
| ] |
| |
| args = [ |
| "--pythonpath", |
| rebase_path("$magma_python_path"), |
| "--xml", |
| rebase_path("$mesa_build_root") + "/src/vulkan/registry/vk.xml", |
| "--outdir", |
| rebase_path("$target_gen_dir") |
| ] |
| } |