mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/d3dbc: Add an option to treat doubles as floats.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55448 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Henri Verbeet
parent
d7def84253
commit
799e6105a4
Notes:
Henri Verbeet
2024-09-23 15:55:06 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1025
@@ -6622,7 +6622,13 @@ static bool sm1_generate_vsir_instr_expr_cast(struct hlsl_ctx *ctx,
|
||||
return true;
|
||||
|
||||
case HLSL_TYPE_DOUBLE:
|
||||
hlsl_fixme(ctx, &instr->loc, "SM1 cast from double to float.");
|
||||
if (ctx->double_as_float_alias)
|
||||
{
|
||||
sm1_generate_vsir_instr_expr_single_instr_op(ctx, program, expr, VKD3DSIH_MOV, 0, 0, true);
|
||||
return true;
|
||||
}
|
||||
hlsl_error(ctx, &instr->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
|
||||
"The 'double' type is not supported for the %s profile.", ctx->profile->name);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -6660,7 +6666,22 @@ static bool sm1_generate_vsir_instr_expr_cast(struct hlsl_ctx *ctx,
|
||||
break;
|
||||
|
||||
case HLSL_TYPE_DOUBLE:
|
||||
hlsl_fixme(ctx, &instr->loc, "SM1 cast to double.");
|
||||
switch (src_type->e.numeric.type)
|
||||
{
|
||||
case HLSL_TYPE_FLOAT:
|
||||
if (ctx->double_as_float_alias)
|
||||
{
|
||||
sm1_generate_vsir_instr_expr_single_instr_op(ctx, program, expr, VKD3DSIH_MOV, 0, 0, true);
|
||||
return true;
|
||||
}
|
||||
hlsl_error(ctx, &instr->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
|
||||
"The 'double' type is not supported for the %s profile.", ctx->profile->name);
|
||||
break;
|
||||
|
||||
default:
|
||||
hlsl_fixme(ctx, &instr->loc, "SM1 cast to double.");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case HLSL_TYPE_BOOL:
|
||||
|
Reference in New Issue
Block a user