wined3d: Add a supported extensions array to the wined3d_vk_info structure.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-05-18 20:22:46 +04:30 committed by Alexandre Julliard
parent a42808b54a
commit 7379451a06
6 changed files with 19 additions and 9 deletions

View File

@ -4313,8 +4313,8 @@ static HRESULT adapter_gl_create_device(struct wined3d *wined3d, const struct wi
if (!(device_gl = heap_alloc_zero(sizeof(*device_gl))))
return E_OUTOFMEMORY;
if (FAILED(hr = wined3d_device_init(&device_gl->d, wined3d, adapter->ordinal, device_type,
focus_window, flags, surface_alignment, levels, level_count, device_parent)))
if (FAILED(hr = wined3d_device_init(&device_gl->d, wined3d, adapter->ordinal, device_type, focus_window,
flags, surface_alignment, levels, level_count, adapter->gl_info.supported, device_parent)))
{
WARN("Failed to initialize device, hr %#x.\n", hr);
heap_free(device_gl);

View File

@ -477,8 +477,8 @@ static HRESULT adapter_vk_create_device(struct wined3d *wined3d, const struct wi
goto fail;
}
if (FAILED(hr = wined3d_device_init(&device_vk->d, wined3d, adapter->ordinal, device_type,
focus_window, flags, surface_alignment, levels, level_count, device_parent)))
if (FAILED(hr = wined3d_device_init(&device_vk->d, wined3d, adapter->ordinal, device_type, focus_window,
flags, surface_alignment, levels, level_count, vk_info->supported, device_parent)))
{
WARN("Failed to initialize device, hr %#x.\n", hr);
wined3d_allocator_cleanup(&device_vk->allocator);
@ -1745,6 +1745,9 @@ static BOOL wined3d_init_vulkan(struct wined3d_vk_info *vk_info)
if (!enable_vulkan_instance_extensions(&instance_info.enabledExtensionCount, enabled_instance_extensions, vk_info))
goto fail;
memset(vk_info->supported, 0, sizeof(vk_info->supported));
vk_info->supported[WINED3D_VK_EXT_NONE] = TRUE;
if ((vr = VK_CALL(vkCreateInstance(&instance_info, NULL, &instance))) < 0)
{
WARN("Failed to create Vulkan instance, vr %s.\n", wined3d_debug_vkresult(vr));

View File

@ -5676,7 +5676,7 @@ static BOOL wined3d_select_feature_level(const struct wined3d_adapter *adapter,
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,
struct wined3d_device_parent *device_parent)
const BOOL *supported_extensions, struct wined3d_device_parent *device_parent)
{
struct wined3d_adapter *adapter = wined3d->adapters[adapter_idx];
const struct wined3d_fragment_pipe_ops *fragment_pipeline;
@ -5716,7 +5716,7 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined
if (vertex_pipeline->vp_states && fragment_pipeline->states
&& FAILED(hr = compile_state_table(device->state_table, device->multistate_funcs,
&adapter->d3d_info, adapter->gl_info.supported, vertex_pipeline,
&adapter->d3d_info, supported_extensions, vertex_pipeline,
fragment_pipeline, adapter->misc_state_template)))
{
ERR("Failed to compile state table, hr %#x.\n", hr);

View File

@ -2483,8 +2483,8 @@ static HRESULT adapter_no3d_create_device(struct wined3d *wined3d, const struct
if (!(device_no3d = heap_alloc_zero(sizeof(*device_no3d))))
return E_OUTOFMEMORY;
if (FAILED(hr = wined3d_device_init(&device_no3d->d, wined3d, adapter->ordinal, device_type,
focus_window, flags, surface_alignment, levels, level_count, device_parent)))
if (FAILED(hr = wined3d_device_init(&device_no3d->d, wined3d, adapter->ordinal, device_type, focus_window,
flags, surface_alignment, levels, level_count, adapter->gl_info.supported, device_parent)))
{
WARN("Failed to initialize device, hr %#x.\n", hr);
heap_free(device_no3d);

View File

@ -3572,7 +3572,7 @@ void wined3d_device_destroy_default_samplers(struct wined3d_device *device,
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,
struct wined3d_device_parent *device_parent) DECLSPEC_HIDDEN;
const BOOL *supported_extensions, struct wined3d_device_parent *device_parent) DECLSPEC_HIDDEN;
LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL unicode,
UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN;
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;

View File

@ -181,6 +181,12 @@ struct vulkan_ops
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
};
enum wined3d_vk_extension
{
WINED3D_VK_EXT_NONE,
WINED3D_VK_EXT_COUNT,
};
struct wined3d_vk_info
{
struct vulkan_ops vk_ops;
@ -188,6 +194,7 @@ struct wined3d_vk_info
VkInstance instance;
unsigned int api_version;
BOOL supported[WINED3D_VK_EXT_COUNT];
#ifdef USE_WIN32_VULKAN
HMODULE vulkan_lib;
#endif