Henri Verbeet : vkd3d-shader: Introduce a helper to print d3d-asm boolean literals.

Alexandre Julliard julliard at winehq.org
Thu Feb 18 15:48:05 CST 2021


Module: vkd3d
Branch: master
Commit: 54092b944cc7f5938909fa5ddd406d14028d5d7f
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=54092b944cc7f5938909fa5ddd406d14028d5d7f

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Feb 18 11:24:01 2021 +0100

vkd3d-shader: Introduce a helper to print d3d-asm boolean literals.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d-shader/trace.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
index 30f7bc1..bb5c373 100644
--- a/libs/vkd3d-shader/trace.c
+++ b/libs/vkd3d-shader/trace.c
@@ -726,6 +726,12 @@ static void shader_print_hex_literal(struct vkd3d_d3d_asm_compiler *compiler,
     vkd3d_string_buffer_printf(&compiler->buffer, "%s0x%08x%s", prefix, i, suffix);
 }
 
+static void shader_print_bool_literal(struct vkd3d_d3d_asm_compiler *compiler,
+        const char *prefix, unsigned int b, const char *suffix)
+{
+    vkd3d_string_buffer_printf(&compiler->buffer, "%s%s%s", prefix, b ? "true" : "false", suffix);
+}
+
 static void shader_print_subscript(struct vkd3d_d3d_asm_compiler *compiler,
         unsigned int offset, const struct vkd3d_shader_src_param *rel_addr)
 {
@@ -1601,9 +1607,9 @@ static void shader_dump_instruction(struct vkd3d_d3d_asm_compiler *compiler,
             break;
 
         case VKD3DSIH_DEFB:
-            vkd3d_string_buffer_printf(buffer, " %sb%u%s = %s", compiler->colours.reg,
-                    ins->dst[0].reg.idx[0].offset, compiler->colours.reset,
-                    ins->src[0].reg.u.immconst_uint[0] ? "true" : "false");
+            vkd3d_string_buffer_printf(buffer, " %sb%u%s", compiler->colours.reg,
+                    ins->dst[0].reg.idx[0].offset, compiler->colours.reset);
+            shader_print_bool_literal(compiler, " = ", ins->src[0].reg.u.immconst_uint[0], "");
             break;
 
         default:




More information about the wine-cvs mailing list