vkd3d-shader: Introduce vkd3d_make_u{16, 32}() helpers.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2021-08-09 21:56:18 -05:00
committed by Alexandre Julliard
parent 2dedc937a0
commit ed7cdb3940
4 changed files with 18 additions and 8 deletions

View File

@@ -26,6 +26,7 @@
#include <ctype.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h>
@@ -145,6 +146,16 @@ static inline bool vkd3d_bound_range(size_t start, size_t count, size_t limit)
#endif
}
static inline uint16_t vkd3d_make_u16(uint8_t low, uint8_t high)
{
return low | ((uint16_t)high << 8);
}
static inline uint32_t vkd3d_make_u32(uint16_t low, uint16_t high)
{
return low | ((uint32_t)high << 16);
}
static inline int ascii_isupper(int c)
{
return 'A' <= c && c <= 'Z';