From: Francisco Casas fcasas@codeweavers.com
lower_narrowing_casts() currently creates a new cast calling hlsl_new_cast(). This cast may be redudant, but it is not folded, which is making SM1 emit an unnecessary fixme in some shaders:
Aborting due to not yet implemented feature: SM1 "cast" expression.
Other passes that call hlsl_new_cast() are lower_int_division() and lower_int_modulus(), so the new fold_redudant_casts() pass is called after these as well. --- libs/vkd3d-shader/hlsl_codegen.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 2b6c595a..7cafc84b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -3929,6 +3929,7 @@ int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry hlsl_transform_ir(ctx, lower_int_modulus, body, NULL); hlsl_transform_ir(ctx, lower_int_abs, body, NULL); hlsl_transform_ir(ctx, lower_float_modulus, body, NULL); + hlsl_transform_ir(ctx, fold_redundant_casts, body, NULL); do { progress = hlsl_transform_ir(ctx, hlsl_fold_constant_exprs, body, NULL);