<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 5, 2017 at 7:48 AM, Alex Smith <span dir="ltr"><<a href="mailto:asmith@feralinteractive.com" target="_blank">asmith@feralinteractive.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">As already done by RADV, this code is lifted straight from there.<br></blockquote><div><br></div><div>I think this is a good idea but I'm very confused by the code.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Signed-off-by: Alex Smith <<a href="mailto:asmith@feralinteractive.com">asmith@feralinteractive.com</a>><br>
---<br>
 src/intel/vulkan/anv_device.c | 24 +++++++++++++++++++++++-<br>
 1 file changed, 23 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_device.<wbr>c b/src/intel/vulkan/anv_device.<wbr>c<br>
index aacd07f..8090eea 100644<br>
--- a/src/intel/vulkan/anv_device.<wbr>c<br>
+++ b/src/intel/vulkan/anv_device.<wbr>c<br>
@@ -754,6 +754,28 @@ void anv_<wbr>GetPhysicalDeviceFeatures2KHR(<br>
    }<br>
 }<br>
<br>
+static uint32_t anv_get_driver_version()<br></blockquote><div><br></div><div>First off, it would be good to put this in src/vulkan/<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+{<br>
+   const char *minor_string = strchr(VERSION, '.');<br>
+   const char *patch_string = minor_string ? strchr(minor_string + 1, ','): NULL;<br></blockquote><div><br></div><div>Why are we searching for "," and not "." here?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+   int major = atoi(VERSION);<br>
+   int minor = minor_string ? atoi(minor_string + 1) : 0;<br>
+   int patch = patch_string ? atoi(patch_string + 1) : 0;<br>
+   if (strstr(VERSION, "devel")) {<br>
+      if (patch == 0) {<br>
+         patch = 99;<br></blockquote><div><br></div><div>Is this really what we want?  When I checkout the mesa-17.0.0 tag and configure, I see this in config.log:<br><br>#define VERSION "17.0.0"<br><br></div><div>This code looks like it would call that 16.99.99 which is a version that never existed.  Perhaps the better thing to do is to look for "-something" at the end of the string, assert that patch == 0, and do the decrement.  That should catch -rcN as well as -devel.<br><br></div><div>Dave?  Bas?<br><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+         if (minor == 0) {<br>
+            minor = 99;<br>
+            --major;<br>
+         } else<br>
+            --minor;<br>
+      } else<br>
+         --patch;<br>
+   }<br>
+   uint32_t version = VK_MAKE_VERSION(major, minor, patch);<br>
+   return version;<br>
+}<br>
+<br>
 void anv_<wbr>GetPhysicalDeviceProperties(<br>
     VkPhysicalDevice                            physicalDevice,<br>
     VkPhysicalDeviceProperties*                 pProperties)<br>
@@ -886,7 +908,7 @@ void anv_<wbr>GetPhysicalDeviceProperties(<br>
<br>
    *pProperties = (VkPhysicalDeviceProperties) {<br>
       .apiVersion = VK_MAKE_VERSION(1, 0, 42),<br>
-      .driverVersion = 1,<br>
+      .driverVersion = anv_get_driver_version(),<br>
       .vendorID = 0x8086,<br>
       .deviceID = pdevice->chipset_id,<br>
       .deviceType = VK_PHYSICAL_DEVICE_TYPE_<wbr>INTEGRATED_GPU,<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
2.9.4<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>
</font></span></blockquote></div><br></div></div>