summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program_parse.y
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-11-16 04:29:35 +0100
committerMarek Olšák <[email protected]>2018-02-13 01:00:45 +0100
commite149a0253c12d103805230bc7bc0a36887c3b8df (patch)
tree2eedb0e74a1d0f71c76634ac165f925feecfa1b3 /src/mesa/program/program_parse.y
parenta7882013d3e788a76cce638704c02b7bea0e67a1 (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/program/program_parse.y')
-rw-r--r--src/mesa/program/program_parse.y18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 1bc5f515494..8adbbf0ac5b 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -45,13 +45,13 @@ static struct asm_symbol *declare_variable(struct asm_parser_state *state,
char *name, enum asm_type t, struct YYLTYPE *locp);
static int add_state_reference(struct gl_program_parameter_list *param_list,
- const gl_state_index tokens[STATE_LENGTH]);
+ const gl_state_index16 tokens[STATE_LENGTH]);
static int initialize_symbol_from_state(struct gl_program *prog,
- struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]);
+ struct asm_symbol *param_var, const gl_state_index16 tokens[STATE_LENGTH]);
static int initialize_symbol_from_param(struct gl_program *prog,
- struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]);
+ struct asm_symbol *param_var, const gl_state_index16 tokens[STATE_LENGTH]);
static int initialize_symbol_from_const(struct gl_program *prog,
struct asm_symbol *param_var, const struct asm_vector *vec,
@@ -136,7 +136,7 @@ static struct asm_instruction *asm_instruction_copy_ctor(
unsigned attrib;
int integer;
float real;
- gl_state_index state[STATE_LENGTH];
+ gl_state_index16 state[STATE_LENGTH];
int negate;
struct asm_vector vector;
enum prog_opcode opcode;
@@ -2299,7 +2299,7 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
int add_state_reference(struct gl_program_parameter_list *param_list,
- const gl_state_index tokens[STATE_LENGTH])
+ const gl_state_index16 tokens[STATE_LENGTH])
{
const GLuint size = 4; /* XXX fix */
char *name;
@@ -2320,10 +2320,10 @@ int add_state_reference(struct gl_program_parameter_list *param_list,
int
initialize_symbol_from_state(struct gl_program *prog,
struct asm_symbol *param_var,
- const gl_state_index tokens[STATE_LENGTH])
+ const gl_state_index16 tokens[STATE_LENGTH])
{
int idx = -1;
- gl_state_index state_tokens[STATE_LENGTH];
+ gl_state_index16 state_tokens[STATE_LENGTH];
memcpy(state_tokens, tokens, sizeof(state_tokens));
@@ -2372,10 +2372,10 @@ initialize_symbol_from_state(struct gl_program *prog,
int
initialize_symbol_from_param(struct gl_program *prog,
struct asm_symbol *param_var,
- const gl_state_index tokens[STATE_LENGTH])
+ const gl_state_index16 tokens[STATE_LENGTH])
{
int idx = -1;
- gl_state_index state_tokens[STATE_LENGTH];
+ gl_state_index16 state_tokens[STATE_LENGTH];
memcpy(state_tokens, tokens, sizeof(state_tokens));