vkd3d: Parse patch version of PACKAGE_NAME as well.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
parent
adf0be5bf1
commit
f67f55827e
|
@ -231,16 +231,19 @@ static inline bool is_power_of_two(unsigned int x)
|
||||||
return x && !(x & (x -1));
|
return x && !(x & (x -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void vkd3d_parse_version(const char *version, int *major, int *minor)
|
static inline void vkd3d_parse_version(const char *version, int *major, int *minor, int *patch)
|
||||||
{
|
{
|
||||||
*major = atoi(version);
|
char *end;
|
||||||
|
|
||||||
while (isdigit(*version))
|
*major = strtol(version, &end, 10);
|
||||||
++version;
|
version = end;
|
||||||
if (*version == '.')
|
if (*version == '.')
|
||||||
++version;
|
++version;
|
||||||
|
*minor = strtol(version, &end, 10);
|
||||||
*minor = atoi(version);
|
version = end;
|
||||||
|
if (*version == '.')
|
||||||
|
++version;
|
||||||
|
*patch = strtol(version, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t float_bits_to_uint32(float f)
|
static inline uint32_t float_bits_to_uint32(float f)
|
||||||
|
|
|
@ -48,11 +48,11 @@ static const void *vkd3d_find_struct_(const struct vkd3d_struct *chain,
|
||||||
|
|
||||||
static uint32_t vkd3d_get_vk_version(void)
|
static uint32_t vkd3d_get_vk_version(void)
|
||||||
{
|
{
|
||||||
int major, minor;
|
int major, minor, patch;
|
||||||
|
|
||||||
vkd3d_parse_version(PACKAGE_VERSION, &major, &minor);
|
vkd3d_parse_version(PACKAGE_VERSION, &major, &minor, &patch);
|
||||||
INFO("vkd3d-proton - applicationVersion: %d.%d.0.\n", major, minor);
|
INFO("vkd3d-proton - applicationVersion: %d.%d.%d.\n", major, minor, patch);
|
||||||
return VK_MAKE_VERSION(major, minor, 0);
|
return VK_MAKE_VERSION(major, minor, patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct vkd3d_optional_extension_info
|
struct vkd3d_optional_extension_info
|
||||||
|
|
Loading…
Reference in New Issue