Edit

kc3-lang/angle/scripts/generate_vulkan_header.py

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2016-12-23 13:41:47
    Hash : 0448ec84
    Message : Vulkan: Enable validation layers on request. Also adds the build files for the Vulkan layers. The layers are enabled by default for the tests. BUG=angleproject:1319 Change-Id: I0b442b36312a1299a932922e1c4e39f00801de49 Reviewed-on: https://chromium-review.googlesource.com/367751 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>

  • scripts/generate_vulkan_header.py
  • #!/usr/bin/python
    #
    # Copyright 2016 The ANGLE Project Authors. All rights reserved.
    # Use of this source code is governed by a BSD-style license that can be
    # found in the LICENSE file.
    #
    # generate_vulkan_header.py:
    #   Workaround problems with Windows and GYP and the Vulkan loader paths.
    
    import os, sys
    
    if len(sys.argv) < 4:
        print("Usage: " + sys.argv[0] + " <layers_source_path> <output_file> <default_vk_layers_path>")
        sys.exit(1)
    
    layers_source_path = sys.argv[1]
    output_file = sys.argv[2]
    default_vk_layers_path = sys.argv[3].rstrip("\"")
    
    def fixpath(inpath):
        return os.path.relpath(inpath).replace('\\', '/')
    
    def all_paths(inpath):
        return fixpath(inpath) + ";" + fixpath(os.path.join("..", fixpath(inpath)))
    
    with open(output_file, "w") as outfile:
        outfile.write("#define LAYERS_SOURCE_PATH \"" + all_paths(layers_source_path) + "\"\n")
        outfile.write("#define DEFAULT_VK_LAYERS_PATH \"" + all_paths(default_vk_layers_path) + "\"\n")