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

Henri Verbeet hverbeet at gmail.com
Tue Jan 5 12:02:20 CST 2021


On Tue, 5 Jan 2021 at 18:22, Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
>
> On 1/5/21 11:12 AM, Henri Verbeet wrote:
> > On Tue, 5 Jan 2021 at 17:17, Zebediah Figura <zfigura at codeweavers.com> wrote:
> >> @@ -41,6 +47,8 @@ struct preproc_ctx
> >>      struct vkd3d_string_buffer buffer;
> >>      struct vkd3d_shader_location location;
> >>
> >> +    struct list macros;
> >> +
> > Does that need to be a list? For the purposes of this series, it seems
> > an array would work at least as well.
> >
> It eases removal via #undef. There's also a couple places that
> store pointers to the macro (I think they're not in this series, but
> rather relate to expansion) which would complicate using a flat array at
> least.

Unless we care about the order, removal would essentially be
"macros[idx] = macros[--macro_count];"
Storing pointers to macros would indeed be an issue, although I'd
expect that to be an issue regardless of how macros are stored, unless
you also e.g. reference count them. Either way, if it's needed for
later patches that's fine.



More information about the wine-devel mailing list