[Mesa-dev] [PATCH 10/13] mesa, glsl, nir: reduce gl_state_index size to 2 bytes

Brian Paul brian.e.paul at gmail.com
Fri Feb 9 02:01:56 UTC 2018


Again, I can't research this right now, but what values in the
gl_state_index array are greater than 255?  Perhaps you can add a comment
about that.  And if that's not the case, gl_state_index8?

Also, longer term, it might be cleaner in general if the gl_state_index
array was encapsulated in a structure:

struct gl_state_record
{
   gl_state_index16 tokens[STATE_LENGTH];
};

-Brian


On Thu, Feb 8, 2018 at 6:18 PM, Marek Olšák <maraeo at gmail.com> wrote:

> From: Marek Olšák <marek.olsak at amd.com>
>
> Let's use the new gl_state_index16 type everywhere and remove
> the typecasts.
>
> This helps reduce the size of gl_program_parameter.
> ---
>  src/compiler/glsl/ir.h                         |  2 +-
>  src/compiler/glsl/serialize.cpp                |  2 +-
>  src/compiler/glsl/standalone_scaffolding.cpp   |  4 ++--
>  src/compiler/glsl/standalone_scaffolding.h     |  4 ++--
>  src/compiler/nir/nir.h                         | 10 +++++-----
>  src/compiler/nir/nir_lower_drawpixels.c        |  3 ++-
>  src/compiler/shader_enums.h                    |  2 ++
>  src/mesa/drivers/dri/i965/brw_link.cpp         |  3 +--
>  src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp |  2 +-
>  src/mesa/drivers/dri/i965/brw_program.c        |  2 +-
>  src/mesa/drivers/dri/r200/r200_vertprog.c      |  2 +-
>  src/mesa/main/ffvertex_prog.c                  |  2 +-
>  src/mesa/main/tests/program_state_string.cpp   |  2 +-
>  src/mesa/main/uniforms.h                       |  2 +-
>  src/mesa/program/ir_to_mesa.cpp                |  2 +-
>  src/mesa/program/prog_parameter.c              | 10 +++++-----
>  src/mesa/program/prog_parameter.h              |  6 +++---
>  src/mesa/program/prog_statevars.c              |  6 +++---
>  src/mesa/program/prog_statevars.h              |  5 ++---
>  src/mesa/program/program_parse.y               | 18 +++++++++---------
>  src/mesa/program/programopt.c                  |  8 ++++----
>  src/mesa/state_tracker/st_atifs_to_tgsi.c      |  4 ++--
>  src/mesa/state_tracker/st_glsl_to_nir.cpp      |  6 +++---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp     |  7 +++----
>  src/mesa/state_tracker/st_mesa_to_tgsi.c       |  2 +-
>  src/mesa/state_tracker/st_nir_lower_builtin.c  |  4 ++--
>  src/mesa/state_tracker/st_program.c            |  6 +++---
>  27 files changed, 63 insertions(+), 63 deletions(-)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180208/702dbc51/attachment.html>


More information about the mesa-dev mailing list