[Mesa-dev] [PATCH] anv/entrypoints: VkGetDeviceProcAddr returns NULL for core instance commands
Emil Velikov
emil.l.velikov at gmail.com
Wed Mar 7 14:17:29 UTC 2018
On 7 March 2018 at 08:02, Iago Toral <itoral at igalia.com> wrote:
> I just noticed that I had missed on of your comments:
>
> On Mon, 2018-03-05 at 12:11 +0000, Emil Velikov wrote:
> (...)
>>
>> > EntrypointParam = namedtuple('EntrypointParam', 'type name decl')
>> >
>> > +DeviceChildrenList = ['VkDevice', 'VkQueue', 'VkCommandBuffer' ]
>> > +
>> > +def is_device_child(name):
>> > + """Tell if the given type name is a VkDevice or one of its
>> > children."""
>> > + return name in DeviceChildrenList
>> > +
>> > class Entrypoint(object):
>> > def __init__(self, name, return_type, params, guard = None):
>> > self.name = name
>> > @@ -358,6 +368,7 @@ class Entrypoint(object):
>> > self.guard = guard
>> > self.enabled = False
>> > self.num = None
>> > + self.instance_dispatch = not
>> > is_device_child(params[0].type)
>>
>> On a quick look this seems odd - one is interested in instance
>> dispatch, yet checking for device.
>
> We consider that an instance dispatch is anything that is not
> dispatched to a device or one of its children... what do you find odd
> about this?
>
>> There are some subtleties about it in the above mentioned report.
>>
>> Please add a small comment about those.
>
> How about this?:
>
> "Originally, the Vulkan specs stated that VkGetDeviceProcaAddr could be
> used to retrieve function pointers to any core Vulkan command, yet it
> would also state that returned function pointers could only be
> dispatched to VkDevice or one of its children, so in practice this made
> it incorrect to use any pointers to instance-level commands that were
> retrived with this function, which was a source of confusion. Later,
> the spec was updated to make VkGetDeviceProcAddr return NULL function
> pointers for any instance-level commands".
>
A simple spec quote seems fairly sufficient.
The function pointer must only be called with a dispatchable object
(thefirst parameter) that is device or a child of device.
Either way, my trivial suggestions are causing so much churn that I'm
feeling guilty of saying anything :-\
HTH
Emil
More information about the mesa-dev
mailing list