diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index de1d0b418fd4e850d49aace4c1ad0e6ecb1e0448..43aefa56b3d72685ac8eb2c6251b044e3a5bdda4 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 8b46765385cba310d4bca8f16f6aeb296c332948..a85ce61213783ce775e7ea913db7ff6f18b2e999 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 0d8a7cdd6cb0313ada7b2981c44260eee2517c9d..efb3ca3ae8bbf19f72806970702fd931a5e8d4e8 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;