wined3d: Make the adapter responsible for compute dispatch.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-04-28 02:28:24 +04:30 committed by Alexandre Julliard
parent f793f4446c
commit e46b69475b
5 changed files with 108 additions and 91 deletions

View File

@ -5072,36 +5072,37 @@ void adapter_gl_clear_uav(struct wined3d_context *context,
static const struct wined3d_adapter_ops wined3d_adapter_gl_ops =
{
adapter_gl_destroy,
adapter_gl_create_device,
adapter_gl_destroy_device,
adapter_gl_acquire_context,
adapter_gl_release_context,
adapter_gl_get_wined3d_caps,
adapter_gl_check_format,
adapter_gl_init_3d,
adapter_gl_uninit_3d,
adapter_gl_map_bo_address,
adapter_gl_unmap_bo_address,
adapter_gl_copy_bo_address,
adapter_gl_create_swapchain,
adapter_gl_destroy_swapchain,
adapter_gl_create_buffer,
adapter_gl_destroy_buffer,
adapter_gl_create_texture,
adapter_gl_destroy_texture,
adapter_gl_create_rendertarget_view,
adapter_gl_destroy_rendertarget_view,
adapter_gl_create_shader_resource_view,
adapter_gl_destroy_shader_resource_view,
adapter_gl_create_unordered_access_view,
adapter_gl_destroy_unordered_access_view,
adapter_gl_create_sampler,
adapter_gl_destroy_sampler,
adapter_gl_create_query,
adapter_gl_destroy_query,
adapter_gl_flush_context,
adapter_gl_clear_uav,
.adapter_destroy = adapter_gl_destroy,
.adapter_create_device = adapter_gl_create_device,
.adapter_destroy_device = adapter_gl_destroy_device,
.adapter_acquire_context = adapter_gl_acquire_context,
.adapter_release_context = adapter_gl_release_context,
.adapter_get_wined3d_caps = adapter_gl_get_wined3d_caps,
.adapter_check_format = adapter_gl_check_format,
.adapter_init_3d = adapter_gl_init_3d,
.adapter_uninit_3d = adapter_gl_uninit_3d,
.adapter_map_bo_address = adapter_gl_map_bo_address,
.adapter_unmap_bo_address = adapter_gl_unmap_bo_address,
.adapter_copy_bo_address = adapter_gl_copy_bo_address,
.adapter_create_swapchain = adapter_gl_create_swapchain,
.adapter_destroy_swapchain = adapter_gl_destroy_swapchain,
.adapter_create_buffer = adapter_gl_create_buffer,
.adapter_destroy_buffer = adapter_gl_destroy_buffer,
.adapter_create_texture = adapter_gl_create_texture,
.adapter_destroy_texture = adapter_gl_destroy_texture,
.adapter_create_rendertarget_view = adapter_gl_create_rendertarget_view,
.adapter_destroy_rendertarget_view = adapter_gl_destroy_rendertarget_view,
.adapter_create_shader_resource_view = adapter_gl_create_shader_resource_view,
.adapter_destroy_shader_resource_view = adapter_gl_destroy_shader_resource_view,
.adapter_create_unordered_access_view = adapter_gl_create_unordered_access_view,
.adapter_destroy_unordered_access_view = adapter_gl_destroy_unordered_access_view,
.adapter_create_sampler = adapter_gl_create_sampler,
.adapter_destroy_sampler = adapter_gl_destroy_sampler,
.adapter_create_query = adapter_gl_create_query,
.adapter_destroy_query = adapter_gl_destroy_query,
.adapter_flush_context = adapter_gl_flush_context,
.adapter_dispatch_compute = dispatch_compute,
.adapter_clear_uav = adapter_gl_clear_uav,
};
static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_gl, uint32_t wined3d_creation_flags)

View File

