[PATCH 1/5] d3dcompiler: Store the swizzle unshifted.

Matteo Bruni matteo.mystral at gmail.com
Tue Feb 25 11:24:17 CST 2020


On Sat, Feb 15, 2020 at 1:12 PM Francois Gouget <fgouget at free.fr> wrote:
>
>
> It was already the case before but this patch made it more obvious (at
> least to my simple script).
>
> Both BWRITERVS_X_X and D3DVS_X_X are 0:
>
> #define BWRITERVS_X_X   (0)
> #define D3DVS_X_X       (0 << D3DVS_SWIZZLE_SHIFT)
>
> So this line in d3d9_swizzle() from dlls/d3dcompiler_43/bytecodewriter.c
> does nothing at all:
>
>     if ((bwriter_swizzle & BWRITERVS_X_X) == BWRITERVS_X_X) ret |= D3DVS_X_X;
>
> Just to be sure, is this really what was intended?
> I guess having this line is nice for symmetry with the ones that follow
> but would it be better / less confusing to comment it out?

It looks like I haven't replied yet, better late than never I guess...

I don't think there is anything wrong with it. That it does nothing in
practice is just an implementation detail caused by the fact that both
defines are 0, but the user shouldn't need to know that. To me,
commenting it out would be MORE confusing, in fact.

FWIW before this patch the whole function did exactly nothing at all.
But since it was here in the first place we could now change those
defines without having to update all the callers of the function.



More information about the wine-devel mailing list