[Mesa-dev] [PATCH 4/4] r600g: use a bitfield to track dirty atoms

Marek Olšák maraeo at gmail.com
Tue Aug 11 05:40:33 PDT 2015


On Tue, Aug 11, 2015 at 2:20 AM, Grazvydas Ignotas <notasas at gmail.com> wrote:
> On Mon, Aug 10, 2015 at 1:47 PM, Marek Olšák <maraeo at gmail.com> wrote:
>> Please never use "long" in Mesa. It only has 32 bits on 32-bit
>> systems. uint64_t is generally used for all unsigned 64-bit variables
>> and "llu" or "ull" is the number suffix. Also, the 64-bit ctz is ctzll
>> and a proper HAVE macro should be added for it too.
>
> Well I intentionally chose long to have a machine-word sized type, for
> uint64_t gcc would have to emit multiple instructions for bit setting
> and ctzll on 32bit CPUs (actually a library call for ctzll from what I
> see), so the idea was to use longer array there instead.

Sounds good.

>
>> The general idea is nice, thanks.
>>
>> The number of atoms can be cut down by merging all scissors states
>> into 1 atom (just as there is 1 atom for 16 textures, there can be 1
>> atom for 16 scissors) and the same applies to viewport states. This
>> would simplify the code, because all dirty bits would fit into 64 bits
>> and there would even be some space left.
>
> This sounds good, I'll try to work on it when I can find time.
>
> Also, do you know why the atoms start from 4 for r600, and 0-3 seem to
> be unused?

No idea. Maybe it's a typo.

Marek


More information about the mesa-dev mailing list