From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- libs/vkd3d/command.c | 6 +++--- libs/vkd3d/state.c | 8 ++++---- libs/vkd3d/vkd3d_private.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index b7e680e..7ff3c87 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1862,7 +1862,7 @@ static void d3d12_command_list_invalidate_current_render_pass(struct d3d12_comma static void d3d12_command_list_invalidate_bindings(struct d3d12_command_list *list, struct d3d12_pipeline_state *state) { - if (state && state->uav_counter_mask) + if (state && state->uav_counter_count) { enum vkd3d_pipeline_bind_point bind_point = (enum vkd3d_pipeline_bind_point)state->vk_bind_point; list->pipeline_bindings[bind_point].uav_counters_dirty = true; @@ -2680,7 +2680,7 @@ static void d3d12_command_list_update_descriptor_table(struct d3d12_command_list /* Track UAV counters. */ if (range->descriptor_magic == VKD3D_DESCRIPTOR_MAGIC_UAV) { - for (k = 0; k < vkd3d_popcount(state->uav_counter_mask); ++k) + for (k = 0; k < state->uav_counter_count; ++k) { if (state->uav_counters[k].register_index == register_idx) { @@ -2835,7 +2835,7 @@ static void d3d12_command_list_update_uav_counter_descriptors(struct d3d12_comma if (!state || !bindings->uav_counters_dirty) return;
- uav_counter_count = vkd3d_popcount(state->uav_counter_mask); + uav_counter_count = state->uav_counter_count; assert(uav_counter_count <= ARRAY_SIZE(vk_descriptor_writes));
vk_descriptor_set = d3d12_command_allocator_allocate_descriptor_set(list->allocator, state->vk_set_layout); diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index a7b6251..44891a1 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1418,7 +1418,7 @@ static HRESULT d3d12_pipeline_state_init_compute_uav_counters(struct d3d12_pipel vkd3d_free(binding_desc); return E_OUTOFMEMORY; } - state->uav_counter_mask = shader_info->uav_counter_mask; + state->uav_counter_count = uav_counter_count;
memset(&context, 0, sizeof(context)); if (root_signature->vk_push_set_layout) @@ -1495,7 +1495,7 @@ 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_mask = 0; + state->uav_counter_count = 0;
if (!(root_signature = unsafe_impl_from_ID3D12RootSignature(desc->pRootSignature))) { @@ -1529,7 +1529,7 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st shader_interface.combined_samplers = NULL; shader_interface.combined_sampler_count = 0; shader_interface.uav_counters = state->uav_counters; - shader_interface.uav_counter_count = vkd3d_popcount(state->uav_counter_mask); + shader_interface.uav_counter_count = state->uav_counter_count;
vk_pipeline_layout = state->vk_pipeline_layout ? state->vk_pipeline_layout : root_signature->vk_pipeline_layout; @@ -2041,7 +2041,7 @@ 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_mask = 0; + state->uav_counter_count = 0; graphics->stage_count = 0;
memset(&input_signature, 0, sizeof(input_signature)); diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index a4d73a9..cf7c796 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -797,7 +797,7 @@ struct d3d12_pipeline_state uint32_t set_index;
struct vkd3d_shader_uav_counter_binding *uav_counters; - uint8_t uav_counter_mask; + unsigned int uav_counter_count;
struct d3d12_device *device;