icd: Adding generated mock icd
Initial check-in for mock icd which is being built to allow validation
testing without the need for an actual Vulkan device.
ICD is currently building and passing 324/332 tests. It creates ptr
handles for dispatchable objects and unique id handles for
non-dispatchable objects. It currently has some hard-coded values for
various Get* device-query functions in order to allow forward progress.
The long-term intention is to allow the device configuration to be set
by the test itself.
See the ICD README.md file for more info.
diff --git a/scripts/lvl_genvk.py b/scripts/lvl_genvk.py
index 194106e..09554db 100644
--- a/scripts/lvl_genvk.py
+++ b/scripts/lvl_genvk.py
@@ -26,6 +26,7 @@
from dispatch_table_helper_generator import DispatchTableHelperOutputGenerator, DispatchTableHelperOutputGeneratorOptions
from helper_file_generator import HelperFileOutputGenerator, HelperFileOutputGeneratorOptions
from loader_extension_generator import LoaderExtensionOutputGenerator, LoaderExtensionGeneratorOptions
+from mock_icd_generator import MockICDGeneratorOptions, MockICDOutputGenerator
# Simple timer functions
startTime = None
@@ -122,7 +123,6 @@
alignFuncParam = 48)
]
-
# Options for parameter validation layer
genOpts['parameter_validation.cpp'] = [
ParameterValidationOutputGenerator,
@@ -424,6 +424,49 @@
helper_file_type = 'extension_helper_header')
]
+ # Options for mock ICD header
+ genOpts['mock_icd.h'] = [
+ MockICDOutputGenerator,
+ MockICDGeneratorOptions(
+ filename = 'mock_icd.h',
+ directory = directory,
+ apiname = 'vulkan',
+ profile = None,
+ versions = allVersions,
+ emitversions = allVersions,
+ defaultExtensions = 'vulkan',
+ addExtensions = addExtensions,
+ removeExtensions = removeExtensions,
+ prefixText = prefixStrings + vkPrefixStrings,
+ protectFeature = False,
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ helper_file_type = 'mock_icd_header')
+ ]
+
+ # Options for mock ICD cpp
+ genOpts['mock_icd.cpp'] = [
+ MockICDOutputGenerator,
+ MockICDGeneratorOptions(
+ filename = 'mock_icd.cpp',
+ directory = directory,
+ apiname = 'vulkan',
+ profile = None,
+ versions = allVersions,
+ emitversions = allVersions,
+ defaultExtensions = 'vulkan',
+ addExtensions = addExtensions,
+ removeExtensions = removeExtensions,
+ prefixText = prefixStrings + vkPrefixStrings,
+ protectFeature = False,
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ helper_file_type = 'mock_icd_source')
+ ]
# Generate a target based on the options in the matching genOpts{} object.
# This is encapsulated in a function so it can be profiled and/or timed.