[PATCH 3/5] d3dcompiler: Coerce the RHS before unwrapping swizzles.

Zebediah Figura zfigura at codeweavers.com
Fri Jun 5 10:05:04 CDT 2020


On 6/5/20 4:41 AM, Matteo Bruni wrote:
> On Thu, Jun 4, 2020 at 4:12 AM Zebediah Figura <z.figura12 at gmail.com> wrote:
>>
>> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
>> ---
>>  dlls/d3dcompiler_43/utils.c | 43 +++++++++++--------------------------
>>  1 file changed, 12 insertions(+), 31 deletions(-)
> 
> This patch is a clear improvement and the dropped FIXME() didn't
> really make sense given that, if you have a swizzle on the lhs, that
> means you have a vector.
> 
> Still, you can have matrix swizzles and those aren't handled correctly
> yet. One nasty example (which could be a test):
> 
> float4 main() : COLOR
> {
>     float4x4 ret = float4x4(0.0, 0.0, 0.0, 0.0,
>             0.0, 0.0, 0.0, 0.0,
>             0.0, 0.0, 0.0, 0.0,
>             0.0, 0.0, 0.0, 0.0);
>     ret._11_22_33 = float3(0.1, 0.2, 0.3);
>     return ret[0];
> }
> 
> Nothing you need to care about right now, clearly (and probably not
> something that you'd handle in this area of the compiler either), just
> putting it out there for another day...
> 

Ech, you're right, and actually, the FIXME was sort of valid, although
the complex logic around writemasks probably threw it off: after we've
unwrapped all the swizzles from the lhs and converted them to
writemasks, what remains is either a vector or a matrix.

Not that I've forgotten we don't handle matrix swizzles, but I did
forget to retain that FIXME in the patch. I'll send a follow-up.



More information about the wine-devel mailing list