[Mesa-dev] [RFC PATCH] st/mesa/r200/i915/i965: move ARB program fields into a union

Marek Olšák maraeo at gmail.com
Wed Nov 2 11:08:31 UTC 2016


On Wed, Nov 2, 2016 at 2:38 AM, Timothy Arceri
<timothy.arceri at collabora.com> wrote:
> I'm about to do some refactoring that will move a bunch of glsl only
> fields from gl_linked_program into gl_program.
>
> If we wan't to share memory it makes sense to do it while I move
> things. I just wanted to see what people think about this before
> I get started as it's not going to be fun to go back and undo.
>
> It seems common for games to compile 2000 programs or more so at
>
> 32bits X 2000 programs X 22 fields X 2 (at least) stages
>
> This should give us something like 352 kilobytes in savings.
>
> What do you think?

Sounds good, but if you wanna save memory, using GLuint everywhere is
a bad idea. I suggest using uint8_t or uint16_t where appropriate.
Bitfields are even better, but probably overkill here.

Marek


More information about the mesa-dev mailing list