vkd3d-shader/hlsl: Store constant values as an array of unions.

This allows us to more easily manipulate individual elements in a type-agnostic
way. For example, it allows easier implementation of constant swizzle folding.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2021-09-20 16:40:10 -05:00
committed by Alexandre Julliard
parent e2b57f6d2b
commit b4e301b2d8
5 changed files with 37 additions and 32 deletions

View File

@@ -374,14 +374,14 @@ struct hlsl_ir_store
struct hlsl_ir_constant
{
struct hlsl_ir_node node;
union
union hlsl_constant_value
{
unsigned u[4];
int i[4];
float f[4];
double d[4];
bool b[4];
} value;
uint32_t u;
int32_t i;
float f;
double d;
bool b;
} value[4];
struct hlsl_reg reg;
};