[PATCH 3/5] wined3d: Setup and tear down the shader backend for the Vulkan adapter.
Henri Verbeet
hverbeet at codeweavers.com
Wed Aug 7 17:47:06 CDT 2019
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/wined3d/adapter_vk.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 50f173f6314..cdb5c977f5d 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -413,9 +413,18 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
return hr;
}
+ if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
+ device->adapter->vertex_pipe, device->adapter->fragment_pipe)))
+ {
+ ERR("Failed to allocate shader private data, hr %#x.\n", hr);
+ wined3d_context_vk_cleanup(context_vk);
+ return hr;
+ }
+
if (!device_context_add(device, &context_vk->c))
{
ERR("Failed to add the newly created context to the context list.\n");
+ device->shader_backend->shader_free_private(device, NULL);
wined3d_context_vk_cleanup(context_vk);
return E_FAIL;
}
@@ -426,6 +435,7 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
{
ERR("Failed to create CPU blitter.\n");
device_context_remove(device, &context_vk->c);
+ device->shader_backend->shader_free_private(device, NULL);
wined3d_context_vk_cleanup(context_vk);
return E_FAIL;
}
@@ -436,13 +446,20 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
static void adapter_vk_uninit_3d(struct wined3d_device *device)
{
struct wined3d_context_vk *context_vk;
+ struct wined3d_shader *shader;
TRACE("device %p.\n", device);
+ LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry)
+ {
+ device->shader_backend->shader_destroy(shader);
+ }
+
device->blitter->ops->blitter_destroy(device->blitter, NULL);
context_vk = &wined3d_device_vk(device)->context_vk;
device_context_remove(device, &context_vk->c);
+ device->shader_backend->shader_free_private(device, NULL);
wined3d_context_vk_cleanup(context_vk);
}
--
2.11.0
More information about the wine-devel
mailing list