wined3d: Create the default samplers in adapter_vk_init_3d().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2019-08-19 16:24:31 +04:30 committed by Alexandre Julliard
parent 7ac8b0f9a7
commit 591adce8c1
3 changed files with 14 additions and 5 deletions

View File

@ -443,6 +443,8 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
return E_FAIL;
}
wined3d_device_create_default_samplers(device, &context_vk->c);
return WINED3D_OK;
}
@ -453,14 +455,17 @@ static void adapter_vk_uninit_3d(struct wined3d_device *device)
TRACE("device %p.\n", device);
context_vk = &wined3d_device_vk(device)->context_vk;
LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry)
{
device->shader_backend->shader_destroy(shader);
}
wined3d_device_destroy_default_samplers(device, &context_vk->c);
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);

View File

@ -840,7 +840,7 @@ static void wined3d_device_gl_destroy_dummy_textures(struct wined3d_device_gl *d
}
/* Context activation is done by the caller. */
static void create_default_samplers(struct wined3d_device *device, struct wined3d_context *context)
void wined3d_device_create_default_samplers(struct wined3d_device *device, struct wined3d_context *context)
{
struct wined3d_sampler_desc desc;
HRESULT hr;
@ -888,7 +888,7 @@ static void create_default_samplers(struct wined3d_device *device, struct wined3
}
/* Context activation is done by the caller. */
static void destroy_default_samplers(struct wined3d_device *device, struct wined3d_context *context)
void wined3d_device_destroy_default_samplers(struct wined3d_device *device, struct wined3d_context *context)
{
wined3d_sampler_decref(device->default_sampler);
device->default_sampler = NULL;
@ -973,7 +973,7 @@ void wined3d_device_delete_opengl_contexts_cs(void *object)
device->blitter->ops->blitter_destroy(device->blitter, context);
device->shader_backend->shader_free_private(device, context);
wined3d_device_gl_destroy_dummy_textures(device_gl, context_gl);
destroy_default_samplers(device, context);
wined3d_device_destroy_default_samplers(device, context);
context_release(context);
while (device->context_count)
@ -1025,7 +1025,7 @@ void wined3d_device_create_primary_opengl_context_cs(void *object)
context_gl = wined3d_context_gl(context);
wined3d_device_gl_create_dummy_textures(wined3d_device_gl(device), context_gl);
create_default_samplers(device, context);
wined3d_device_create_default_samplers(device, context);
context_release(context);
}

View File

@ -3309,8 +3309,12 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void device_context_remove(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void wined3d_device_create_default_samplers(struct wined3d_device *device,
struct wined3d_context *context) DECLSPEC_HIDDEN;
void wined3d_device_create_primary_opengl_context_cs(void *object) DECLSPEC_HIDDEN;
void wined3d_device_delete_opengl_contexts_cs(void *object) DECLSPEC_HIDDEN;
void wined3d_device_destroy_default_samplers(struct wined3d_device *device,
struct wined3d_context *context) DECLSPEC_HIDDEN;
HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined3d,
unsigned int adapter_idx, enum wined3d_device_type device_type, HWND focus_window, unsigned int flags,
BYTE surface_alignment, const enum wined3d_feature_level *levels, unsigned int level_count,