From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- 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 c0d1f65af2f9..7d9bf70e3131 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 1655bf319eae..12fa300021dc 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 bf4eee9813ee..3ee602fafb4b 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;