From ea5624e5e866caac25bdf79c3c5b6c7925d0b481 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 28 Jul 2023 16:14:13 +1000 Subject: [PATCH] vkd3d-shader/dxil: Emit bool inputs and outputs as uint. DXIL reads/writes uint for these. --- libs/vkd3d-shader/dxil.c | 4 ++++ tests/hlsl/bool-semantics.shader_test | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 811a7c97..ab165910 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -9387,6 +9387,10 @@ static enum vkd3d_result sm6_parser_read_signature(struct sm6_parser *sm6, const e->used_mask <<= index; } + /* DXIL reads/writes uint for bool I/O. */ + if (e->component_type == VKD3D_SHADER_COMPONENT_BOOL) + e->component_type = VKD3D_SHADER_COMPONENT_UINT; + m = element_node->operands[4]; if (!sm6_metadata_value_is_node(m)) { diff --git a/tests/hlsl/bool-semantics.shader_test b/tests/hlsl/bool-semantics.shader_test index af945397..0214e957 100644 --- a/tests/hlsl/bool-semantics.shader_test +++ b/tests/hlsl/bool-semantics.shader_test @@ -49,5 +49,5 @@ float4 main(struct input i) : sv_target } [test] -todo(sm>=6 | glsl) draw triangle strip 4 +todo(glsl) draw triangle strip 4 probe all rgba (0.0, 2.0, 2.0, 2.0)