# Define macro used for building vk.xml generated files
macro(run_vk_xml_generate dependency output)
add_custom_command(OUTPUT ${output}
- COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/kvt_genvk.py -registry ${SCRIPTS_DIR}/vk.xml ${output}
- DEPENDS ${SCRIPTS_DIR}/vk.xml ${SCRIPTS_DIR}/generator.py ${SCRIPTS_DIR}/${dependency} ${SCRIPTS_DIR}/kvt_genvk.py ${SCRIPTS_DIR}/reg.py
+ COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/kvt_genvk.py -registry ${VulkanRegistry_DIR}/vk.xml -scripts ${VulkanRegistry_DIR} ${output}
+ DEPENDS ${VulkanRegistry_DIR}/vk.xml ${VulkanRegistry_DIR}/generator.py ${SCRIPTS_DIR}/${dependency} ${SCRIPTS_DIR}/kvt_genvk.py ${VulkanRegistry_DIR}/reg.py
)
endmacro()
# See the License for the specific language governing permissions and
# limitations under the License.
-import argparse, cProfile, pdb, string, sys, time
-from reg import *
-from generator import write
-from cgenerator import CGeneratorOptions, COutputGenerator
-# Generator Modifications
-from mock_icd_generator import MockICDGeneratorOptions, MockICDOutputGenerator
-from vulkan_tools_helper_file_generator import HelperFileOutputGenerator, HelperFileOutputGeneratorOptions
+import argparse, cProfile, pdb, string, sys, time, os
# Simple timer functions
startTime = None
parser.add_argument('-verbose', action='store_false', dest='quiet', default=True,
help='Enable script output during normal execution.')
+ # This argument tells us where to load the script from the Vulkan-Headers registry
+ parser.add_argument('-scripts', action='store',
+ help='Find additional scripts in this directory')
+
args = parser.parse_args()
+ scripts_directory_path = os.path.dirname(os.path.abspath(__file__))
+ registry_headers_path = os.path.join(scripts_directory_path, args.scripts)
+ sys.path.insert(0, registry_headers_path)
+
+ from reg import *
+ from generator import write
+ from cgenerator import CGeneratorOptions, COutputGenerator
+
+ # Generator Modifications
+ from mock_icd_generator import MockICDGeneratorOptions, MockICDOutputGenerator
+ from vulkan_tools_helper_file_generator import HelperFileOutputGenerator, HelperFileOutputGeneratorOptions
+
# This splits arguments which are space-separated lists
args.feature = [name for arg in args.feature for name in arg.split()]
args.extension = [name for arg in args.extension for name in arg.split()]