[PATCH vkd3d 3/6] vkd3d-shader: Write SM1 constant definitions.

Henri Verbeet hverbeet at gmail.com
Thu Apr 22 07:22:08 CDT 2021


On Wed, 21 Apr 2021 at 06:30, Zebediah Figura <zfigura at codeweavers.com> wrote:
> +#define D3DSP_REGTYPE_SHIFT     28
> +#define D3DSP_REGTYPE_SHIFT2    8
> +#define D3DSP_REGTYPE_MASK      (0x7 << D3DSP_REGTYPE_SHIFT)

It ends up working out here, but note that shifting signed integers
produces implementation defined or undefined results in various cases.
(We have -Wshift-overflow for that in Wine; I think for vkd3d it's
enabled implicitly by -std=c99) It's generally best to make mask
constants explicitly unsigned for that reason. On the other hand,
these being signed probably matches the PSDK, so perhaps we don't
care.



More information about the wine-devel mailing list