From: Francisco Casas fcasas@codeweavers.com
In SM1, bools are always represented as either 0.0f or 1.0f at runtime. --- libs/vkd3d-shader/d3dbc.c | 7 ++----- tests/hlsl/cast-to-float.shader_test | 4 ++-- tests/hlsl/cast-to-half.shader_test | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index ef33c9722..8f11c48a9 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -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; diff --git a/tests/hlsl/cast-to-float.shader_test b/tests/hlsl/cast-to-float.shader_test index bcb546e2d..d80d42909 100644 --- a/tests/hlsl/cast-to-float.shader_test +++ b/tests/hlsl/cast-to-float.shader_test @@ -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)
diff --git a/tests/hlsl/cast-to-half.shader_test b/tests/hlsl/cast-to-half.shader_test index 0580fe25f..8094a10a3 100644 --- a/tests/hlsl/cast-to-half.shader_test +++ b/tests/hlsl/cast-to-half.shader_test @@ -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)