mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Add some swizzle manipulation definitions.
This commit is contained in:
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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user