[Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

0xe2.0x9a.0x9b at gmail.com
Mon Oct 17 23:26:45 UTC 2016

On Tue, Oct 18, 2016 at 12:45 AM, Thomas Helland
<thomashelland90 at gmail.com> wrote:
> I can't quite tell, as Gmail tends to mangle whitespace stuff,
> but it looks like there might be some style issues with
> not everything following the three-space indent, no tabs
> policy that mesa tries to stick to.

I followed the 3-space indent and no tabs rule in my source code.

The original (unpatched) file opt_dead_code.cpp needs some reformatting.

> On the subject of this patch, some thoughts that came to mind:
> I think it would be preferred if the implementation was in C.
> Using this in NIR, which tries to be C only, might be a possibility?

In the context of glsl, I would like to stick to C++. (Besides, if it
was up to my decision, I would convert many Mesa files from C to C++
because the latter is a slightly more productive programming language)

Mesa lacks a C++ implementation of a high-performance list backed an
array. I tried to use std::vector<T> prior to implementing my own
arraylist<T,N>, but std::vector's code is so complex that the C++
compiler has issues optimizing it.

The new arraylist<T,N> type is very simple, so that the C++ compiler
can compile it quickly and can optimize it.

More information about the mesa-dev mailing list