vkd3d-utils: Detect surface extensions at runtime.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-08-21 18:08:06 +02:00 committed by Alexandre Julliard
parent dc2dbffc2c
commit ccdb692741
3 changed files with 15 additions and 11 deletions

View File

@ -106,7 +106,6 @@ libvkd3d_utils_la_SOURCES = \
libs/vkd3d-utils/vkd3d_utils.map \
libs/vkd3d-utils/vkd3d_utils_main.c \
libs/vkd3d-utils/vkd3d_utils_private.h
libvkd3d_utils_la_CFLAGS = @XCB_CFLAGS@
libvkd3d_utils_la_LDFLAGS = -version-info 1:0:0
libvkd3d_utils_la_LIBADD = libvkd3d-common.la libvkd3d.la
if HAVE_LD_VERSION_SCRIPT

View File

@ -28,15 +28,18 @@ HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug)
HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter,
D3D_FEATURE_LEVEL minimum_feature_level, REFIID iid, void **device)
{
struct vkd3d_optional_instance_extensions_info optional_extensions_info;
struct vkd3d_instance_create_info instance_create_info;
struct vkd3d_device_create_info device_create_info;
static const char * const instance_extensions[] =
{
VK_KHR_SURFACE_EXTENSION_NAME,
#ifdef HAVE_XCB
VK_KHR_XCB_SURFACE_EXTENSION_NAME,
#endif
};
static const char * const optional_instance_extensions[] =
{
"VK_KHR_xcb_surface",
"VK_MVK_macos_surface",
};
static const char * const device_extensions[] =
{
@ -49,9 +52,14 @@ HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter,
if (adapter)
FIXME("Ignoring adapter %p.\n", adapter);
memset(&optional_extensions_info, 0, sizeof(optional_extensions_info));
optional_extensions_info.type = VKD3D_STRUCTURE_TYPE_OPTIONAL_INSTANCE_EXTENSIONS_INFO;
optional_extensions_info.extensions = optional_instance_extensions;
optional_extensions_info.extension_count = ARRAY_SIZE(optional_instance_extensions);
memset(&instance_create_info, 0, sizeof(instance_create_info));
instance_create_info.type = VKD3D_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
instance_create_info.next = NULL;
instance_create_info.next = &optional_extensions_info;
instance_create_info.pfn_signal_event = vkd3d_signal_event;
instance_create_info.wchar_size = sizeof(WCHAR);
instance_create_info.instance_extensions = instance_extensions;

View File

@ -19,19 +19,16 @@
#ifndef __VKD3D_UTILS_PRIVATE_H
#define __VKD3D_UTILS_PRIVATE_H
#include "vkd3d_memory.h"
#include <vkd3d_utils.h>
#define COBJMACROS
#define NONAMELESSUNION
#define VK_NO_PROTOTYPES
#ifdef HAVE_XCB
# define VK_USE_PLATFORM_XCB_KHR
#endif
#include <pthread.h>
#include <vkd3d.h>
#include "vkd3d_memory.h"
#include <vkd3d_utils.h>
struct vkd3d_event
{
pthread_mutex_t mutex;