<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 19, 2017 at 7:21 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span class="">
<div class="m_-150718412124039107moz-cite-prefix">On 15/09/17 22:34, Jason Ekstrand
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Fri, Sep 15, 2017 at 7:10 AM,
Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by:
Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>><br>
---<br>
src/vulkan/util/vk_util.h | 7 +++++++<br>
1 file changed, 7 insertions(+)<br>
<br>
diff --git a/src/vulkan/util/vk_util.h
b/src/vulkan/util/vk_util.h<br>
index 2ed601f881e..a152984d14d 100644<br>
--- a/src/vulkan/util/vk_util.h<br>
+++ b/src/vulkan/util/vk_util.h<br>
@@ -199,4 +199,11 @@ __vk_find_struct(void *start,
VkStructureType sType)<br>
<br>
uint32_t vk_get_driver_version(void);<br>
<br>
+#define VK_EXT_OFFSET (1000000000UL)<br>
+#define vk_enum_extension(__enum) \<br>
+ ((__enum) >= VK_EXT_OFFSET ? ((((__enum) -
VK_EXT_OFFSET) / 1000UL) + 1) : 0)<br>
+#define vk_enum_offset(__enum) \<br>
+ ((__enum) >= VK_EXT_OFFSET ? \<br>
+ ((__enum) - VK_EXT_OFFSET -
((vk_enum_extension(__enum) - 1) * 1000)) : (__enum))<br>
</blockquote>
<div><br>
</div>
<div>Can't this just be ((__enum) >= VK_EXT_OFFSET ?
((__enum) % 1000) : 0)<br>
</div>
</div>
</div>
</div>
</blockquote>
<br></span>
Duh! Even __enum % 1000..<span class="">
</span></div>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">I'd like to allow for an enum that grows to > 1000 in core. I doubt we'll see an extension with > 1000 enums. :)<br></div></div>