diff options
author | Jason Ekstrand <[email protected]> | 2018-01-23 19:18:08 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-03-07 12:13:47 -0800 |
commit | 39d9fcea13407a61a34eb744f01abeeb524951de (patch) | |
tree | b36c85e218ccbfdc3cde631a83b275c1c15384bc | |
parent | 8e8f167c72757aa9a1ee835570100e56bb6dc06d (diff) |
anv/entrypoints: Allow an entrypoint to require multiple extensions
In this case, we say an entrypoint is supported if ANY of the extensions
is supported. This is because, in the XML, entrypoints don't require
extensions so much as extensions require entrypoints.
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
-rw-r--r-- | src/intel/vulkan/anv_entrypoints_gen.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py index b33460f8f7b..8769886e91b 100644 --- a/src/intel/vulkan/anv_entrypoints_gen.py +++ b/src/intel/vulkan/anv_entrypoints_gen.py @@ -266,14 +266,18 @@ anv_entrypoint_is_enabled(int index, uint32_t core_version, switch (index) { % for e in entrypoints: case ${e.num}: + /* ${e.name} */ % if e.core_version: return ${e.core_version.c_vk_version()} <= core_version; - % elif e.extension: - % if e.extension.type == 'instance': - return !device && instance->${e.extension.name[3:]}; - % else: - return !device || device->${e.extension.name[3:]}; - % endif + % elif e.extensions: + % for ext in e.extensions: + % if ext.type == 'instance': + if (!device && instance->${ext.name[3:]}) return true; + % else: + if (!device || device->${ext.name[3:]}) return true; + % endif + % endfor + return false; % else: return true; % endif @@ -404,7 +408,7 @@ class Entrypoint(object): self.num = None # Extensions which require this entrypoint self.core_version = None - self.extension = None + self.extensions = [] def is_device_entrypoint(self): return self.params[0].type in ('VkDevice', 'VkCommandBuffer') @@ -465,8 +469,7 @@ def get_entrypoints(doc, entrypoints_to_defines, start_index): e = entrypoints[command.attrib['name']] e.enabled = True assert e.core_version is None - assert e.extension is None - e.extension = ext + e.extensions.append(ext) return [e for e in entrypoints.itervalues() if e.enabled] |