mesa,glsl,nir: reduce gl_state_index size to 2 bytes

Let's use the new gl_state_index16 type everywhere and remove
the typecasts.

This helps reduce the size of gl_program_parameter.

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Marek Olšák
2017-11-16 04:29:35 +01:00
parent a7882013d3
commit e149a0253c
27 changed files with 63 additions and 63 deletions

View File

@@ -397,7 +397,7 @@ depth_layout_string(ir_depth_layout layout);
* \sa ir_variable::state_slots
*/
struct ir_state_slot {
int tokens[5];
gl_state_index16 tokens[5];
int swizzle;
};

View File

@@ -975,7 +975,7 @@ static void
read_shader_parameters(struct blob_reader *metadata,
struct gl_program_parameter_list *params)
{
gl_state_index state_indexes[STATE_LENGTH];
gl_state_index16 state_indexes[STATE_LENGTH];
uint32_t i = 0;
uint32_t num_parameters = blob_read_uint32(metadata);

View File

@@ -100,13 +100,13 @@ _mesa_new_shader(GLuint name, gl_shader_stage stage)
}
GLbitfield
_mesa_program_state_flags(UNUSED const gl_state_index state[STATE_LENGTH])
_mesa_program_state_flags(UNUSED const gl_state_index16 state[STATE_LENGTH])
{
return 0;
}
char *
_mesa_program_state_string(UNUSED const gl_state_index state[STATE_LENGTH])
_mesa_program_state_string(UNUSED const gl_state_index16 state[STATE_LENGTH])
{
return NULL;
}

View File

@@ -69,11 +69,11 @@ _mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
const char *msg);
extern "C" GLbitfield
_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
_mesa_program_state_flags(const gl_state_index16 state[STATE_LENGTH]);
extern "C" char *
_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
_mesa_program_state_string(const gl_state_index16 state[STATE_LENGTH]);
static inline gl_shader_stage
_mesa_shader_enum_to_shader_stage(GLenum v)