From: Henri Verbeet Subject: Re: [PATCH vkd3d 4/5] vkd3d-shader: Return the register space of each used UAV and UAV counter in vkd3d_shader_scan_info. Message-Id: Date: Fri, 5 Jun 2020 21:10:40 +0430 In-Reply-To: <5237c614-bc52-ca26-7971-b4487a213b06@codeweavers.com> References: <20200604014915.986832-1-zfigura@codeweavers.com> <20200604014915.986832-4-zfigura@codeweavers.com> <4095fe3e-4428-d8ec-fae0-2d313164bd48@codeweavers.com> <5237c614-bc52-ca26-7971-b4487a213b06@codeweavers.com> On Fri, 5 Jun 2020 at 20:04, Zebediah Figura wrote: > If we extend the above proposal, perhaps something like: > > #define VKD3D_ARRAY_COUNT_UNBOUNDED (~0) > > struct vkd3d_uav_scan_info > { > unsigned int register_space, register_index, array_count; > bool counter, read; > } > > array_count doesn't necessarily have to reflect the actual declared > array count (unless there's a reason to do that I'm not thinking of?) > > Thus if the array isn't indexed dynamically, we can fill one > vkd3d_uav_scan_info entry for each access, each with an array_count of > 1. If it is, we add one entry with the declared array count or > VKD3D_ARRAY_COUNT_UNBOUNDED (if it's indexed dynamically). Does that work? Probably something along those lines, yeah. Although perhaps it makes more sense to store "unbounded" as a flag, like "counter" and "read", and then just set "count" to 0.