vkd3d-shader/hlsl: Don't count cast to param type on IN as part of OUT var's lhs.

If the parameter is HLSL_STORAGE_IN, we add a cast from the arg to the
param type so that it can enter the function, however this cast should
not be considered part of the lhs on the implicit assignment that happens
if the var is also HLSL_STORAGE_OUT.
This commit is contained in:
Francisco Casas
2025-01-20 14:52:47 -03:00
committed by Henri Verbeet
parent b55fe1950e
commit 0a15ab702f
Notes: Henri Verbeet 2025-01-22 15:04:09 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1350
2 changed files with 16 additions and 17 deletions

View File

@@ -3192,20 +3192,19 @@ static struct hlsl_ir_node *add_user_call(struct hlsl_ctx *ctx,
break;
arg = args->args[k];
if (!hlsl_types_are_equal(arg->data_type, param->data_type))
{
struct hlsl_ir_node *cast;
if (!(cast = add_cast(ctx, args->instrs, arg, param->data_type, &arg->loc)))
return NULL;
args->args[k] = cast;
arg = cast;
}
if (param->storage_modifiers & HLSL_STORAGE_IN)
{
struct hlsl_ir_node *store;
if (!hlsl_types_are_equal(arg->data_type, param->data_type))
{
struct hlsl_ir_node *cast;
if (!(cast = add_cast(ctx, args->instrs, arg, param->data_type, &arg->loc)))
return NULL;
arg = cast;
}
if (!(store = hlsl_new_simple_store(ctx, param, arg)))
return NULL;
hlsl_block_add_instr(args->instrs, store);