vkd3d-shader/hlsl: Add some swizzle manipulation definitions.

This commit is contained in:
Zebediah Figura
2023-01-12 15:52:49 -06:00
committed by Alexandre Julliard
parent 337b4c5db0
commit 8fd30aa87d
Notes: Alexandre Julliard 2023-01-24 22:27:58 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/51
4 changed files with 15 additions and 11 deletions

View File

@@ -63,6 +63,14 @@
| ((HLSL_SWIZZLE_ ## z) << 4) \
| ((HLSL_SWIZZLE_ ## w) << 6))
#define HLSL_SWIZZLE_MASK (0x3u)
#define HLSL_SWIZZLE_SHIFT(idx) (2u * (idx))
static inline unsigned int hlsl_swizzle_get_component(unsigned int swizzle, unsigned int idx)
{
return (swizzle >> HLSL_SWIZZLE_SHIFT(idx)) & HLSL_SWIZZLE_MASK;
}
enum hlsl_type_class
{
HLSL_CLASS_SCALAR,