vkd3d-shader/hlsl: Lower narrowing casts to swizzles.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@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-12-01 17:14:56 +01:00
committed by Alexandre Julliard
parent 0a4e948453
commit a33439f1a0
3 changed files with 43 additions and 10 deletions

View File

@@ -1298,9 +1298,8 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
{
const struct hlsl_type *src_type = arg1->data_type;
/* Narrowing casts need to be lowered. */
if (src_type->dimx != expr->node.data_type->dimx)
hlsl_fixme(ctx, expr->node.loc, "Narrowing cast.\n");
/* Narrowing casts were already lowered. */
assert(src_type->dimx == expr->node.data_type->dimx);
switch (src_type->base_type)
{
@@ -1388,9 +1387,8 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
{
const struct hlsl_type *src_type = arg1->data_type;
/* Narrowing casts need to be lowered. */
if (src_type->dimx != expr->node.data_type->dimx)
hlsl_fixme(ctx, expr->node.loc, "Narrowing cast.");
/* Narrowing casts were already lowered. */
assert(src_type->dimx == expr->node.data_type->dimx);
switch (src_type->base_type)
{
@@ -1433,9 +1431,8 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
{
const struct hlsl_type *src_type = arg1->data_type;
/* Narrowing casts need to be lowered. */
if (src_type->dimx != expr->node.data_type->dimx)
hlsl_fixme(ctx, expr->node.loc, "SM4 narrowing cast.\n");
/* Narrowing casts were already lowered. */
assert(src_type->dimx == expr->node.data_type->dimx);
switch (src_type->base_type)
{