[PATCH vkd3d 1/5] vkd3d-shader: Partially implement #define.

Zebediah Figura (she/her) zfigura at codeweavers.com
Tue Jan 5 15:42:40 CST 2021


On 1/5/21 1:06 PM, Henri Verbeet wrote:
> On Tue, 5 Jan 2021 at 19:17, Zebediah Figura (she/her)
> <zfigura at codeweavers.com> wrote:
>> Incidentally, the following shader:
>>
>> #define FUNC(a,b) a ## b
>> FUNC(a,
>> #undef FUNC
>> b)
>>
>> yields, with native d3dcompiler_47, the output "FUNC" and an error "not
>> enough actual parameters for macro 'FUNC'".
>>
>> I don't think it'd be very hard to fix up the code to make sure a macro
>> in use can't be moved, but on the other hand it strikes me as
>> unnecessarily fragile (wrt later reading or modification).
>>
>> I also don't know how much of a performance concern this actually is.
> 
> Unless the shader in question is a particularly enthusiastic user of
> the preprocessor, I wouldn't expect much of a practical performance
> impact at all. This is more of an instance of "linked-lists need
> justification".
> 

Sure. I don't want to argue I've provided a lot of justification, of
course, but it does make things a bit easier. I'd be just as comfortable
with replacing the linked list with a list of pointers, if that's
clearly preferable.



More information about the wine-devel mailing list