[Mesa-dev] [PATCH v2 0/3][RFC]mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

Emil Velikov emil.l.velikov at gmail.com
Sat Jun 17 17:28:21 UTC 2017


On 16 June 2017 at 17:16, Gert Wollny <gw.fossdev at gmail.com> wrote:
> Hello Emil,
>
> Am Freitag, den 16.06.2017, 15:21 +0100 schrieb Emil Velikov:
>>
>> Please don't use STL within core mesa code.
> May I ask why? I always try to not re-implement already available
> functionality and since mesa already uses C++ it seems kind of natural
> to use the STL because it provides a well tested implementation for
> containers and algorithms.
>
A while ago, as the first C++ code was introduced to Mesa there was a
consensus amongst developers about the dos and don'ts. At the end
people concluded against STL, although I'm afraid I don't recall the
details.

On the other hand, devs. can use whatever they prefer in their drivers.

> Anyway, to avoid code duplication, are there already alternative
> implementations available within mesa for an array that can dynamically
> grow like std::vector and std::stack, and for the algorithm
> std::upper_bound working on an array?
>
There's vector, list and hash in src/util. Not sure about stack or
upper_bound. From vague memory the former can be easily done via a
list?

> A couple of additional ideas:
>>  - where possible try to split patches even further.
>> IIRC 2/3 adds some 2kloc, which may be hard to review properly.
> On one hand it seems something went wrong when I was rebasing the
> patches, part of 1 ended up in 2 :/
>
> When I correct this patch 2 will add ~1500 lines of which ~700 is real
> functionality and ~800 are test code that doesn't go into the library.
> I can probably split out 100 lines though, separating the two parts of
> the algorithm.
>
Hmm perhaps it's worth adding the test as a follow-up commit?
Admittedly I haven't looked at the patches so cannot offer a better
advise.

>>  - do keep performance numbers within the commit summary.
>> This way the details are preserved in git log for future references.
> Okay.
>
> many thanks for your comments,
Yw.

Thanks
Emil


More information about the mesa-dev mailing list