mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/d3dbc: Implement bool to float cast as MOV.
In SM1, bools are always represented as either 0.0f or 1.0f at runtime.
This commit is contained in:
parent
747511131d
commit
58c456ff2b
Notes:
Alexandre Julliard
2024-03-06 23:29:16 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/671
@ -1977,16 +1977,13 @@ static void write_sm1_cast(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *b
|
||||
{
|
||||
case HLSL_TYPE_INT:
|
||||
case HLSL_TYPE_UINT:
|
||||
/* Integers are internally represented as floats, so no change is necessary.*/
|
||||
case HLSL_TYPE_BOOL:
|
||||
/* Integrals are internally represented as floats, so no change is necessary.*/
|
||||
case HLSL_TYPE_HALF:
|
||||
case HLSL_TYPE_FLOAT:
|
||||
write_sm1_unary_op(ctx, buffer, D3DSIO_MOV, &instr->reg, &arg1->reg, 0, 0);
|
||||
break;
|
||||
|
||||
case HLSL_TYPE_BOOL:
|
||||
hlsl_fixme(ctx, &instr->loc, "SM1 cast from bool to float.");
|
||||
break;
|
||||
|
||||
case HLSL_TYPE_DOUBLE:
|
||||
hlsl_fixme(ctx, &instr->loc, "SM1 cast from double to float.");
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
[pixel shader todo(sm<4)]
|
||||
[pixel shader]
|
||||
uniform int i;
|
||||
uniform uint u;
|
||||
uniform bool b;
|
||||
@ -18,7 +18,7 @@ if(sm>=4) uniform 0 int -1
|
||||
if(sm>=4) uniform 1 uint 3
|
||||
if(sm>=4) uniform 2 int -2
|
||||
if(sm>=4) uniform 3 float 0.5
|
||||
todo(sm<4) draw quad
|
||||
draw quad
|
||||
probe all rgba (0.5, 0.5, 0.5, 0.5)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
[pixel shader todo(sm<4)]
|
||||
[pixel shader]
|
||||
uniform int i;
|
||||
uniform uint u;
|
||||
uniform bool b;
|
||||
@ -18,7 +18,7 @@ if(sm>=4) uniform 0 int -1
|
||||
if(sm>=4) uniform 1 uint 3
|
||||
if(sm>=4) uniform 2 int -2
|
||||
if(sm>=4) uniform 3 float 0.5
|
||||
todo(sm<4) draw quad
|
||||
draw quad
|
||||
probe all rgba (0.5, 0.5, 0.5, 0.5)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user