mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-10 20:10:31 +01:00
mesa: Pack gl_program_parameter struct
The gl_register_file doesn't need 16 bits, so shorten it and use the extra room for 'Padded' (also mark it as a single bit). This shrinks the struct size from 32 bytes to 24 bytes. See also4794fbc86e("mesa: reduce the size of gl_program_parameter") that shrinked from 40 to 24 and later7536af670b("glsl: fix shader cache for packed param list") that added `Padded`. v2: Use just 5 bits for gl_register_file. (Timothy) Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
eda596d64b
commit
eea3aa25aa
1 changed files with 9 additions and 7 deletions
|
|
@ -91,8 +91,16 @@ typedef union gl_constant_value
|
|||
struct gl_program_parameter
|
||||
{
|
||||
const char *Name; /**< Null-terminated string */
|
||||
gl_register_file Type:16; /**< PROGRAM_CONSTANT or STATE_VAR */
|
||||
gl_register_file Type:5; /**< PROGRAM_CONSTANT or STATE_VAR */
|
||||
|
||||
/**
|
||||
* We need to keep track of whether the param is padded for use in the
|
||||
* shader cache.
|
||||
*/
|
||||
bool Padded:1;
|
||||
|
||||
GLenum16 DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */
|
||||
|
||||
/**
|
||||
* Number of components (1..4), or more.
|
||||
* If the number of components is greater than 4,
|
||||
|
|
@ -104,12 +112,6 @@ struct gl_program_parameter
|
|||
* A sequence of STATE_* tokens and integers to identify GL state.
|
||||
*/
|
||||
gl_state_index16 StateIndexes[STATE_LENGTH];
|
||||
|
||||
/**
|
||||
* We need to keep track of whether the param is padded for use in the
|
||||
* shader cache.
|
||||
*/
|
||||
bool Padded;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue