From 7decb65f54246172da64e36ea81fb047d507c34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Thu, 15 Nov 2018 16:32:40 +0100 Subject: [PATCH] vkd3d-shader: Implement shader visibility for UAV counters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- include/vkd3d_shader.h | 1 + libs/vkd3d-shader/spirv.c | 4 +++- libs/vkd3d/state.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index c0d1f65a..7d9bf70e 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -111,6 +111,7 @@ struct vkd3d_shader_combined_resource_sampler struct vkd3d_shader_uav_counter_binding { unsigned int register_index; /* u# */ + enum vkd3d_shader_visibility shader_visibility; struct vkd3d_shader_descriptor_binding binding; unsigned int offset; diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 1655bf31..12fa3000 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2086,10 +2086,12 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor { const struct vkd3d_shader_uav_counter_binding *current = &shader_interface->uav_counters[i]; + if (!vkd3d_dxbc_compiler_check_shader_visibility(compiler, current->shader_visibility)) + continue; + if (current->offset) FIXME("Atomic counter offsets are not supported yet.\n"); - /* FIXME: Implement shader visibility for UAV counters. */ if (current->register_index == reg_idx) return current->binding; } diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index bf4eee98..3ee602fa 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1367,6 +1367,7 @@ static HRESULT d3d12_pipeline_state_init_compute_uav_counters(struct d3d12_pipel continue; state->uav_counters[j].register_index = i; + state->uav_counters[j].shader_visibility = VKD3D_SHADER_VISIBILITY_COMPUTE; state->uav_counters[j].binding.set = context.set_index; state->uav_counters[j].binding.binding = context.descriptor_binding;