[PATCH vkd3d] vkd3d-shader/preproc: Allow capital U and L after integer constants as well.

Zebediah Figura (she/her) zfigura at codeweavers.com
Thu Jan 13 11:03:46 CST 2022


On 1/13/22 08:21, Giovanni Mascellani wrote:
> Hi,
> 
> just a couple of curiosities:
> 
> Il 11/01/22 00:48, Zebediah Figura ha scritto:
>> +[preproc]
>> +#if 2uL == 2
>> +pass
>> +#else
>> +fail
>> +#endif
> 
> What's the point of the "fail" branch? If the shader doesn't produce 
> "pass" it's already considered failing, isn't it?

The native preprocessor has the excellent behaviour of emitting an error 
when unable to parse an if condition and then outputting both branches 
without actually failing compilation. Which is to say that it emits a 
warning, only it uses the word "error".

We don't replicate this behaviour (yet).

Writing the test in this form validates both that native can actually 
parse the condition and that it's true.

> 
>> +[preproc]
>> +#if 012lu == 10
>> +pass
>> +#endif
> 
> And why doesn't this have the "fail" branch?

Mostly because I was less worried about the idea that native couldn't 
parse the token when I wrote it.



More information about the wine-devel mailing list