vkd3d-shader/hlsl: Treat half as float for casts.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2023-04-05 00:09:55 +02:00 committed by Alexandre Julliard
parent c190c184ce
commit 24c1eb562f
Notes: Alexandre Julliard 2023-04-06 22:23:27 +02:00
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/145
2 changed files with 3 additions and 6 deletions

View File

@ -1581,6 +1581,7 @@ static void write_sm4_cast(struct hlsl_ctx *ctx,
switch (dst_type->base_type)
{
case HLSL_TYPE_HALF:
case HLSL_TYPE_FLOAT:
switch (src_type->base_type)
{
@ -1662,10 +1663,6 @@ static void write_sm4_cast(struct hlsl_ctx *ctx,
}
break;
case HLSL_TYPE_HALF:
hlsl_fixme(ctx, &expr->node.loc, "SM4 cast to half.");
break;
case HLSL_TYPE_DOUBLE:
hlsl_fixme(ctx, &expr->node.loc, "SM4 cast to double.");
break;

View File

@ -1,7 +1,7 @@
[require]
shader model >= 4.0
[pixel shader todo]
[pixel shader]
float4 main(uniform int i, uniform uint u, uniform bool b, uniform float f) : sv_target
{
@ -13,7 +13,7 @@ uniform 0 int -1
uniform 1 uint 3
uniform 2 int -2
uniform 3 float 0.5
todo draw quad
draw quad
probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader]