From 32966338dfbb1896bda54e50d0655e10438bf336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 8 Sep 2017 15:30:48 +0200 Subject: [PATCH] libs/vkd3d: Get rid of UAV counter count from d3d12_pipeline_state. --- libs/vkd3d/command.c | 4 ++-- libs/vkd3d/state.c | 5 +---- libs/vkd3d/vkd3d_private.h | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index de1d0b41..43aefa56 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1024,7 +1024,7 @@ static void d3d12_command_list_invalidate_bindings(struct d3d12_command_list *li if (!state) return; - if (state->uav_counter_count) + if (state->uav_counter_mask) { struct vkd3d_pipeline_bindings *bindings = &list->pipeline_bindings[state->vk_bind_point]; bindings->uav_counter_dirty_mask = ~(uint8_t)0; @@ -1924,7 +1924,7 @@ static void d3d12_command_list_update_uav_counter_descriptors(struct d3d12_comma if (!state || !(state->uav_counter_mask & bindings->uav_counter_dirty_mask)) return; - uav_counter_count = state->uav_counter_count; + uav_counter_count = vkd3d_popcount(state->uav_counter_mask); pool_size.type = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; pool_size.descriptorCount = uav_counter_count; diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 8b467653..a85ce612 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1220,7 +1220,6 @@ static HRESULT d3d12_pipeline_state_init_compute_uav_counters(struct d3d12_pipel return E_OUTOFMEMORY; if (!(state->uav_counters = vkd3d_calloc(uav_counter_count, sizeof(*state->uav_counters)))) return E_OUTOFMEMORY; - state->uav_counter_count = uav_counter_count; state->uav_counter_mask = shader_info->uav_counter_mask; memset(&context, 0, sizeof(context)); @@ -1296,7 +1295,6 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st state->vk_pipeline_layout = VK_NULL_HANDLE; state->vk_set_layout = VK_NULL_HANDLE; state->uav_counters = NULL; - state->uav_counter_count = 0; state->uav_counter_mask = 0; if (!(root_signature = unsafe_impl_from_ID3D12RootSignature(desc->pRootSignature))) @@ -1326,7 +1324,7 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st shader_interface.push_constant_buffer_count = root_signature->root_constant_count; shader_interface.default_sampler = root_signature->default_sampler; shader_interface.uav_counters = state->uav_counters; - shader_interface.uav_counter_count = state->uav_counter_count; + shader_interface.uav_counter_count = vkd3d_popcount(state->uav_counter_mask); pipeline_info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO; pipeline_info.pNext = NULL; @@ -1681,7 +1679,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s state->vk_pipeline_layout = VK_NULL_HANDLE; state->vk_set_layout = VK_NULL_HANDLE; state->uav_counters = NULL; - state->uav_counter_count = 0; state->uav_counter_mask = 0; if (!(root_signature = unsafe_impl_from_ID3D12RootSignature(desc->pRootSignature))) diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 0d8a7cdd..efb3ca3a 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -408,7 +408,6 @@ struct d3d12_pipeline_state uint32_t set_index; struct vkd3d_shader_uav_counter_binding *uav_counters; - unsigned int uav_counter_count; uint8_t uav_counter_mask; struct d3d12_device *device;