mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Use add_cast() in append_conditional_break().
Instead of creating a cast node directly. This specifically handles the 1x1 matrix case, which currently the backend code does not expect.
This commit is contained in:
committed by
Henri Verbeet
parent
1e97e1203f
commit
b2cddecfc5
Notes:
Henri Verbeet
2024-09-23 15:57:02 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1099
@@ -489,9 +489,10 @@ static bool append_conditional_break(struct hlsl_ctx *ctx, struct hlsl_block *co
|
|||||||
check_condition_type(ctx, condition);
|
check_condition_type(ctx, condition);
|
||||||
|
|
||||||
bool_type = hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL);
|
bool_type = hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL);
|
||||||
if (!(cast = hlsl_new_cast(ctx, condition, bool_type, &condition->loc)))
|
/* We already checked for a 1-component numeric type, so
|
||||||
|
* add_implicit_conversion() is equivalent to add_cast() here. */
|
||||||
|
if (!(cast = add_cast(ctx, cond_block, condition, bool_type, &condition->loc)))
|
||||||
return false;
|
return false;
|
||||||
hlsl_block_add_instr(cond_block, cast);
|
|
||||||
|
|
||||||
if (!(not = hlsl_new_unary_expr(ctx, HLSL_OP1_LOGIC_NOT, cast, &condition->loc)))
|
if (!(not = hlsl_new_unary_expr(ctx, HLSL_OP1_LOGIC_NOT, cast, &condition->loc)))
|
||||||
return false;
|
return false;
|
||||||
|
@@ -102,7 +102,7 @@ float4 main() : sv_target
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[pixel shader todo]
|
[pixel shader]
|
||||||
static const float1x1 f;
|
static const float1x1 f;
|
||||||
float4 main() : sv_target
|
float4 main() : sv_target
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user