<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 6, 2018 at 8:02 AM, Iago Toral <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 2018-03-05 at 12:11 +0000, Emil Velikov wrote:<br>
> Hi Iago,<br>
><br>
> Top level questions:<br>
><br>
> I think this and the original commit should go to stable right?<br>
<br>
</span>I am not sure if this qualifies for stable: these patches don't fix any<br>
user-visible bugs. If an application was calling vkGetDeviceProcAddr to<br>
get pointers to non-device functions (which is incorrect by the spec)<br>
the previous behavior would allow it to get away with it without<br>
issues, bit with these patches it will start to crash since it will<br>
receive NULL pointers.<br>
<span class=""><br>
> The dispatch in 17.3 is very different making, yet 18.0 should be<br>
> perfectly fine.<br>
><br>
> Mildly related - anv is missing a special case for following three<br>
> extensions. Should we port those over from radv?<br>
><br>
> vkCreateInstance vkEnumerateInstanceExtensionPr<wbr>operties<br>
> vkEnumerateInstanceLayerProper<wbr>ties<br>
<br>
</span>What is the exception exactly? Right now we report NULL for these from<br>
vkGetDeviceProcAddr which is the right thing to do.<br></blockquote><div><br></div><div>He's talking about the 3 instance commands that we should return in the GetInstanceProcAddr even if instance is NULL, but anv handles that inside anv_device.c anyway, so I don't think there is anything to be done there. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> Bas, you might want to port these over?<br>
><br>
> On 5 March 2018 at 10:46, Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>><br>
> wrote:<br>
> > af5f2322d0c64 addressed this for extension commands, but the spec<br>
> > mandates<br>
> > this behavior also for core API commands. From the Vulkan spec,<br>
> > Table 2. vkGetDeviceProcAddr behavior:<br>
> ><br>
> > device     pname                            return<br>
> > ------------------------------<wbr>----------------------------<br>
> > (..)<br>
> > device     core device-level command        fp<br>
> > (...)<br>
> ><br>
> > See that it specifically states "device-level".<br>
> ><br>
> > Since the vk.xml file doesn't state if core commands are instance<br>
> > or<br>
> > device level, we identify device level commands as the ones that<br>
> > take a<br>
> > VkDevice, VkQueue or VkCommandBuffer as their first parameter.<br>
> ><br>
> > Fixes test failures in new work-in-progress CTS tests.<br>
><br>
> AFAICT this and the original patch are in-light of the following<br>
> github issue, right?<br>
> If so, please add it to the commit message.<br>
><br>
> <a href="https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issu" rel="noreferrer" target="_blank">https://github.com/<wbr>KhronosGroup/Vulkan-<wbr>LoaderAndValidationLayers/issu</a><br>
> es/2323<br>
<br>
</span>Yes, they are both related to that. I'll add the reference in the<br>
commit log.<br>
<div class="HOEnZb"><div class="h5"><br>
> > ---<br>
> >  src/intel/vulkan/anv_<wbr>entrypoints_gen.py | 13 ++++++++++++-<br>
> >  1 file changed, 12 insertions(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/src/intel/vulkan/anv_<wbr>entrypoints_gen.py<br>
> > b/src/intel/vulkan/anv_<wbr>entrypoints_gen.py<br>
> > index 34ffedb116..f0bfc3b6f8 100644<br>
> > --- a/src/intel/vulkan/anv_<wbr>entrypoints_gen.py<br>
> > +++ b/src/intel/vulkan/anv_<wbr>entrypoints_gen.py<br>
> > @@ -222,7 +222,11 @@ anv_entrypoint_is_enabled(int index, uint32_t<br>
> > core_version,<br>
> >  % for e in entrypoints:<br>
> >     case ${e.num}:<br>
> >     % if e.core_version:<br>
> > -      return ${e.core_version.c_vk_version(<wbr>)} <= core_version;<br>
> > +      % if e.instance_dispatch:<br>
> > +         return !device && ${e.core_version.c_vk_version(<wbr>)} <=<br>
> > core_version;<br>
> > +      % else:<br>
> > +         return ${e.core_version.c_vk_version(<wbr>)} <= core_version;<br>
> > +      % endif<br>
> >     % elif e.extension:<br>
> >        % if e.extension.type == 'instance':<br>
> >        return !device && instance->${<a href="http://e.extension.name" rel="noreferrer" target="_blank">e.extension.name</a>[<wbr>3:]};<br>
> > @@ -350,6 +354,12 @@ def cal_hash(name):<br>
> ><br>
> >  EntrypointParam = namedtuple('EntrypointParam', 'type name decl')<br>
> ><br>
> > +DeviceChildrenList = ['VkDevice', 'VkQueue', 'VkCommandBuffer' ]<br>
> > +<br>
> > +def is_device_child(name):<br>
> > +   """Tell if the given type name is a VkDevice or one of its<br>
> > children."""<br>
> > +   return name in DeviceChildrenList<br>
> > +<br>
> >  class Entrypoint(object):<br>
> >      def __init__(self, name, return_type, params, guard = None):<br>
> >          <a href="http://self.name" rel="noreferrer" target="_blank">self.name</a> = name<br>
> > @@ -358,6 +368,7 @@ class Entrypoint(object):<br>
> >          self.guard = guard<br>
> >          self.enabled = False<br>
> >          self.num = None<br>
> > +        self.instance_dispatch = not<br>
> > is_device_child(params[0].<wbr>type)<br>
><br>
> On a quick look this seems odd - one is interested in instance<br>
> dispatch, yet checking for device.<br>
> There are some subtleties about it in the above mentioned report.<br>
><br>
> Please add a small comment about those.<br>
><br>
> With the link + trivial comment the patch is<br>
> Reviewed-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
><br>
> -Emil<br>
><br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>