Skip to content

Commit

Permalink
anv/entrypoints: VkGetDeviceProcAddr returns NULL for core instance c…
Browse files Browse the repository at this point in the history
…ommands

af5f232 addressed this for extension commands, but the spec mandates
this behavior also for core API commands. From the Vulkan spec,
Table 2. vkGetDeviceProcAddr behavior:

device     pname                            return
----------------------------------------------------------
(..)
device     core device-level command        fp
(...)

See that it specifically states "device-level".

Since the vk.xml file doesn't state if core commands are instance or
device level, we identify device level commands as the ones that take a
VkDevice, VkQueue or VkCommandBuffer as their first parameter.

Fixes test failures in new work-in-progress CTS tests.

Also see the public issue:
KhronosGroup/Vulkan-LoaderAndValidationLayers#2323

v2:
 - Include reference to github issue (Emil)
 - Add a comment clarifying the story behind this behavior (Emil)
 - Rebased on top of Vulkan 1.1 changes.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
  • Loading branch information
itoral committed Mar 12, 2018
1 parent e76cf1f commit 748489c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/intel/vulkan/anv_entrypoints_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@
case ${e.num}:
/* ${e.name} */
% if e.core_version:
return ${e.core_version.c_vk_version()} <= core_version;
% if not e.is_device_entrypoint():
return !device && ${e.core_version.c_vk_version()} <= core_version;
% else:
return ${e.core_version.c_vk_version()} <= core_version;
% endif
% elif e.extensions:
% for ext in e.extensions:
% if ext.type == 'instance':
Expand Down Expand Up @@ -423,7 +427,7 @@ def __init__(self, name, return_type, params, guard = None):
self.guard = guard

def is_device_entrypoint(self):
return self.params[0].type in ('VkDevice', 'VkCommandBuffer')
return self.params[0].type in ('VkDevice', 'VkCommandBuffer', 'VkQueue')

def prefixed_name(self, prefix):
assert self.name.startswith('vk')
Expand Down

0 comments on commit 748489c

Please sign in to comment.