On Tue, 10 Aug 2021 at 10:35, Jan Sikorski jsikorski@codeweavers.com wrote:
dlls/wined3d/shader_spirv.c | 112 +++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 2 + 2 files changed, 114 insertions(+)
And this too is never used anywhere until patch 5/5 in this series.
static const struct wined3d_shader_backend_ops spirv_shader_backend_vk = { .shader_handle_instruction = shader_spirv_handle_instruction, @@ -1147,6 +1258,7 @@ static const struct wined3d_shader_backend_ops spirv_shader_backend_vk = .shader_get_caps = shader_spirv_get_caps, .shader_color_fixup_supported = shader_spirv_color_fixup_supported, .shader_has_ffp_proj_control = shader_spirv_has_ffp_proj_control,
- .shader_run_compute = wined3d_spirv_run_compute,
};
"shader_run_compute" remains uninitialised for the other shader backends.
const struct wined3d_shader_backend_ops *wined3d_spirv_shader_backend_init_vk(void) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 87757e504a2..5ffcaa1f8db 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1511,6 +1511,8 @@ struct wined3d_shader_backend_ops void (*shader_get_caps)(const struct wined3d_adapter *adapter, struct shader_caps *caps); BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup); BOOL (*shader_has_ffp_proj_control)(void *shader_priv);
- void (*shader_run_compute)(unsigned groups_x, unsigned groups_y, unsigned groups_z,
struct wined3d_context *context, struct wined3d_shader *shader, ...);
};
Conceptually, it doesn't seem quite proper for the shader backends to do compute dispatch by themselves; ideally these would only translate shaders, although in practice they're also responsible for setting up some related state, for OpenGL in particular.
I'm not sure whether you perhaps already considered and rejected this, but would it be very hard to use the existing .shader_select_compute() operation from wined3d_unordered_access_view_vk_clear()? Or perhaps simply adapter_vk_dispatch_compute()?