[PATCH vkd3d 5/7] vkd3d-shader/hlsl: Write SM4 casts to float.

Giovanni Mascellani gmascellani at codeweavers.com
Wed Sep 15 02:34:42 CDT 2021


Hi,

Il 15/09/21 09:27, Matteo Bruni ha scritto:
> Yeah, we do want to have true as ~0u for SM4+ (there is no real bool
> type in < SM4, so that doesn't matter). There is no reason to do
> things differently and there might be some other unexpected way for
> the internal representation of true to leak in a visible manner.

Ok, I got convinced by this:

   http://shader-playground.timjones.io/a33fbc87153ccd6774030f11d005ad1a

Which BTW means that either we store true as ~0u, or we convert it when 
returning a bool from a function, and at that point it's easier to just 
store ~0u.

On the other hand, the same example means that strictly speaking we also 
have to canonicalize bools which the shader receives as parameters.

I'll fix my patches.

Giovanni.



More information about the wine-devel mailing list