[PATCH 0/1] MR226: vkd3d-shader/hlsl: Fold redudant casts again after lower narrowing casts.
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. This is the only thing left required for the HLSL compiler to properly compile the SONIC CD shaders. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/226
From: Francisco Casas <fcasas(a)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); -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/226
This merge request was approved by Zebediah Figura. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/226
This merge request was approved by Giovanni Mascellani. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/226
This merge request was approved by Henri Verbeet. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/226
participants (5)
-
Francisco Casas -
Francisco Casas (@fcasas) -
Giovanni Mascellani (@giomasce) -
Henri Verbeet (@hverbeet) -
Zebediah Figura (@zfigura)