Module: vkd3d Branch: master Commit: def87539de122956d9464664a61ef32f3b506bb0 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/def87539de122956d9464664a61ef3...
Author: Conor McCarthy cmccarthy@codeweavers.com Date: Wed Apr 24 12:23:27 2024 +1000
vkd3d-shader/dxil: Delete bool not-equal-to-false comparison instructions.
---
libs/vkd3d-shader/dxil.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index ab165910..22fdcf9f 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -6726,6 +6726,15 @@ static void sm6_parser_emit_cmp2(struct sm6_parser *sm6, const struct dxil_recor
code = record->operands[i++];
+ /* dxcompiler occasionally emits bool not-equal-to-false, which is a no-op. Bool comparisons + * do not otherwise occur, so deleting these avoids the need for backend support. */ + if (sm6_type_is_bool(type_a) && code == ICMP_NE && sm6_value_is_constant_zero(b)) + { + ins->handler_idx = VKD3DSIH_NOP; + *dst = *a; + return; + } + if ((!is_int && !is_fp) || is_int != (code >= ICMP_EQ)) { FIXME("Invalid operation %"PRIu64" on type class %u.\n", code, type_a->class);