[PATCH 3/6] wined3d: Get rid of the wined3d_unordered_access_vk_barrier() helper.

Zebediah Figura zfigura at codeweavers.com
Mon Jul 19 22:23:25 CDT 2021


We are already branching in the caller, and we need to access the view desc in
order to pass partial ranges.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/wined3d/context_vk.c      | 11 ++++++++---
 dlls/wined3d/wined3d_private.h |  6 ------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index fa611411285..856adc4ad1a 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -3054,6 +3054,8 @@ static void wined3d_context_vk_load_shader_resources(struct wined3d_context_vk *
                 uav_vk = wined3d_unordered_access_view_vk(uav);
                 if (uav->resource->type == WINED3D_RTYPE_BUFFER)
                 {
+                    buffer_vk = wined3d_buffer_vk(buffer_from_resource(uav->resource));
+
                     if (!uav_vk->view_vk.bo_user.valid)
                     {
                         wined3d_unordered_access_view_vk_update(uav_vk, context_vk);
@@ -3063,15 +3065,18 @@ static void wined3d_context_vk_load_shader_resources(struct wined3d_context_vk *
                             context_invalidate_compute_state(&context_vk->c,
                                     STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING);
                     }
-                    wined3d_buffer_load(buffer_from_resource(uav->resource), &context_vk->c, state);
+                    wined3d_buffer_load(&buffer_vk->b, &context_vk->c, state);
                     wined3d_unordered_access_view_invalidate_location(uav, ~WINED3D_LOCATION_BUFFER);
+                    wined3d_buffer_vk_barrier(buffer_vk, context_vk, WINED3D_BIND_UNORDERED_ACCESS);
                 }
                 else
                 {
-                    wined3d_texture_load(texture_from_resource(uav->resource), &context_vk->c, FALSE);
+                    struct wined3d_texture_vk *texture_vk = wined3d_texture_vk(texture_from_resource(uav->resource));
+
+                    wined3d_texture_load(&texture_vk->t, &context_vk->c, FALSE);
                     wined3d_unordered_access_view_invalidate_location(uav, ~WINED3D_LOCATION_TEXTURE_RGB);
+                    wined3d_texture_vk_barrier(texture_vk, context_vk, WINED3D_BIND_UNORDERED_ACCESS);
                 }
-                wined3d_unordered_access_view_vk_barrier(uav_vk, context_vk, WINED3D_BIND_UNORDERED_ACCESS);
                 break;
 
             case WINED3D_SHADER_DESCRIPTOR_TYPE_UAV_COUNTER:
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3a496231fe7..7e31579945f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -5211,12 +5211,6 @@ static inline struct wined3d_unordered_access_view_vk *wined3d_unordered_access_
     return CONTAINING_RECORD(view, struct wined3d_unordered_access_view_vk, v);
 }
 
-static inline void wined3d_unordered_access_view_vk_barrier(struct wined3d_unordered_access_view_vk *uav_vk,
-        struct wined3d_context_vk *context_vk, uint32_t bind_mask)
-{
-    wined3d_resource_vk_barrier(uav_vk->v.resource, context_vk, bind_mask);
-}
-
 void wined3d_unordered_access_view_vk_clear(struct wined3d_unordered_access_view_vk *view_vk,
         const struct wined3d_uvec4 *clear_value, struct wined3d_context_vk *context_vk, bool fp) DECLSPEC_HIDDEN;
 HRESULT wined3d_unordered_access_view_vk_init(struct wined3d_unordered_access_view_vk *view_vk,
-- 
2.32.0




More information about the wine-devel mailing list