From a78fe60ef80cef94c4dbd0cce423f78b177b625a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 11 Sep 2017 22:35:16 +0200 Subject: [PATCH] Revert "libs/vkd3d: Skip unbound UAV counters." This reverts commit d9bc635d1ab1303be45523ce7f9282dbcac953e5. We should not need to handle this invalid behavior. It was triggered by the bug in d3d12_command_list_update_descriptor_table(). --- libs/vkd3d/command.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 1e603835..4c7f0e34 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1918,7 +1918,7 @@ static void d3d12_command_list_update_uav_counter_descriptors(struct d3d12_comma VkDescriptorSet vk_descriptor_set; VkDescriptorPoolSize pool_size; unsigned int uav_counter_count; - unsigned int i, j; + unsigned int i; if (!state || !(state->uav_counter_mask & bindings->uav_counter_dirty_mask)) return; @@ -1933,31 +1933,26 @@ static void d3d12_command_list_update_uav_counter_descriptors(struct d3d12_comma if (!(vk_descriptor_writes = vkd3d_calloc(uav_counter_count, sizeof(*vk_descriptor_writes)))) return; - for (i = 0, j = 0; i < uav_counter_count; ++i) + for (i = 0; i < uav_counter_count; ++i) { const struct vkd3d_shader_uav_counter_binding *uav_counter = &state->uav_counters[i]; const VkBufferView *vk_uav_counter_views = bindings->vk_uav_counter_views; - if (!vk_uav_counter_views[uav_counter->register_index]) - { - FIXME("UAV counter %u descriptor is not initialized.\n", uav_counter->register_index); - continue; - } + assert(vk_uav_counter_views[uav_counter->register_index]); - vk_descriptor_writes[j].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; - vk_descriptor_writes[j].pNext = NULL; - vk_descriptor_writes[j].dstSet = vk_descriptor_set; - vk_descriptor_writes[j].dstBinding = uav_counter->binding.binding; - vk_descriptor_writes[j].dstArrayElement = 0; - vk_descriptor_writes[j].descriptorCount = 1; - vk_descriptor_writes[j].descriptorType = pool_size.type; - vk_descriptor_writes[j].pImageInfo = NULL; - vk_descriptor_writes[j].pBufferInfo = NULL; - vk_descriptor_writes[j].pTexelBufferView = &vk_uav_counter_views[uav_counter->register_index]; - ++j; + vk_descriptor_writes[i].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + vk_descriptor_writes[i].pNext = NULL; + vk_descriptor_writes[i].dstSet = vk_descriptor_set; + vk_descriptor_writes[i].dstBinding = uav_counter->binding.binding; + vk_descriptor_writes[i].dstArrayElement = 0; + vk_descriptor_writes[i].descriptorCount = 1; + vk_descriptor_writes[i].descriptorType = pool_size.type; + vk_descriptor_writes[i].pImageInfo = NULL; + vk_descriptor_writes[i].pBufferInfo = NULL; + vk_descriptor_writes[i].pTexelBufferView = &vk_uav_counter_views[uav_counter->register_index]; } - VK_CALL(vkUpdateDescriptorSets(vk_device, j, vk_descriptor_writes, 0, NULL)); + VK_CALL(vkUpdateDescriptorSets(vk_device, uav_counter_count, vk_descriptor_writes, 0, NULL)); vkd3d_free(vk_descriptor_writes); VK_CALL(vkCmdBindDescriptorSets(list->vk_command_buffer, bind_point,