vkd3d: Introduce API versions.

For backwards compatibility. Newer vkd3d versions may report more
capabilities, but some of those may also require newer vkd3d APIs in order to
use them. That's an issue for a vkd3d user like Wine, where reporting more
capabilities may cause the application to try to use APIs that are not
implemented in that version of Wine.

Note that using ELF symbol versioning would have solved the issue for existing
binaries compiled against older versions of vkd3d, but not for older source
compiled against newer versions of vkd3d.

Users of vkd3d-utils should define VKD3D_UTILS_API_VERSION to the vkd3d
API version they wish to target.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet
2020-06-30 15:02:04 +04:30
committed by Alexandre Julliard
parent 11980c3944
commit 3777eb4e5c
9 changed files with 52 additions and 6 deletions

View File

@ -58,9 +58,16 @@ static HRESULT signal_event(HANDLE event)
return S_OK;
}
static const struct vkd3d_application_info instance_default_application_info =
{
.type = VKD3D_STRUCTURE_TYPE_APPLICATION_INFO,
.api_version = VKD3D_API_VERSION_1_2,
};
static const struct vkd3d_instance_create_info instance_default_create_info =
{
.type = VKD3D_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.next = &instance_default_application_info,
.wchar_size = sizeof(WCHAR),
.pfn_signal_event = signal_event,
};
@ -1078,6 +1085,7 @@ static void test_application_info(void)
app_info.engine_version = 0;
app_info.application_name = NULL;
app_info.application_version = 0;
app_info.api_version = VKD3D_API_VERSION_1_0;
create_info = instance_default_create_info;
create_info.next = &app_info;