[PATCH vkd3d 1/5] vkd3d: Index the "vk_uav_counter_views" array to match the "uav_counters" array.

Zebediah Figura zfigura at codeweavers.com
Thu Jun 4 16:00:48 CDT 2020


On 6/4/20 3:48 PM, Henri Verbeet wrote:
> On Thu, 4 Jun 2020 at 06:19, Zebediah Figura <zfigura at codeweavers.com> wrote:
>> @@ -2678,14 +2679,20 @@ static void d3d12_command_list_update_descriptor_table(struct d3d12_command_list
>>              unsigned int register_idx = range->base_register_idx + j;
>>
>>              /* Track UAV counters. */
>> -            if (range->descriptor_magic == VKD3D_DESCRIPTOR_MAGIC_UAV
>> -                    && register_idx < ARRAY_SIZE(bindings->vk_uav_counter_views))
>> +            if (range->descriptor_magic == VKD3D_DESCRIPTOR_MAGIC_UAV)
>>              {
>> -                VkBufferView vk_counter_view = descriptor->magic == VKD3D_DESCRIPTOR_MAGIC_UAV
>> -                        ? descriptor->u.view->vk_counter_view : VK_NULL_HANDLE;
>> -                if (bindings->vk_uav_counter_views[register_idx] != vk_counter_view)
>> -                    bindings->uav_counter_dirty_mask |= 1u << register_idx;
>> -                bindings->vk_uav_counter_views[register_idx] = vk_counter_view;
>> +                for (k = 0; k < vkd3d_popcount(state->uav_counter_mask); ++k)
>> +                {
>> +                    if (state->uav_counters[k].register_index == register_idx)
>> +                    {
>> +                        VkBufferView vk_counter_view = descriptor->magic == VKD3D_DESCRIPTOR_MAGIC_UAV
>> +                                ? descriptor->u.view->vk_counter_view : VK_NULL_HANDLE;
>> +                        if (bindings->vk_uav_counter_views[k] != vk_counter_view)
>> +                            bindings->uav_counter_dirty_mask |= 1u << k;
> 
> Note that after this patch, "uav_counter_dirty_mask" isn't really
> being used as a mask anymore.
> 

Well, unless I've made a mistake, it's still a mask; it's just masking
indices to the uav_counters/vk_uav_counter_views array instead of
register indices...

At any rate I don't see a more appropriate name, myself...



More information about the wine-devel mailing list