tests: Add some C HLSL preprocessor tests.

That is, tests in C, for features of the HLSL preprocessor which are difficult
to test using the shader_runner framework.

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
2020-11-24 00:29:59 -06:00
committed by Alexandre Julliard
parent e44f2fbf43
commit ffa7bd39f3
5 changed files with 432 additions and 1 deletions

View File

@@ -120,6 +120,20 @@ static inline unsigned int vkd3d_log2i(unsigned int x)
#endif
}
static inline void *vkd3d_memmem( const void *haystack, size_t haystack_len, const void *needle, size_t needle_len)
{
const char *str = haystack;
while (haystack_len >= needle_len)
{
if (!memcmp(str, needle, needle_len))
return (char *)str;
++str;
--haystack_len;
}
return NULL;
}
static inline int ascii_isupper(int c)
{
return 'A' <= c && c <= 'Z';