=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d-shader: Implement shader visibility for UAV counters.

Alexandre Julliard julliard at winehq.org
Thu Nov 15 16:42:52 CST 2018


Module: vkd3d
Branch: master
Commit: 7decb65f54246172da64e36ea81fb047d507c34c
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=7decb65f54246172da64e36ea81fb047d507c34c

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Nov 15 16:32:40 2018 +0100

vkd3d-shader: Implement shader visibility for UAV counters.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 c0d1f65..7d9bf70 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 1655bf3..12fa300 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 bf4eee9..3ee602f 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;
 




More information about the wine-cvs mailing list