@ -1414,6 +1414,12 @@ static void adapter_vk_flush_context(struct wined3d_context *context)
TRACE("context %p.\n", context);
}
static void adapter_vk_dispatch_compute(struct wined3d_device *device,
const struct wined3d_state *state, const struct wined3d_dispatch_parameters *parameters)
{
FIXME("device %p, state %p, parameters %p.\n", device, state, parameters);
}
void adapter_vk_clear_uav(struct wined3d_context *context,
struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
{
@ -1422,36 +1428,37 @@ void adapter_vk_clear_uav(struct wined3d_context *context,
static const struct wined3d_adapter_ops wined3d_adapter_vk_ops =
{
adapter_vk_destroy,
adapter_vk_create_device,
adapter_vk_destroy_device,
adapter_vk_acquire_context,
adapter_vk_release_context,
adapter_vk_get_wined3d_caps,
adapter_vk_check_format,
adapter_vk_init_3d,
adapter_vk_uninit_3d,
adapter_vk_map_bo_address,
adapter_vk_unmap_bo_address,
adapter_vk_copy_bo_address,
adapter_vk_create_swapchain,
adapter_vk_destroy_swapchain,
adapter_vk_create_buffer,
adapter_vk_destroy_buffer,
adapter_vk_create_texture,
adapter_vk_destroy_texture,
adapter_vk_create_rendertarget_view,
adapter_vk_destroy_rendertarget_view,
adapter_vk_create_shader_resource_view,
adapter_vk_destroy_shader_resource_view,
adapter_vk_create_unordered_access_view,
adapter_vk_destroy_unordered_access_view,
adapter_vk_create_sampler,
adapter_vk_destroy_sampler,
adapter_vk_create_query,
adapter_vk_destroy_query,
adapter_vk_flush_context,
adapter_vk_clear_uav,
.adapter_destroy = adapter_vk_destroy,
.adapter_create_device = adapter_vk_create_device,
.adapter_destroy_device = adapter_vk_destroy_device,
.adapter_acquire_context = adapter_vk_acquire_context,
.adapter_release_context = adapter_vk_release_context,
.adapter_get_wined3d_caps = adapter_vk_get_wined3d_caps,
.adapter_check_format = adapter_vk_check_format,
.adapter_init_3d = adapter_vk_init_3d,
.adapter_uninit_3d = adapter_vk_uninit_3d,
.adapter_map_bo_address = adapter_vk_map_bo_address,
.adapter_unmap_bo_address = adapter_vk_unmap_bo_address,
.adapter_copy_bo_address = adapter_vk_copy_bo_address,
.adapter_create_swapchain = adapter_vk_create_swapchain,
.adapter_destroy_swapchain = adapter_vk_destroy_swapchain,
.adapter_create_buffer = adapter_vk_create_buffer,
.adapter_destroy_buffer = adapter_vk_destroy_buffer,
.adapter_create_texture = adapter_vk_create_texture,
.adapter_destroy_texture = adapter_vk_destroy_texture,
.adapter_create_rendertarget_view = adapter_vk_create_rendertarget_view,
.adapter_destroy_rendertarget_view = adapter_vk_destroy_rendertarget_view,
.adapter_create_shader_resource_view = adapter_vk_create_shader_resource_view,
.adapter_destroy_shader_resource_view = adapter_vk_destroy_shader_resource_view,
.adapter_create_unordered_access_view = adapter_vk_create_unordered_access_view,
.adapter_destroy_unordered_access_view = adapter_vk_destroy_unordered_access_view,
.adapter_create_sampler = adapter_vk_create_sampler,
.adapter_destroy_sampler = adapter_vk_destroy_sampler,
.adapter_create_query = adapter_vk_create_query,
.adapter_destroy_query = adapter_vk_destroy_query,
.adapter_flush_context = adapter_vk_flush_context,
.adapter_dispatch_compute = adapter_vk_dispatch_compute,
.adapter_clear_uav = adapter_vk_clear_uav,
};
static unsigned int wined3d_get_wine_vk_version(void)

View File

@ -785,7 +785,7 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
const struct wined3d_cs_dispatch *op = data;
struct wined3d_state *state = &cs->state;
dispatch_compute(cs->device, state, &op->parameters);
cs->device->adapter->adapter_ops->adapter_dispatch_compute(cs->device, state, &op->parameters);
if (op->parameters.indirect)
wined3d_resource_release(&op->parameters.u.indirect.buffer->resource);

View File

@ -2843,6 +2843,12 @@ static void adapter_no3d_flush_context(struct wined3d_context *context)
TRACE("context %p.\n", context);
}
static void adapter_no3d_dispatch_compute(struct wined3d_device *device,
const struct wined3d_state *state, const struct wined3d_dispatch_parameters *parameters)
{
ERR("device %p, state %p, parameters %p.\n", device, state, parameters);
}
void adapter_no3d_clear_uav(struct wined3d_context *context,
struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
{
@ -2851,36 +2857,37 @@ void adapter_no3d_clear_uav(struct wined3d_context *context,
static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops =
{
adapter_no3d_destroy,
adapter_no3d_create_device,
adapter_no3d_destroy_device,
adapter_no3d_acquire_context,
adapter_no3d_release_context,
adapter_no3d_get_wined3d_caps,
adapter_no3d_check_format,
adapter_no3d_init_3d,
adapter_no3d_uninit_3d,
adapter_no3d_map_bo_address,
adapter_no3d_unmap_bo_address,
adapter_no3d_copy_bo_address,
adapter_no3d_create_swapchain,
adapter_no3d_destroy_swapchain,
adapter_no3d_create_buffer,
adapter_no3d_destroy_buffer,
adapter_no3d_create_texture,
adapter_no3d_destroy_texture,
adapter_no3d_create_rendertarget_view,
adapter_no3d_destroy_rendertarget_view,
adapter_no3d_create_shader_resource_view,
adapter_no3d_destroy_shader_resource_view,
adapter_no3d_create_unordered_access_view,
adapter_no3d_destroy_unordered_access_view,
adapter_no3d_create_sampler,
adapter_no3d_destroy_sampler,
adapter_no3d_create_query,
adapter_no3d_destroy_query,
adapter_no3d_flush_context,
adapter_no3d_clear_uav,
.adapter_destroy = adapter_no3d_destroy,
.adapter_create_device = adapter_no3d_create_device,
.adapter_destroy_device = adapter_no3d_destroy_device,
.adapter_acquire_context = adapter_no3d_acquire_context,
.adapter_release_context = adapter_no3d_release_context,
.adapter_get_wined3d_caps = adapter_no3d_get_wined3d_caps,
.adapter_check_format = adapter_no3d_check_format,
.adapter_init_3d = adapter_no3d_init_3d,
.adapter_uninit_3d = adapter_no3d_uninit_3d,
.adapter_map_bo_address = adapter_no3d_map_bo_address,
.adapter_unmap_bo_address = adapter_no3d_unmap_bo_address,
.adapter_copy_bo_address = adapter_no3d_copy_bo_address,
.adapter_create_swapchain = adapter_no3d_create_swapchain,
.adapter_destroy_swapchain = adapter_no3d_destroy_swapchain,
.adapter_create_buffer = adapter_no3d_create_buffer,
.adapter_destroy_buffer = adapter_no3d_destroy_buffer,
.adapter_create_texture = adapter_no3d_create_texture,
.adapter_destroy_texture = adapter_no3d_destroy_texture,
.adapter_create_rendertarget_view = adapter_no3d_create_rendertarget_view,
.adapter_destroy_rendertarget_view = adapter_no3d_destroy_rendertarget_view,
.adapter_create_shader_resource_view = adapter_no3d_create_shader_resource_view,
.adapter_destroy_shader_resource_view = adapter_no3d_destroy_shader_resource_view,
.adapter_create_unordered_access_view = adapter_no3d_create_unordered_access_view,
.adapter_destroy_unordered_access_view = adapter_no3d_destroy_unordered_access_view,
.adapter_create_sampler = adapter_no3d_create_sampler,
.adapter_destroy_sampler = adapter_no3d_destroy_sampler,
.adapter_create_query = adapter_no3d_create_query,
.adapter_destroy_query = adapter_no3d_destroy_query,
.adapter_flush_context = adapter_no3d_flush_context,
.adapter_dispatch_compute = adapter_no3d_dispatch_compute,
.adapter_clear_uav = adapter_no3d_clear_uav,
};
static void wined3d_adapter_no3d_init_d3d_info(struct wined3d_adapter *adapter, unsigned int wined3d_creation_flags)

View File

@ -3031,6 +3031,8 @@ struct wined3d_adapter_ops
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query);
void (*adapter_destroy_query)(struct wined3d_query *query);
void (*adapter_flush_context)(struct wined3d_context *context);
void (*adapter_dispatch_compute)(struct wined3d_device *device, const struct wined3d_state *state,
const struct wined3d_dispatch_parameters *parameters);
void (*adapter_clear_uav)(struct wined3d_context *context,
struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value);
};