[PATCH vkd3d 4/6] vkd3d-shader/hlsl: Allow values different from one in bools.
Giovanni Mascellani
gmascellani at codeweavers.com
Fri Mar 25 02:53:06 CDT 2022
Hi,
Il 24/03/22 20:59, Francisco Casas ha scritto:
> But, if I am not mistaken, bool expands to _Bool (because we are including <stdbool.h>).
> And I don't see any point in the program were we may be assigning .b a value that's
> not 0 or 1.
> Given that in C, when an scalar is converted to _Bool, it automatically becomes 0 or 1.
Yeah, it's pretty obvious I got a bit confused about patches 4-6/6. Part
of the reason is that in the development branch we've got a patch which
gets rid of .b and uses .i instead. This makes sense to me, because it
allows us to represent true with 0xffffffff without tripping on the fact
that sizeof(bool) == 1. Quite evidently my effort to port my patches
from that convention to the one currently in master failed spectacularly.
So I'd retract patches 4-6/6 and resubmit them on top of that change
(getting rid of .b), which I assume we wanted upstreamed as well (if
not, please let me know).
Actually, it seem more appropriate to use .u instead of .i: first,
because I find it more straight forward to think a bool as unsigned
rather than signed; second, because if makes true > false, which I think
is aligned with HLSL.
Thanks for the feedback, Giovanni.
More information about the wine-devel
mailing list